libs/mpegts: Rename GstMpegTS => GstMpegTs

Sorry for this :( But this makes it more in sync with expected type
naming in gobject (i.e. CamelCase and not CamelMAYBECase).

Also split descriptor type enums into the different variants:
* ISO H.222.0 / 13818-1 (i.e. standard mpeg-ts)
* DVB
* ATSC
* ISDB
* miscellaneous

This will avoid future clashes when specs use the same descriptor type
This commit is contained in:
Edward Hervey 2013-07-03 13:56:22 +02:00
parent dc160e7ca7
commit c1366efcd6
6 changed files with 336 additions and 327 deletions

View file

@ -14,11 +14,11 @@ gst_mpeg_ts_cable_outer_fec_scheme_get_type
gst_mpeg_ts_modulation_type_get_type gst_mpeg_ts_modulation_type_get_type
gst_mpeg_ts_satellite_polarization_type_get_type gst_mpeg_ts_satellite_polarization_type_get_type
gst_mpeg_ts_satellite_rolloff_get_type gst_mpeg_ts_satellite_rolloff_get_type
gst_mpeg_tsdvb_code_rate_get_type gst_mpeg_ts_dvb_code_rate_get_type
gst_mpeg_ts_descriptor_type_get_type gst_mpeg_ts_descriptor_type_get_type
gst_mpeg_ts_iso639_audio_type_get_type gst_mpeg_ts_iso639_audio_type_get_type
gst_mpeg_ts_running_status_get_type gst_mpeg_ts_running_status_get_type
gst_mpeg_tsdvb_service_type_get_type gst_mpeg_ts_dvb_service_type_get_type
gst_insert_bin_get_type gst_insert_bin_get_type

View file

@ -51,7 +51,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_
GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \ GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \
$(INTROSPECTION_SCANNER) -v --namespace GstMpegts \ $(INTROSPECTION_SCANNER) -v --namespace GstMpegts \
--nsversion=@GST_API_VERSION@ \ --nsversion=@GST_API_VERSION@ \
--identifier-prefix=GstMpegTS \ --identifier-prefix=GstMpegTs \
--symbol-prefix=gst_mpegts \ --symbol-prefix=gst_mpegts \
--symbol-prefix=gst \ --symbol-prefix=gst \
--warn-all -v \ --warn-all -v \

View file

@ -455,7 +455,7 @@ failed:
* *
* Note: The data provided in @buffer will not be copied. * Note: The data provided in @buffer will not be copied.
* *
* Returns: (transfer full) (element-type GstMpegTSDescriptor): an * Returns: (transfer full) (element-type GstMpegTsDescriptor): an
* array of the parsed descriptors or %NULL if there was an error. * array of the parsed descriptors or %NULL if there was an error.
* Release with #g_array_unref when done with it. * Release with #g_array_unref when done with it.
*/ */
@ -469,7 +469,7 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len)
/* fast-path */ /* fast-path */
if (buf_len == 0) if (buf_len == 0)
return g_array_new (FALSE, FALSE, sizeof (GstMpegTSDescriptor)); return g_array_new (FALSE, FALSE, sizeof (GstMpegTsDescriptor));
data = buffer; data = buffer;
@ -496,12 +496,12 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len)
return NULL; return NULL;
} }
res = g_array_sized_new (FALSE, FALSE, sizeof (GstMpegTSDescriptor), nb_desc); res = g_array_sized_new (FALSE, FALSE, sizeof (GstMpegTsDescriptor), nb_desc);
data = buffer; data = buffer;
for (i = 0; i < nb_desc; i++) { for (i = 0; i < nb_desc; i++) {
GstMpegTSDescriptor *desc = &g_array_index (res, GstMpegTSDescriptor, i); GstMpegTsDescriptor *desc = &g_array_index (res, GstMpegTsDescriptor, i);
desc->descriptor_data = data; desc->descriptor_data = data;
desc->descriptor_tag = *data++; desc->descriptor_tag = *data++;
@ -525,8 +525,8 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len)
/** /**
* gst_mpegts_find_descriptor: * gst_mpegts_find_descriptor:
* @descriptors: (element-type GstMpegTSDescriptor) (transfer none): an array * @descriptors: (element-type GstMpegTsDescriptor) (transfer none): an array
* of #GstMpegTSDescriptor * of #GstMpegTsDescriptor
* @tag: the tag to look for * @tag: the tag to look for
* *
* Finds the first descriptor of type @tag in the array. * Finds the first descriptor of type @tag in the array.
@ -536,7 +536,7 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len)
* *
* Returns: (transfer none): the first descriptor matchin @tag, else %NULL. * Returns: (transfer none): the first descriptor matchin @tag, else %NULL.
*/ */
const GstMpegTSDescriptor * const GstMpegTsDescriptor *
gst_mpegts_find_descriptor (GArray * descriptors, guint8 tag) gst_mpegts_find_descriptor (GArray * descriptors, guint8 tag)
{ {
guint i, nb_desc; guint i, nb_desc;
@ -545,20 +545,20 @@ gst_mpegts_find_descriptor (GArray * descriptors, guint8 tag)
nb_desc = descriptors->len; nb_desc = descriptors->len;
for (i = 0; i < nb_desc; i++) { for (i = 0; i < nb_desc; i++) {
GstMpegTSDescriptor *desc = GstMpegTsDescriptor *desc =
&g_array_index (descriptors, GstMpegTSDescriptor, i); &g_array_index (descriptors, GstMpegTsDescriptor, i);
if (desc->descriptor_tag == tag) if (desc->descriptor_tag == tag)
return (const GstMpegTSDescriptor *) desc; return (const GstMpegTsDescriptor *) desc;
} }
return NULL; return NULL;
} }
static GstMpegTSDescriptor * static GstMpegTsDescriptor *
_copy_descriptor (GstMpegTSDescriptor * desc) _copy_descriptor (GstMpegTsDescriptor * desc)
{ {
GstMpegTSDescriptor *copy; GstMpegTsDescriptor *copy;
copy = g_new0 (GstMpegTSDescriptor, 1); copy = g_new0 (GstMpegTsDescriptor, 1);
copy->descriptor_tag = desc->descriptor_tag; copy->descriptor_tag = desc->descriptor_tag;
copy->descriptor_tag_extension = desc->descriptor_tag_extension; copy->descriptor_tag_extension = desc->descriptor_tag_extension;
copy->descriptor_length = desc->descriptor_length; copy->descriptor_length = desc->descriptor_length;
@ -572,20 +572,20 @@ _copy_descriptor (GstMpegTSDescriptor * desc)
* above function. That is why we free the descriptor data (unlike the * above function. That is why we free the descriptor data (unlike the
* descriptors created in _parse_descriptors()) */ * descriptors created in _parse_descriptors()) */
static void static void
_free_descriptor (GstMpegTSDescriptor * desc) _free_descriptor (GstMpegTsDescriptor * desc)
{ {
g_free ((gpointer) desc->descriptor_data); g_free ((gpointer) desc->descriptor_data);
g_free (desc); g_free (desc);
} }
G_DEFINE_BOXED_TYPE (GstMpegTSDescriptor, gst_mpegts_descriptor, G_DEFINE_BOXED_TYPE (GstMpegTsDescriptor, gst_mpegts_descriptor,
(GBoxedCopyFunc) _copy_descriptor, (GBoxedFreeFunc) _free_descriptor); (GBoxedCopyFunc) _copy_descriptor, (GBoxedFreeFunc) _free_descriptor);
/* GST_MTS_DESC_ISO_639_LANGUAGE (0x0A) */ /* GST_MTS_DESC_ISO_639_LANGUAGE (0x0A) */
/** /**
* gst_mpegts_descriptor_parse_iso_639_language: * gst_mpegts_descriptor_parse_iso_639_language:
* @descriptor: a %GST_MTS_DESC_ISO_639_LANGUAGE #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_ISO_639_LANGUAGE #GstMpegTsDescriptor
* @res: (out) (transfer none): the #GstMpegTSISO639LanguageDescriptor to fill * @res: (out) (transfer none): the #GstMpegTsISO639LanguageDescriptor to fill
* *
* Extracts the iso 639-2 language information from @descriptor. * Extracts the iso 639-2 language information from @descriptor.
* *
@ -595,8 +595,8 @@ G_DEFINE_BOXED_TYPE (GstMpegTSDescriptor, gst_mpegts_descriptor,
* Returns: %TRUE if parsing succeeded, else %FALSE. * Returns: %TRUE if parsing succeeded, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_iso_639_language (const GstMpegTSDescriptor * gst_mpegts_descriptor_parse_iso_639_language (const GstMpegTsDescriptor *
descriptor, GstMpegTSISO639LanguageDescriptor * res) descriptor, GstMpegTsISO639LanguageDescriptor * res)
{ {
guint i; guint i;
guint8 *data; guint8 *data;
@ -622,7 +622,7 @@ gst_mpegts_descriptor_parse_iso_639_language (const GstMpegTSDescriptor *
/* GST_MTS_DESC_DVB_NETWORK_NAME (0x40) */ /* GST_MTS_DESC_DVB_NETWORK_NAME (0x40) */
/** /**
* gst_mpegts_descriptor_parse_dvb_network_name: * gst_mpegts_descriptor_parse_dvb_network_name:
* @descriptor: a %GST_MTS_DESC_DVB_NETWORK_NAME #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_DVB_NETWORK_NAME #GstMpegTsDescriptor
* @name: (out) (transfer full): the extracted name * @name: (out) (transfer full): the extracted name
* *
* Parses out the dvb network name from the @descriptor: * Parses out the dvb network name from the @descriptor:
@ -630,7 +630,7 @@ gst_mpegts_descriptor_parse_iso_639_language (const GstMpegTSDescriptor *
* Returns: %TRUE if the parsing happened correctly, else %FALSE. * Returns: %TRUE if the parsing happened correctly, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTSDescriptor * gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTsDescriptor *
descriptor, gchar ** name) descriptor, gchar ** name)
{ {
g_return_val_if_fail (descriptor != NULL g_return_val_if_fail (descriptor != NULL
@ -645,16 +645,16 @@ gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTSDescriptor *
/* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */ /* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */
/** /**
* gst_mpegts_descriptor_parse_satellite_delivery_system: * gst_mpegts_descriptor_parse_satellite_delivery_system:
* @descriptor: a %GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM #GstMpegTsDescriptor
* @res: (out) (transfer none): the #GstMpegTSSatelliteDeliverySystemDescriptor to fill * @res: (out) (transfer none): the #GstMpegTsSatelliteDeliverySystemDescriptor to fill
* *
* Extracts the satellite delivery system information from @descriptor. * Extracts the satellite delivery system information from @descriptor.
* *
* Returns: %TRUE if parsing succeeded, else %FALSE. * Returns: %TRUE if parsing succeeded, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegTSDescriptor gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegTsDescriptor
* descriptor, GstMpegTSSatelliteDeliverySystemDescriptor * res) * descriptor, GstMpegTsSatelliteDeliverySystemDescriptor * res)
{ {
guint8 *data; guint8 *data;
guint8 tmp; guint8 tmp;
@ -722,16 +722,16 @@ gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegTSDescriptor
/* GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM (0x44) */ /* GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM (0x44) */
/** /**
* gst_mpegts_descriptor_parse_cable_delivery_system: * gst_mpegts_descriptor_parse_cable_delivery_system:
* @descriptor: a %GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_DVB_CABLE_DELIVERY_SYSTEM #GstMpegTsDescriptor
* @res: (out) (transfer none): the #GstMpegTSCableDeliverySystemDescriptor to fill * @res: (out) (transfer none): the #GstMpegTsCableDeliverySystemDescriptor to fill
* *
* Extracts the cable delivery system information from @descriptor. * Extracts the cable delivery system information from @descriptor.
* *
* Returns: %TRUE if parsing succeeded, else %FALSE. * Returns: %TRUE if parsing succeeded, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegTSDescriptor * gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegTsDescriptor *
descriptor, GstMpegTSCableDeliverySystemDescriptor * res) descriptor, GstMpegTsCableDeliverySystemDescriptor * res)
{ {
guint8 *data; guint8 *data;
@ -785,7 +785,7 @@ gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegTSDescriptor *
/* GST_MTS_DESC_DVB_SERVICE (0x48) */ /* GST_MTS_DESC_DVB_SERVICE (0x48) */
/** /**
* gst_mpegts_descriptor_parse_dvb_service: * gst_mpegts_descriptor_parse_dvb_service:
* @descriptor: a %GST_MTS_DESC_DVB_SERVICE #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_DVB_SERVICE #GstMpegTsDescriptor
* @service_type: (out) (allow-none): the service type * @service_type: (out) (allow-none): the service type
* @service_name: (out) (transfer full) (allow-none): the service name * @service_name: (out) (transfer full) (allow-none): the service name
* @provider_name: (out) (transfer full) (allow-none): the provider name * @provider_name: (out) (transfer full) (allow-none): the provider name
@ -795,8 +795,8 @@ gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegTSDescriptor *
* Returns: %TRUE if parsing succeeded, else %FALSE. * Returns: %TRUE if parsing succeeded, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_dvb_service (const GstMpegTSDescriptor * gst_mpegts_descriptor_parse_dvb_service (const GstMpegTsDescriptor *
descriptor, GstMpegTSDVBServiceType * service_type, gchar ** service_name, descriptor, GstMpegTsDVBServiceType * service_type, gchar ** service_name,
gchar ** provider_name) gchar ** provider_name)
{ {
guint8 *data; guint8 *data;
@ -822,7 +822,7 @@ gst_mpegts_descriptor_parse_dvb_service (const GstMpegTSDescriptor *
/* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */ /* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */
/** /**
* gst_mpegts_descriptor_parse_dvb_short_event: * gst_mpegts_descriptor_parse_dvb_short_event:
* @descriptor: a %GST_MTS_DESC_DVB_SHORT_EVENT #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_DVB_SHORT_EVENT #GstMpegTsDescriptor
* @language_code: (out) (transfer full) (allow-none): the language code * @language_code: (out) (transfer full) (allow-none): the language code
* @event_name: (out) (transfer full) (allow-none): the event name * @event_name: (out) (transfer full) (allow-none): the event name
* @text: (out) (transfer full) (allow-none): the event text * @text: (out) (transfer full) (allow-none): the event text
@ -832,7 +832,7 @@ gst_mpegts_descriptor_parse_dvb_service (const GstMpegTSDescriptor *
* Returns: %TRUE if parsing succeeded, else %FALSE. * Returns: %TRUE if parsing succeeded, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegTSDescriptor * gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegTsDescriptor *
descriptor, gchar ** language_code, gchar ** event_name, gchar ** text) descriptor, gchar ** language_code, gchar ** event_name, gchar ** text)
{ {
guint8 *data; guint8 *data;
@ -858,16 +858,16 @@ gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegTSDescriptor *
/** /**
* gst_mpegts_descriptor_parse_logical_channel: * gst_mpegts_descriptor_parse_logical_channel:
* @descriptor: a %GST_MTS_DESC_DTG_LOGICAL_CHANNEL #GstMpegTSDescriptor * @descriptor: a %GST_MTS_DESC_DTG_LOGICAL_CHANNEL #GstMpegTsDescriptor
* @res: (out) (transfer none): the #GstMpegTSLogicalChannelDescriptor to fill * @res: (out) (transfer none): the #GstMpegTsLogicalChannelDescriptor to fill
* *
* Extracts the logical channels from @descriptor. * Extracts the logical channels from @descriptor.
* *
* Returns: %TRUE if parsing succeeded, else %FALSE. * Returns: %TRUE if parsing succeeded, else %FALSE.
*/ */
gboolean gboolean
gst_mpegts_descriptor_parse_logical_channel (const GstMpegTSDescriptor * gst_mpegts_descriptor_parse_logical_channel (const GstMpegTsDescriptor *
descriptor, GstMpegTSLogicalChannelDescriptor * res) descriptor, GstMpegTsLogicalChannelDescriptor * res)
{ {
guint i; guint i;
guint8 *data; guint8 *data;

View file

@ -60,9 +60,9 @@
*/ */
/** /**
* GstMpegTSDescriptorType: * GstMpegTsDescriptorType:
* *
* The type of #GstMpegTSDescriptor * The type of #GstMpegTsDescriptor
* *
* Consult the relevant specifications for more details. * Consult the relevant specifications for more details.
*/ */
@ -130,7 +130,9 @@ typedef enum {
GST_MTS_DESC_STEREOSCOPIC_VIDEO_INFO = 0x36, GST_MTS_DESC_STEREOSCOPIC_VIDEO_INFO = 0x36,
/* 55-63 ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved */ /* 55-63 ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved */
} GstMpegTsDescriptorType;
typedef enum {
/* 64-127 DVB tags ETSI EN 300 468 /* 64-127 DVB tags ETSI EN 300 468
* (Specification for Service Information (SI) in DVB systems) * (Specification for Service Information (SI) in DVB systems)
*/ */
@ -195,13 +197,18 @@ typedef enum {
GST_MTS_DESC_DVB_ENHANCED_AC3 = 0x7A, GST_MTS_DESC_DVB_ENHANCED_AC3 = 0x7A,
GST_MTS_DESC_DVB_DTS = 0x7B, GST_MTS_DESC_DVB_DTS = 0x7B,
GST_MTS_DESC_DVB_AAC = 0x7C, GST_MTS_DESC_DVB_AAC = 0x7C,
/* 0x7D and 0x7E are reserved for future use */ GST_MTS_DESC_DVB_XAIT_LOCATION = 0x7D,
GST_MTS_DESC_DVB_FTA_CONTENT_MANAGEMENT = 0x7E,
GST_MTS_DESC_DVB_EXTENSION = 0x7F, GST_MTS_DESC_DVB_EXTENSION = 0x7F,
} GstMpegTsDVBDescriptorType;
typedef enum {
/* 0x80 - 0xFE are user defined */ /* 0x80 - 0xFE are user defined */
GST_MTS_DESC_AC3_AUDIO_STREAM = 0x81, GST_MTS_DESC_AC3_AUDIO_STREAM = 0x81,
GST_MTS_DESC_DTG_LOGICAL_CHANNEL = 0x83, /* from DTG D-Book */ GST_MTS_DESC_DTG_LOGICAL_CHANNEL = 0x83, /* from DTG D-Book */
} GstMpegTsMiscDescriptorType;
typedef enum {
/* ATSC A/65 2009 */ /* ATSC A/65 2009 */
GST_MTS_DESC_ATSC_STUFFING = 0x80, GST_MTS_DESC_ATSC_STUFFING = 0x80,
GST_MTS_DESC_ATSC_AC3 = 0x83, GST_MTS_DESC_ATSC_AC3 = 0x83,
@ -228,7 +235,9 @@ typedef enum {
GST_MTS_DESC_ATSC_MODULE_LINK = 0xB4, GST_MTS_DESC_ATSC_MODULE_LINK = 0xB4,
GST_MTS_DESC_ATSC_CRC32 = 0xB5, GST_MTS_DESC_ATSC_CRC32 = 0xB5,
GST_MTS_DESC_ATSC_GROUP_LINK = 0xB8, GST_MTS_DESC_ATSC_GROUP_LINK = 0xB8,
} GstMpegTsATSCDescriptorType;
typedef enum {
/* ISDB ARIB B10 v4.6 */ /* ISDB ARIB B10 v4.6 */
GST_MTS_DESC_ISDB_HIERARCHICAL_TRANSMISSION = 0xC0, GST_MTS_DESC_ISDB_HIERARCHICAL_TRANSMISSION = 0xC0,
GST_MTS_DESC_ISDB_DIGITAL_COPY_CONTROL = 0xC1, GST_MTS_DESC_ISDB_DIGITAL_COPY_CONTROL = 0xC1,
@ -264,15 +273,15 @@ typedef enum {
/* ... */ /* ... */
GST_MTS_DESC_ISDB_SERVICE_GROUP = 0xe0 GST_MTS_DESC_ISDB_SERVICE_GROUP = 0xe0
} GstMpegTSDescriptorType; } GstMpegTsISDBDescriptorType;
typedef struct _GstMpegTSDescriptor GstMpegTSDescriptor; typedef struct _GstMpegTsDescriptor GstMpegTsDescriptor;
#define GST_TYPE_MPEGTS_DESCRIPTOR (gst_mpegts_descriptor_get_type()) #define GST_TYPE_MPEGTS_DESCRIPTOR (gst_mpegts_descriptor_get_type())
GType gst_mpegts_descriptor_get_type (void); GType gst_mpegts_descriptor_get_type (void);
/** /**
* GstMpegTSDescriptor: * GstMpegTsDescriptor:
* @descriptor_tag: the type of descriptor * @descriptor_tag: the type of descriptor
* @descriptor_tag_extension: the extended type (if @descriptor_tag is 0x7f) * @descriptor_tag_extension: the extended type (if @descriptor_tag is 0x7f)
* @descriptor_length: the length of the descriptor content (excluding tag/length field) * @descriptor_length: the length of the descriptor content (excluding tag/length field)
@ -280,9 +289,9 @@ GType gst_mpegts_descriptor_get_type (void);
* *
* Mpeg-TS descriptor (ISO/IEC 13818-1). * Mpeg-TS descriptor (ISO/IEC 13818-1).
*/ */
struct _GstMpegTSDescriptor struct _GstMpegTsDescriptor
{ {
GstMpegTSDescriptorType descriptor_tag; guint8 descriptor_tag;
guint8 descriptor_tag_extension; guint8 descriptor_tag_extension;
guint8 descriptor_length; guint8 descriptor_length;
const guint8 *descriptor_data; const guint8 *descriptor_data;
@ -290,12 +299,12 @@ struct _GstMpegTSDescriptor
GArray *gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len); GArray *gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len);
const GstMpegTSDescriptor * gst_mpegts_find_descriptor (GArray *descriptors, const GstMpegTsDescriptor * gst_mpegts_find_descriptor (GArray *descriptors,
guint8 tag); guint8 tag);
/* GST_MTS_DESC_ISO_639_LANGUAGE (0x0A) */ /* GST_MTS_DESC_ISO_639_LANGUAGE (0x0A) */
/** /**
* GstMpegTSISO639AudioType: * GstMpegTsISO639AudioType:
* *
* Type of audio streams * Type of audio streams
* *
@ -306,32 +315,32 @@ typedef enum {
GST_MPEGTS_AUDIO_TYPE_CLEAN_EFFECTS, GST_MPEGTS_AUDIO_TYPE_CLEAN_EFFECTS,
GST_MPEGTS_AUDIO_TYPE_HEARING_IMPAIRED, GST_MPEGTS_AUDIO_TYPE_HEARING_IMPAIRED,
GST_MPEGTS_AUDIO_TYPE_VISUAL_IMPAIRED_COMMENTARY GST_MPEGTS_AUDIO_TYPE_VISUAL_IMPAIRED_COMMENTARY
} GstMpegTSIso639AudioType; } GstMpegTsIso639AudioType;
/* FIXME: Make two methods. One for getting the number of languages, /* FIXME: Make two methods. One for getting the number of languages,
* and the other for getting the (allocated, null-terminated) language * and the other for getting the (allocated, null-terminated) language
* and audio type */ * and audio type */
typedef struct _GstMpegTSISO639LanguageDescriptor GstMpegTSISO639LanguageDescriptor; typedef struct _GstMpegTsISO639LanguageDescriptor GstMpegTsISO639LanguageDescriptor;
struct _GstMpegTSISO639LanguageDescriptor struct _GstMpegTsISO639LanguageDescriptor
{ {
guint nb_language; guint nb_language;
gchar language[64][3]; gchar language[64][3];
GstMpegTSIso639AudioType audio_type[64]; GstMpegTsIso639AudioType audio_type[64];
}; };
gboolean gst_mpegts_descriptor_parse_iso_639_language (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_iso_639_language (const GstMpegTsDescriptor *descriptor,
GstMpegTSISO639LanguageDescriptor *res); GstMpegTsISO639LanguageDescriptor *res);
/* GST_MTS_DESC_DVB_CAROUSEL_IDENTIFIER (0x13) */ /* GST_MTS_DESC_DVB_CAROUSEL_IDENTIFIER (0x13) */
/* FIXME : Implement */ /* FIXME : Implement */
/* GST_MTS_DESC_DVB_NETWORK_NAME (0x40) */ /* GST_MTS_DESC_DVB_NETWORK_NAME (0x40) */
gboolean gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTsDescriptor *descriptor,
gchar **name); gchar **name);
/* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */ /* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */
typedef struct _GstMpegTSSatelliteDeliverySystemDescriptor GstMpegTSSatelliteDeliverySystemDescriptor; typedef struct _GstMpegTsSatelliteDeliverySystemDescriptor GstMpegTsSatelliteDeliverySystemDescriptor;
typedef enum { typedef enum {
GST_MPEGTS_MODULATION_QPSK = 0, GST_MPEGTS_MODULATION_QPSK = 0,
@ -349,7 +358,7 @@ typedef enum {
GST_MPEGTS_MODULATION_DQPSK, GST_MPEGTS_MODULATION_DQPSK,
GST_MPEGTS_MODULATION_QAM_4_NR_, GST_MPEGTS_MODULATION_QAM_4_NR_,
GST_MPEGTS_MODULATION_NONE GST_MPEGTS_MODULATION_NONE
} GstMpegTSModulationType; } GstMpegTsModulationType;
typedef enum { typedef enum {
GST_MPEGTS_FEC_NONE = 0, GST_MPEGTS_FEC_NONE = 0,
@ -365,7 +374,7 @@ typedef enum {
GST_MPEGTS_FEC_3_5, GST_MPEGTS_FEC_3_5,
GST_MPEGTS_FEC_9_10, GST_MPEGTS_FEC_9_10,
GST_MPEGTS_FEC_2_5 GST_MPEGTS_FEC_2_5
} GstMpegTSDVBCodeRate; } GstMpegTsDVBCodeRate;
typedef enum { typedef enum {
GST_MPEGTS_ROLLOFF_35 = 0, GST_MPEGTS_ROLLOFF_35 = 0,
@ -373,17 +382,17 @@ typedef enum {
GST_MPEGTS_ROLLOFF_25, GST_MPEGTS_ROLLOFF_25,
GST_MPEGTS_ROLLOFF_RESERVED, GST_MPEGTS_ROLLOFF_RESERVED,
GST_MPEGTS_ROLLOFF_AUTO GST_MPEGTS_ROLLOFF_AUTO
} GstMpegTSSatelliteRolloff; } GstMpegTsSatelliteRolloff;
typedef enum { typedef enum {
GST_MPEGTS_POLARIZATION_LINEAR_HORIZONTAL = 0, GST_MPEGTS_POLARIZATION_LINEAR_HORIZONTAL = 0,
GST_MPEGTS_POLARIZATION_LINEAR_VERTICAL, GST_MPEGTS_POLARIZATION_LINEAR_VERTICAL,
GST_MPEGTS_POLARIZATION_CIRCULAR_LEFT, GST_MPEGTS_POLARIZATION_CIRCULAR_LEFT,
GST_MPEGTS_POLARIZATION_CIRCULAR_RIGHT GST_MPEGTS_POLARIZATION_CIRCULAR_RIGHT
} GstMpegTSSatellitePolarizationType; } GstMpegTsSatellitePolarizationType;
/** /**
* GstMpegTSSatelliteDeliverySystemDescriptor: * GstMpegTsSatelliteDeliverySystemDescriptor:
* @frequency: the frequency in kHz (kiloHertz) * @frequency: the frequency in kHz (kiloHertz)
* @orbital_position: the orbital position in degrees * @orbital_position: the orbital position in degrees
* @west_east: If %TRUE, the satellite is in the eastern part of the orbit, * @west_east: If %TRUE, the satellite is in the eastern part of the orbit,
@ -397,23 +406,23 @@ typedef enum {
* *
* Satellite Delivery System Descriptor (EN 300 468 v.1.13.1) * Satellite Delivery System Descriptor (EN 300 468 v.1.13.1)
*/ */
struct _GstMpegTSSatelliteDeliverySystemDescriptor struct _GstMpegTsSatelliteDeliverySystemDescriptor
{ {
guint32 frequency; guint32 frequency;
gfloat orbital_position; gfloat orbital_position;
gboolean west_east; gboolean west_east;
GstMpegTSSatellitePolarizationType polarization; GstMpegTsSatellitePolarizationType polarization;
GstMpegTSSatelliteRolloff roll_off; GstMpegTsSatelliteRolloff roll_off;
gboolean modulation_system; gboolean modulation_system;
GstMpegTSModulationType modulation_type; GstMpegTsModulationType modulation_type;
guint32 symbol_rate; guint32 symbol_rate;
GstMpegTSDVBCodeRate fec_inner; GstMpegTsDVBCodeRate fec_inner;
}; };
gboolean gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_satellite_delivery_system (const GstMpegTsDescriptor *descriptor,
GstMpegTSSatelliteDeliverySystemDescriptor *res); GstMpegTsSatelliteDeliverySystemDescriptor *res);
/* FIXME : Implement */ /* FIXME : Implement */
@ -423,11 +432,11 @@ typedef enum {
GST_MPEGTS_CABLE_OUTER_FEC_UNDEFINED = 0, GST_MPEGTS_CABLE_OUTER_FEC_UNDEFINED = 0,
GST_MPEGTS_CABLE_OUTER_FEC_NONE, GST_MPEGTS_CABLE_OUTER_FEC_NONE,
GST_MPEGTS_CABLE_OUTER_FEC_RS_204_188, GST_MPEGTS_CABLE_OUTER_FEC_RS_204_188,
} GstMpegTSCableOuterFECScheme; } GstMpegTsCableOuterFECScheme;
typedef struct _GstMpegTSCableDeliverySystemDescriptor GstMpegTSCableDeliverySystemDescriptor; typedef struct _GstMpegTsCableDeliverySystemDescriptor GstMpegTsCableDeliverySystemDescriptor;
/** /**
* GstMpegTSCableDeliverySystemDescriptor: * GstMpegTsCableDeliverySystemDescriptor:
* @frequency: the frequency in Hz (Hertz) * @frequency: the frequency in Hz (Hertz)
* @outer_fec: the outer FEC scheme used * @outer_fec: the outer FEC scheme used
* @modulation: Modulation scheme used * @modulation: Modulation scheme used
@ -436,22 +445,22 @@ typedef struct _GstMpegTSCableDeliverySystemDescriptor GstMpegTSCableDeliverySys
* *
* Cable Delivery System Descriptor (EN 300 468 v.1.13.1) * Cable Delivery System Descriptor (EN 300 468 v.1.13.1)
*/ */
struct _GstMpegTSCableDeliverySystemDescriptor struct _GstMpegTsCableDeliverySystemDescriptor
{ {
guint32 frequency; guint32 frequency;
GstMpegTSCableOuterFECScheme outer_fec; GstMpegTsCableOuterFECScheme outer_fec;
GstMpegTSModulationType modulation; GstMpegTsModulationType modulation;
guint32 symbol_rate; guint32 symbol_rate;
GstMpegTSDVBCodeRate fec_inner; GstMpegTsDVBCodeRate fec_inner;
}; };
gboolean gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_cable_delivery_system (const GstMpegTsDescriptor *descriptor,
GstMpegTSCableDeliverySystemDescriptor *res); GstMpegTsCableDeliverySystemDescriptor *res);
/* GST_MTS_DESC_DVB_SERVICE (0x48) */ /* GST_MTS_DESC_DVB_SERVICE (0x48) */
/** /**
* GstMpegTSDVBServiceType: * GstMpegTsDVBServiceType:
* *
* The type of service of a channel. * The type of service of a channel.
* *
@ -490,47 +499,47 @@ typedef enum {
/* 0x80 - 0xfe user defined */ /* 0x80 - 0xfe user defined */
/* 0xff Reserved for future use */ /* 0xff Reserved for future use */
GST_DVB_SERVICE_RESERVED_FF GST_DVB_SERVICE_RESERVED_FF
} GstMpegTSDVBServiceType; } GstMpegTsDVBServiceType;
/* FIXME : enum type for service_type ? */ /* FIXME : enum type for service_type ? */
gboolean gst_mpegts_descriptor_parse_dvb_service (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_dvb_service (const GstMpegTsDescriptor *descriptor,
GstMpegTSDVBServiceType *service_type, GstMpegTsDVBServiceType *service_type,
gchar **service_name, gchar **service_name,
gchar **provider_name); gchar **provider_name);
/* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */ /* GST_MTS_DESC_DVB_SHORT_EVENT (0x4D) */
gboolean gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_dvb_short_event (const GstMpegTsDescriptor *descriptor,
gchar **language_code, gchar **language_code,
gchar **event_name, gchar **event_name,
gchar **text); gchar **text);
/* GST_MTS_DESC_DVB_EXTENDED_EVENT (0x4E) */ /* GST_MTS_DESC_DVB_EXTENDED_EVENT (0x4E) */
typedef struct _GstMpegTSExtendedEventDescriptor GstMpegTSExtendedEventDescriptor; typedef struct _GstMpegTsExtendedEventDescriptor GstMpegTsExtendedEventDescriptor;
typedef struct _GstMpegTSExtendedEventItem GstMpegTSExtendedEventItem; typedef struct _GstMpegTsExtendedEventItem GstMpegTsExtendedEventItem;
/* FIXME : Maybe make a separate method for getting a specific item entry ? */ /* FIXME : Maybe make a separate method for getting a specific item entry ? */
struct _GstMpegTSExtendedEventItem struct _GstMpegTsExtendedEventItem
{ {
gchar *item_description; gchar *item_description;
gchar *item; gchar *item;
}; };
struct _GstMpegTSExtendedEventDescriptor struct _GstMpegTsExtendedEventDescriptor
{ {
guint8 descriptor_number; guint8 descriptor_number;
guint8 last_descriptor_number; guint8 last_descriptor_number;
gchar language_code[3]; gchar language_code[3];
guint8 nb_items; guint8 nb_items;
GstMpegTSExtendedEventItem items[128]; GstMpegTsExtendedEventItem items[128];
gchar *text; gchar *text;
}; };
gboolean gst_mpegts_descriptor_parse_dvb_extended_event (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_dvb_extended_event (const GstMpegTsDescriptor *descriptor,
GstMpegTSExtendedEventDescriptor *res); GstMpegTsExtendedEventDescriptor *res);
/* GST_MTS_DESC_DVB_COMPONENT (0x50) */ /* GST_MTS_DESC_DVB_COMPONENT (0x50) */
typedef struct _GstMpegTSComponentDescriptor GstMpegTSComponentDescriptor; typedef struct _GstMpegTsComponentDescriptor GstMpegTsComponentDescriptor;
struct _GstMpegTSComponentDescriptor struct _GstMpegTsComponentDescriptor
{ {
guint8 stream_content; guint8 stream_content;
guint8 component_type; guint8 component_type;
@ -540,11 +549,11 @@ struct _GstMpegTSComponentDescriptor
gchar *text; gchar *text;
}; };
gboolean gst_mpegts_descriptor_parse_dvb_component (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_dvb_component (const GstMpegTsDescriptor *descriptor,
GstMpegTSComponentDescriptor *res); GstMpegTsComponentDescriptor *res);
/* GST_MTS_DESC_DVB_STREAM_IDENTIFIER (0x52) */ /* GST_MTS_DESC_DVB_STREAM_IDENTIFIER (0x52) */
gboolean gst_mpegts_descriptor_parse_dvb_stream_identifier (const GstMpegTSDescriptor *descriptor, gboolean gst_mpegts_descriptor_parse_dvb_stream_identifier (const GstMpegTsDescriptor *descriptor,
guint8 *component_tag); guint8 *component_tag);
/* GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM (0x5A) */ /* GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM (0x5A) */
@ -564,26 +573,26 @@ gboolean gst_mpegts_descriptor_parse_dvb_stream_identifier (const GstMpegTSDescr
/* GST_MTS_DESC_DTG_LOGICAL_CHANNEL (0x83) */ /* GST_MTS_DESC_DTG_LOGICAL_CHANNEL (0x83) */
typedef struct _GstMpegTSLogicalChannelDescriptor GstMpegTSLogicalChannelDescriptor; typedef struct _GstMpegTsLogicalChannelDescriptor GstMpegTsLogicalChannelDescriptor;
typedef struct _GstMpegTSLogicalChannel GstMpegTSLogicalChannel; typedef struct _GstMpegTsLogicalChannel GstMpegTsLogicalChannel;
struct _GstMpegTSLogicalChannel struct _GstMpegTsLogicalChannel
{ {
guint16 service_id; guint16 service_id;
gboolean visible_service; gboolean visible_service;
guint16 logical_channel_number; guint16 logical_channel_number;
}; };
struct _GstMpegTSLogicalChannelDescriptor struct _GstMpegTsLogicalChannelDescriptor
{ {
guint nb_channels; guint nb_channels;
GstMpegTSLogicalChannel channels[64]; GstMpegTsLogicalChannel channels[64];
}; };
/* FIXME : Maybe make two methods. One for getting the number of channels, /* FIXME : Maybe make two methods. One for getting the number of channels,
* and the other for getting the content for one channel ? */ * and the other for getting the content for one channel ? */
gboolean gboolean
gst_mpegts_descriptor_parse_logical_channel (const GstMpegTSDescriptor *descriptor, gst_mpegts_descriptor_parse_logical_channel (const GstMpegTsDescriptor *descriptor,
GstMpegTSLogicalChannelDescriptor *res); GstMpegTsLogicalChannelDescriptor *res);
#endif /* GST_MPEGTS_DESCRIPTOR_H */ #endif /* GST_MPEGTS_DESCRIPTOR_H */

View file

@ -70,7 +70,7 @@ static GQuark QUARK_SECTION;
static GType _gst_mpegts_section_type = 0; static GType _gst_mpegts_section_type = 0;
#define MPEG_TYPE_TS_SECTION (_gst_mpegts_section_type) #define MPEG_TYPE_TS_SECTION (_gst_mpegts_section_type)
GST_DEFINE_MINI_OBJECT_TYPE (GstMpegTSSection, gst_mpegts_section); GST_DEFINE_MINI_OBJECT_TYPE (GstMpegTsSection, gst_mpegts_section);
static const guint32 crc_tab[256] = { static const guint32 crc_tab[256] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
@ -171,7 +171,7 @@ _parse_utc_time (guint8 * data)
* GENERIC MPEG-TS SECTION * GENERIC MPEG-TS SECTION
*/ */
static void static void
_gst_mpegts_section_free (GstMpegTSSection * section) _gst_mpegts_section_free (GstMpegTsSection * section)
{ {
GST_DEBUG ("Freeing section type %d", section->section_type); GST_DEBUG ("Freeing section type %d", section->section_type);
@ -183,14 +183,14 @@ _gst_mpegts_section_free (GstMpegTSSection * section)
break; break;
case GST_MPEGTS_SECTION_PMT: case GST_MPEGTS_SECTION_PMT:
{ {
GstMpegTSPMT *pmt = (GstMpegTSPMT *) section->cached_parsed; GstMpegTsPMT *pmt = (GstMpegTsPMT *) section->cached_parsed;
g_array_unref (pmt->descriptors); g_array_unref (pmt->descriptors);
g_ptr_array_unref (pmt->streams); g_ptr_array_unref (pmt->streams);
break; break;
} }
case GST_MPEGTS_SECTION_TOT: case GST_MPEGTS_SECTION_TOT:
{ {
GstMpegTSTOT *tot = (GstMpegTSTOT *) section->cached_parsed; GstMpegTsTOT *tot = (GstMpegTsTOT *) section->cached_parsed;
gst_date_time_unref (tot->utc_time); gst_date_time_unref (tot->utc_time);
g_array_unref (tot->descriptors); g_array_unref (tot->descriptors);
break; break;
@ -203,20 +203,20 @@ _gst_mpegts_section_free (GstMpegTSSection * section)
break; break;
case GST_MPEGTS_SECTION_NIT: case GST_MPEGTS_SECTION_NIT:
{ {
GstMpegTSNIT *nit = (GstMpegTSNIT *) section->cached_parsed; GstMpegTsNIT *nit = (GstMpegTsNIT *) section->cached_parsed;
g_array_unref (nit->descriptors); g_array_unref (nit->descriptors);
g_ptr_array_unref (nit->streams); g_ptr_array_unref (nit->streams);
break; break;
} }
case GST_MPEGTS_SECTION_EIT: case GST_MPEGTS_SECTION_EIT:
{ {
GstMpegTSEIT *eit = (GstMpegTSEIT *) section->cached_parsed; GstMpegTsEIT *eit = (GstMpegTsEIT *) section->cached_parsed;
g_ptr_array_unref (eit->events); g_ptr_array_unref (eit->events);
break; break;
} }
case GST_MPEGTS_SECTION_SDT: case GST_MPEGTS_SECTION_SDT:
{ {
GstMpegTSSDT *sdt = (GstMpegTSSDT *) section->cached_parsed; GstMpegTsSDT *sdt = (GstMpegTsSDT *) section->cached_parsed;
g_ptr_array_unref (sdt->services); g_ptr_array_unref (sdt->services);
break; break;
@ -227,15 +227,15 @@ _gst_mpegts_section_free (GstMpegTSSection * section)
} }
if (section->data) if (section->data)
g_free (section->data); g_free (section->data);
g_slice_free (GstMpegTSSection, section); g_slice_free (GstMpegTsSection, section);
} }
static GstMpegTSSection * static GstMpegTsSection *
_gst_mpegts_section_copy (GstMpegTSSection * section) _gst_mpegts_section_copy (GstMpegTsSection * section)
{ {
GstMpegTSSection *copy; GstMpegTsSection *copy;
copy = g_slice_new0 (GstMpegTSSection); copy = g_slice_new0 (GstMpegTsSection);
gst_mini_object_init (GST_MINI_OBJECT_CAST (copy), 0, MPEG_TYPE_TS_SECTION, gst_mini_object_init (GST_MINI_OBJECT_CAST (copy), 0, MPEG_TYPE_TS_SECTION,
(GstMiniObjectCopyFunction) _gst_mpegts_section_copy, NULL, (GstMiniObjectCopyFunction) _gst_mpegts_section_copy, NULL,
(GstMiniObjectFreeFunction) _gst_mpegts_section_free); (GstMiniObjectFreeFunction) _gst_mpegts_section_free);
@ -266,15 +266,15 @@ _gst_mpegts_section_copy (GstMpegTSSection * section)
* gst_message_parse_mpegts_section: * gst_message_parse_mpegts_section:
* @message: a #GstMessage * @message: a #GstMessage
* *
* Returns the #GstMpegTSSection contained in a message. * Returns the #GstMpegTsSection contained in a message.
* *
* Returns: (transfer full): the contained #GstMpegTSSection, or %NULL. * Returns: (transfer full): the contained #GstMpegTsSection, or %NULL.
*/ */
GstMpegTSSection * GstMpegTsSection *
gst_message_parse_mpegts_section (GstMessage * message) gst_message_parse_mpegts_section (GstMessage * message)
{ {
const GstStructure *st; const GstStructure *st;
GstMpegTSSection *section; GstMpegTsSection *section;
if (message->type != GST_MESSAGE_ELEMENT) if (message->type != GST_MESSAGE_ELEMENT)
return NULL; return NULL;
@ -291,15 +291,15 @@ gst_message_parse_mpegts_section (GstMessage * message)
/** /**
* gst_message_new_mpegts_section: * gst_message_new_mpegts_section:
* @parent: (transfer none): The creator of the message * @parent: (transfer none): The creator of the message
* @section: (transfer none): The #GstMpegTSSection to put in a message * @section: (transfer none): The #GstMpegTsSection to put in a message
* *
* Creates a new #GstMessage for a @GstMpegTSSection. * Creates a new #GstMessage for a @GstMpegTsSection.
* *
* Returns: (transfer full): The new #GstMessage to be posted, or %NULL if the * Returns: (transfer full): The new #GstMessage to be posted, or %NULL if the
* section is not valid. * section is not valid.
*/ */
GstMessage * GstMessage *
gst_message_new_mpegts_section (GstObject * parent, GstMpegTSSection * section) gst_message_new_mpegts_section (GstObject * parent, GstMpegTsSection * section)
{ {
GstMessage *msg; GstMessage *msg;
GstStructure *st; GstStructure *st;
@ -334,7 +334,7 @@ gst_message_new_mpegts_section (GstObject * parent, GstMpegTSSection * section)
quark = QUARK_TOT; quark = QUARK_TOT;
break; break;
default: default:
GST_WARNING ("Creating message for unknown GstMpegTSSection"); GST_WARNING ("Creating message for unknown GstMpegTsSection");
quark = QUARK_SECTION; quark = QUARK_SECTION;
break; break;
} }
@ -350,11 +350,11 @@ gst_message_new_mpegts_section (GstObject * parent, GstMpegTSSection * section)
/* Program Association Table */ /* Program Association Table */
static GArray * static GArray *
_parse_pat (GstMpegTSSection * section) _parse_pat (GstMpegTsSection * section)
{ {
GArray *pat; GArray *pat;
guint16 i = 0, nb_programs; guint16 i = 0, nb_programs;
GstMpegTSPatProgram *program; GstMpegTsPatProgram *program;
guint8 *data, *end; guint8 *data, *end;
/* Skip already parsed data */ /* Skip already parsed data */
@ -366,11 +366,11 @@ _parse_pat (GstMpegTSSection * section)
/* Initialize program list */ /* Initialize program list */
nb_programs = (end - 4 - data) / 4; nb_programs = (end - 4 - data) / 4;
pat = pat =
g_array_sized_new (FALSE, FALSE, sizeof (GstMpegTSPatProgram), g_array_sized_new (FALSE, FALSE, sizeof (GstMpegTsPatProgram),
nb_programs); nb_programs);
while (data < end - 4) { while (data < end - 4) {
program = &g_array_index (pat, GstMpegTSPatProgram, i); program = &g_array_index (pat, GstMpegTsPatProgram, i);
program->program_number = GST_READ_UINT16_BE (data); program->program_number = GST_READ_UINT16_BE (data);
data += 2; data += 2;
@ -393,21 +393,21 @@ _parse_pat (GstMpegTSSection * section)
/** /**
* gst_mpegts_section_get_pat: * gst_mpegts_section_get_pat:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_PAT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_PAT
* *
* Parses a Program Association Table (ITU H.222.0, ISO/IEC 13818-1). * Parses a Program Association Table (ITU H.222.0, ISO/IEC 13818-1).
* *
* Returns the array of #GstMpegTSPatProgram contained in the section. * Returns the array of #GstMpegTsPatProgram contained in the section.
* *
* Note: The PAT "transport_id" field corresponds to the "subtable_extension" * Note: The PAT "transport_id" field corresponds to the "subtable_extension"
* field of the provided @section. * field of the provided @section.
* *
* Returns: (transfer container) (element-type GstMpegTSPatProgram): The * Returns: (transfer container) (element-type GstMpegTsPatProgram): The
* #GstMpegTSPatProgram contained in the section, or %NULL if an error * #GstMpegTsPatProgram contained in the section, or %NULL if an error
* happened. Release with #g_ptr_array_unref when done. * happened. Release with #g_ptr_array_unref when done.
*/ */
GArray * GArray *
gst_mpegts_section_get_pat (GstMpegTSSection * section) gst_mpegts_section_get_pat (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PAT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PAT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -439,45 +439,45 @@ parse_failure:
/* Program Map Table */ /* Program Map Table */
static GstMpegTSPMTStream * static GstMpegTsPMTStream *
_gst_mpegts_pmt_stream_copy (GstMpegTSPMTStream * pmt) _gst_mpegts_pmt_stream_copy (GstMpegTsPMTStream * pmt)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_pmt_stream_free (GstMpegTSPMTStream * pmt) _gst_mpegts_pmt_stream_free (GstMpegTsPMTStream * pmt)
{ {
g_array_unref (pmt->descriptors); g_array_unref (pmt->descriptors);
g_slice_free (GstMpegTSPMTStream, pmt); g_slice_free (GstMpegTsPMTStream, pmt);
} }
G_DEFINE_BOXED_TYPE (GstMpegTSPMTStream, gst_mpegts_pmt_stream, G_DEFINE_BOXED_TYPE (GstMpegTsPMTStream, gst_mpegts_pmt_stream,
(GBoxedCopyFunc) _gst_mpegts_pmt_stream_copy, (GBoxedCopyFunc) _gst_mpegts_pmt_stream_copy,
(GFreeFunc) _gst_mpegts_pmt_stream_free); (GFreeFunc) _gst_mpegts_pmt_stream_free);
static GstMpegTSPMT * static GstMpegTsPMT *
_gst_mpegts_pmt_copy (GstMpegTSPMT * pmt) _gst_mpegts_pmt_copy (GstMpegTsPMT * pmt)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_pmt_free (GstMpegTSPMT * pmt) _gst_mpegts_pmt_free (GstMpegTsPMT * pmt)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSPMT, gst_mpegts_pmt, G_DEFINE_BOXED_TYPE (GstMpegTsPMT, gst_mpegts_pmt,
(GBoxedCopyFunc) _gst_mpegts_pmt_copy, (GFreeFunc) _gst_mpegts_pmt_free); (GBoxedCopyFunc) _gst_mpegts_pmt_copy, (GFreeFunc) _gst_mpegts_pmt_free);
static GstMpegTSPMT * static GstMpegTsPMT *
_parse_pmt (GstMpegTSSection * section) _parse_pmt (GstMpegTsSection * section)
{ {
GstMpegTSPMT *pmt = NULL; GstMpegTsPMT *pmt = NULL;
guint i = 0, allocated_streams = 8; guint i = 0, allocated_streams = 8;
guint8 *data, *end; guint8 *data, *end;
guint program_info_length; guint program_info_length;
@ -490,7 +490,7 @@ _parse_pmt (GstMpegTSSection * section)
goto error; goto error;
} }
pmt = g_slice_new0 (GstMpegTSPMT); pmt = g_slice_new0 (GstMpegTsPMT);
data = section->data; data = section->data;
end = data + section->section_length; end = data + section->section_length;
@ -525,7 +525,7 @@ _parse_pmt (GstMpegTSSection * section)
/* parse entries, cycle until there's space for another entry (at least 5 /* parse entries, cycle until there's space for another entry (at least 5
* bytes) plus the CRC */ * bytes) plus the CRC */
while (data <= end - 4 - 5) { while (data <= end - 4 - 5) {
GstMpegTSPMTStream *stream = g_slice_new0 (GstMpegTSPMTStream); GstMpegTsPMTStream *stream = g_slice_new0 (GstMpegTsPMTStream);
g_ptr_array_add (pmt->streams, stream); g_ptr_array_add (pmt->streams, stream);
@ -566,15 +566,15 @@ error:
/** /**
* gst_mpegts_section_get_pmt: * gst_mpegts_section_get_pmt:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_PMT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_PMT
* *
* Returns the #GstMpegTSPMT contained in the @section. * Returns the #GstMpegTsPMT contained in the @section.
* *
* Returns: The #GstMpegTSPMT contained in the section, or %NULL if an error * Returns: The #GstMpegTsPMT contained in the section, or %NULL if an error
* happened. * happened.
*/ */
const GstMpegTSPMT * const GstMpegTsPMT *
gst_mpegts_section_get_pmt (GstMpegTSSection * section) gst_mpegts_section_get_pmt (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PMT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_PMT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -588,7 +588,7 @@ gst_mpegts_section_get_pmt (GstMpegTSSection * section)
goto parse_failure; goto parse_failure;
} }
return (const GstMpegTSPMT *) section->cached_parsed; return (const GstMpegTsPMT *) section->cached_parsed;
bad_crc: bad_crc:
{ {
@ -606,7 +606,7 @@ parse_failure:
/* Conditional Access Table */ /* Conditional Access Table */
static GArray * static GArray *
_parse_cat (GstMpegTSSection * section) _parse_cat (GstMpegTsSection * section)
{ {
guint8 *data; guint8 *data;
guint desc_len; guint desc_len;
@ -621,17 +621,17 @@ _parse_cat (GstMpegTSSection * section)
/** /**
* gst_mpegts_section_get_cat: * gst_mpegts_section_get_cat:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_CAT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_CAT
* *
* Returns the array of #GstMpegTSDescriptor contained in the Condtional * Returns the array of #GstMpegTsDescriptor contained in the Condtional
* Access Table. * Access Table.
* *
* Returns: (transfer container) (element-type GstMpegTSDescriptor): The * Returns: (transfer container) (element-type GstMpegTsDescriptor): The
* #GstMpegTSDescriptor contained in the section, or %NULL if an error * #GstMpegTsDescriptor contained in the section, or %NULL if an error
* happened. Release with #g_array_unref when done. * happened. Release with #g_array_unref when done.
*/ */
GArray * GArray *
gst_mpegts_section_get_cat (GstMpegTSSection * section) gst_mpegts_section_get_cat (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_CAT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_CAT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -654,16 +654,16 @@ parse_failure:
/* Transport Stream Description Table (TSDT) */ /* Transport Stream Description Table (TSDT) */
/** /**
* gst_mpegts_section_get_tsdt: * gst_mpegts_section_get_tsdt:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_TSDT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_TSDT
* *
* Returns the array of #GstMpegTSDescriptor contained in the section * Returns the array of #GstMpegTsDescriptor contained in the section
* *
* Returns: (transfer container) (element-type GstMpegTSDescriptor): The * Returns: (transfer container) (element-type GstMpegTsDescriptor): The
* #GstMpegTSDescriptor contained in the section, or %NULL if an error * #GstMpegTsDescriptor contained in the section, or %NULL if an error
* happened. Release with #g_array_unref when done. * happened. Release with #g_array_unref when done.
*/ */
GArray * GArray *
gst_mpegts_section_get_tsdt (GstMpegTSSection * section) gst_mpegts_section_get_tsdt (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TSDT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TSDT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -677,43 +677,43 @@ gst_mpegts_section_get_tsdt (GstMpegTSSection * section)
/* Event Information Table */ /* Event Information Table */
static GstMpegTSEIT * static GstMpegTsEIT *
_gst_mpegts_eit_copy (GstMpegTSEIT * eit) _gst_mpegts_eit_copy (GstMpegTsEIT * eit)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_eit_free (GstMpegTSEIT * eit) _gst_mpegts_eit_free (GstMpegTsEIT * eit)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSEIT, gst_mpegts_eit, G_DEFINE_BOXED_TYPE (GstMpegTsEIT, gst_mpegts_eit,
(GBoxedCopyFunc) _gst_mpegts_eit_copy, (GFreeFunc) _gst_mpegts_eit_free); (GBoxedCopyFunc) _gst_mpegts_eit_copy, (GFreeFunc) _gst_mpegts_eit_free);
static GstMpegTSEITEvent * static GstMpegTsEITEvent *
_gst_mpegts_eit_event_copy (GstMpegTSEITEvent * eit) _gst_mpegts_eit_event_copy (GstMpegTsEITEvent * eit)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_eit_event_free (GstMpegTSEITEvent * eit) _gst_mpegts_eit_event_free (GstMpegTsEITEvent * eit)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSEITEvent, gst_mpegts_eit_event, G_DEFINE_BOXED_TYPE (GstMpegTsEITEvent, gst_mpegts_eit_event,
(GBoxedCopyFunc) _gst_mpegts_eit_event_copy, (GBoxedCopyFunc) _gst_mpegts_eit_event_copy,
(GFreeFunc) _gst_mpegts_eit_event_free); (GFreeFunc) _gst_mpegts_eit_event_free);
static GstMpegTSEIT * static GstMpegTsEIT *
_parse_eit (GstMpegTSSection * section) _parse_eit (GstMpegTsSection * section)
{ {
GstMpegTSEIT *eit = NULL; GstMpegTsEIT *eit = NULL;
guint i = 0, allocated_events = 12; guint i = 0, allocated_events = 12;
guint8 *data, *end, *duration_ptr; guint8 *data, *end, *duration_ptr;
guint16 descriptors_loop_length; guint16 descriptors_loop_length;
@ -725,7 +725,7 @@ _parse_eit (GstMpegTSSection * section)
goto error; goto error;
} }
eit = g_slice_new0 (GstMpegTSEIT); eit = g_slice_new0 (GstMpegTsEIT);
data = section->data; data = section->data;
end = data + section->section_length; end = data + section->section_length;
@ -750,7 +750,7 @@ _parse_eit (GstMpegTSSection * section)
(GDestroyNotify) _gst_mpegts_eit_event_free); (GDestroyNotify) _gst_mpegts_eit_event_free);
while (data < end - 4) { while (data < end - 4) {
GstMpegTSEITEvent *event; GstMpegTsEITEvent *event;
/* 12 is the minimum entry size + CRC */ /* 12 is the minimum entry size + CRC */
if (end - data < 12 + 4) { if (end - data < 12 + 4) {
@ -759,7 +759,7 @@ _parse_eit (GstMpegTSSection * section)
goto error; goto error;
} }
event = g_slice_new0 (GstMpegTSEITEvent); event = g_slice_new0 (GstMpegTsEITEvent);
g_ptr_array_add (eit->events, event); g_ptr_array_add (eit->events, event);
event->event_id = GST_READ_UINT16_BE (data); event->event_id = GST_READ_UINT16_BE (data);
@ -807,15 +807,15 @@ error:
/** /**
* gst_mpegts_section_get_eit: * gst_mpegts_section_get_eit:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_EIT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_EIT
* *
* Returns the #GstMpegTSEIT contained in the @section. * Returns the #GstMpegTsEIT contained in the @section.
* *
* Returns: The #GstMpegTSEIT contained in the section, or %NULL if an error * Returns: The #GstMpegTsEIT contained in the section, or %NULL if an error
* happened. * happened.
*/ */
const GstMpegTSEIT * const GstMpegTsEIT *
gst_mpegts_section_get_eit (GstMpegTSSection * section) gst_mpegts_section_get_eit (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_EIT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_EIT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -829,7 +829,7 @@ gst_mpegts_section_get_eit (GstMpegTSSection * section)
goto parse_failure; goto parse_failure;
} }
return (const GstMpegTSEIT *) section->cached_parsed; return (const GstMpegTsEIT *) section->cached_parsed;
bad_crc: bad_crc:
{ {
@ -845,61 +845,61 @@ parse_failure:
} }
/* Bouquet Association Table */ /* Bouquet Association Table */
static GstMpegTSBAT * static GstMpegTsBAT *
_gst_mpegts_bat_copy (GstMpegTSBAT * bat) _gst_mpegts_bat_copy (GstMpegTsBAT * bat)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_bat_free (GstMpegTSBAT * bat) _gst_mpegts_bat_free (GstMpegTsBAT * bat)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSBAT, gst_mpegts_bat, G_DEFINE_BOXED_TYPE (GstMpegTsBAT, gst_mpegts_bat,
(GBoxedCopyFunc) _gst_mpegts_bat_copy, (GFreeFunc) _gst_mpegts_bat_free); (GBoxedCopyFunc) _gst_mpegts_bat_copy, (GFreeFunc) _gst_mpegts_bat_free);
/* Network Information Table */ /* Network Information Table */
static GstMpegTSNIT * static GstMpegTsNIT *
_gst_mpegts_nit_copy (GstMpegTSNIT * nit) _gst_mpegts_nit_copy (GstMpegTsNIT * nit)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_nit_free (GstMpegTSNIT * nit) _gst_mpegts_nit_free (GstMpegTsNIT * nit)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSNIT, gst_mpegts_nit, G_DEFINE_BOXED_TYPE (GstMpegTsNIT, gst_mpegts_nit,
(GBoxedCopyFunc) _gst_mpegts_nit_copy, (GFreeFunc) _gst_mpegts_nit_free); (GBoxedCopyFunc) _gst_mpegts_nit_copy, (GFreeFunc) _gst_mpegts_nit_free);
static GstMpegTSNITStream * static GstMpegTsNITStream *
_gst_mpegts_nit_stream_copy (GstMpegTSNITStream * nit) _gst_mpegts_nit_stream_copy (GstMpegTsNITStream * nit)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_nit_stream_free (GstMpegTSNITStream * nit) _gst_mpegts_nit_stream_free (GstMpegTsNITStream * nit)
{ {
g_array_unref (nit->descriptors); g_array_unref (nit->descriptors);
g_slice_free (GstMpegTSNITStream, nit); g_slice_free (GstMpegTsNITStream, nit);
} }
G_DEFINE_BOXED_TYPE (GstMpegTSNITStream, gst_mpegts_nit_stream, G_DEFINE_BOXED_TYPE (GstMpegTsNITStream, gst_mpegts_nit_stream,
(GBoxedCopyFunc) _gst_mpegts_nit_stream_copy, (GBoxedCopyFunc) _gst_mpegts_nit_stream_copy,
(GFreeFunc) _gst_mpegts_nit_stream_free); (GFreeFunc) _gst_mpegts_nit_stream_free);
static GstMpegTSNIT * static GstMpegTsNIT *
_parse_nit (GstMpegTSSection * section) _parse_nit (GstMpegTsSection * section)
{ {
GstMpegTSNIT *nit = NULL; GstMpegTsNIT *nit = NULL;
guint i = 0, j, allocated_streams = 12; guint i = 0, j, allocated_streams = 12;
guint8 *data, *end, *entry_begin; guint8 *data, *end, *entry_begin;
guint16 descriptors_loop_length, transport_stream_loop_length; guint16 descriptors_loop_length, transport_stream_loop_length;
@ -913,7 +913,7 @@ _parse_nit (GstMpegTSSection * section)
goto error; goto error;
} }
nit = g_slice_new0 (GstMpegTSNIT); nit = g_slice_new0 (GstMpegTsNIT);
data = section->data; data = section->data;
end = data + section->section_length; end = data + section->section_length;
@ -953,7 +953,7 @@ _parse_nit (GstMpegTSSection * section)
/* read up to the CRC */ /* read up to the CRC */
while (transport_stream_loop_length - 4 > 0) { while (transport_stream_loop_length - 4 > 0) {
GstMpegTSNITStream *stream = g_slice_new0 (GstMpegTSNITStream); GstMpegTsNITStream *stream = g_slice_new0 (GstMpegTsNITStream);
g_ptr_array_add (nit->streams, stream); g_ptr_array_add (nit->streams, stream);
@ -994,8 +994,8 @@ _parse_nit (GstMpegTSSection * section)
/* At least notify the descriptors we are not handling :( */ /* At least notify the descriptors we are not handling :( */
for (j = 0; j < stream->descriptors->len; j++) { for (j = 0; j < stream->descriptors->len; j++) {
GstMpegTSDescriptor *desc = GstMpegTsDescriptor *desc =
&g_array_index (stream->descriptors, GstMpegTSDescriptor, j); &g_array_index (stream->descriptors, GstMpegTsDescriptor, j);
switch (desc->descriptor_tag) { switch (desc->descriptor_tag) {
case GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM: case GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM:
@ -1030,15 +1030,15 @@ error:
/** /**
* gst_mpegts_section_get_nit: * gst_mpegts_section_get_nit:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_NIT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_NIT
* *
* Returns the #GstMpegTSNIT contained in the @section. * Returns the #GstMpegTsNIT contained in the @section.
* *
* Returns: The #GstMpegTSNIT contained in the section, or %NULL if an error * Returns: The #GstMpegTsNIT contained in the section, or %NULL if an error
* happened. * happened.
*/ */
const GstMpegTSNIT * const GstMpegTsNIT *
gst_mpegts_section_get_nit (GstMpegTSSection * section) gst_mpegts_section_get_nit (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_NIT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_NIT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -1052,7 +1052,7 @@ gst_mpegts_section_get_nit (GstMpegTSSection * section)
goto parse_failure; goto parse_failure;
} }
return (const GstMpegTSNIT *) section->cached_parsed; return (const GstMpegTsNIT *) section->cached_parsed;
bad_crc: bad_crc:
{ {
@ -1070,45 +1070,45 @@ parse_failure:
/* Service Description Table (SDT) */ /* Service Description Table (SDT) */
static GstMpegTSSDT * static GstMpegTsSDT *
_gst_mpegts_sdt_copy (GstMpegTSSDT * sdt) _gst_mpegts_sdt_copy (GstMpegTsSDT * sdt)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_sdt_free (GstMpegTSSDT * sdt) _gst_mpegts_sdt_free (GstMpegTsSDT * sdt)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSSDT, gst_mpegts_sdt, G_DEFINE_BOXED_TYPE (GstMpegTsSDT, gst_mpegts_sdt,
(GBoxedCopyFunc) _gst_mpegts_sdt_copy, (GFreeFunc) _gst_mpegts_sdt_free); (GBoxedCopyFunc) _gst_mpegts_sdt_copy, (GFreeFunc) _gst_mpegts_sdt_free);
static GstMpegTSSDTService * static GstMpegTsSDTService *
_gst_mpegts_sdt_service_copy (GstMpegTSSDTService * sdt) _gst_mpegts_sdt_service_copy (GstMpegTsSDTService * sdt)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_sdt_service_free (GstMpegTSSDTService * sdt) _gst_mpegts_sdt_service_free (GstMpegTsSDTService * sdt)
{ {
g_array_unref (sdt->descriptors); g_array_unref (sdt->descriptors);
g_slice_free (GstMpegTSSDTService, sdt); g_slice_free (GstMpegTsSDTService, sdt);
} }
G_DEFINE_BOXED_TYPE (GstMpegTSSDTService, gst_mpegts_sdt_service, G_DEFINE_BOXED_TYPE (GstMpegTsSDTService, gst_mpegts_sdt_service,
(GBoxedCopyFunc) _gst_mpegts_sdt_service_copy, (GBoxedCopyFunc) _gst_mpegts_sdt_service_copy,
(GFreeFunc) _gst_mpegts_sdt_service_free); (GFreeFunc) _gst_mpegts_sdt_service_free);
static GstMpegTSSDT * static GstMpegTsSDT *
_parse_sdt (GstMpegTSSection * section) _parse_sdt (GstMpegTsSection * section)
{ {
GstMpegTSSDT *sdt = NULL; GstMpegTsSDT *sdt = NULL;
guint i = 0, allocated_services = 8; guint i = 0, allocated_services = 8;
guint8 *data, *end, *entry_begin; guint8 *data, *end, *entry_begin;
guint tmp; guint tmp;
@ -1124,7 +1124,7 @@ _parse_sdt (GstMpegTSSection * section)
goto error; goto error;
} }
sdt = g_slice_new0 (GstMpegTSSDT); sdt = g_slice_new0 (GstMpegTsSDT);
data = section->data; data = section->data;
end = data + section->section_length; end = data + section->section_length;
@ -1147,7 +1147,7 @@ _parse_sdt (GstMpegTSSection * section)
/* read up to the CRC */ /* read up to the CRC */
while (sdt_info_length - 4 > 0) { while (sdt_info_length - 4 > 0) {
GstMpegTSSDTService *service = g_slice_new0 (GstMpegTSSDTService); GstMpegTsSDTService *service = g_slice_new0 (GstMpegTsSDTService);
g_ptr_array_add (sdt->services, service); g_ptr_array_add (sdt->services, service);
entry_begin = data; entry_begin = data;
@ -1207,15 +1207,15 @@ error:
/** /**
* gst_mpegts_section_get_sdt: * gst_mpegts_section_get_sdt:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_SDT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_SDT
* *
* Returns the #GstMpegTSSDT contained in the @section. * Returns the #GstMpegTsSDT contained in the @section.
* *
* Returns: The #GstMpegTSSDT contained in the section, or %NULL if an error * Returns: The #GstMpegTsSDT contained in the section, or %NULL if an error
* happened. * happened.
*/ */
const GstMpegTSSDT * const GstMpegTsSDT *
gst_mpegts_section_get_sdt (GstMpegTSSection * section) gst_mpegts_section_get_sdt (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_SDT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_SDT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -1229,7 +1229,7 @@ gst_mpegts_section_get_sdt (GstMpegTSSection * section)
goto parse_failure; goto parse_failure;
} }
return (const GstMpegTSSDT *) section->cached_parsed; return (const GstMpegTsSDT *) section->cached_parsed;
bad_crc: bad_crc:
{ {
@ -1246,7 +1246,7 @@ parse_failure:
/* Time and Date Table (TDT) */ /* Time and Date Table (TDT) */
static GstDateTime * static GstDateTime *
_parse_tdt (GstMpegTSSection * section) _parse_tdt (GstMpegTsSection * section)
{ {
/* FIXME : Add length check */ /* FIXME : Add length check */
return _parse_utc_time (section->data + 3); return _parse_utc_time (section->data + 3);
@ -1254,7 +1254,7 @@ _parse_tdt (GstMpegTSSection * section)
/** /**
* gst_mpegts_section_get_tdt: * gst_mpegts_section_get_tdt:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_TDT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_TDT
* *
* Returns the #GstDateTime of the TDT * Returns the #GstDateTime of the TDT
* *
@ -1262,7 +1262,7 @@ _parse_tdt (GstMpegTSSection * section)
* if an error happened. Release with #gst_date_time_unref when done. * if an error happened. Release with #gst_date_time_unref when done.
*/ */
GstDateTime * GstDateTime *
gst_mpegts_section_get_tdt (GstMpegTSSection * section) gst_mpegts_section_get_tdt (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TDT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TDT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -1284,34 +1284,34 @@ parse_failure:
/* Time Offset Table (TOT) */ /* Time Offset Table (TOT) */
static GstMpegTSTOT * static GstMpegTsTOT *
_gst_mpegts_tot_copy (GstMpegTSTOT * tot) _gst_mpegts_tot_copy (GstMpegTsTOT * tot)
{ {
/* FIXME : IMPLEMENT */ /* FIXME : IMPLEMENT */
return NULL; return NULL;
} }
static void static void
_gst_mpegts_tot_free (GstMpegTSTOT * tot) _gst_mpegts_tot_free (GstMpegTsTOT * tot)
{ {
/* FIXME: IMPLEMENT */ /* FIXME: IMPLEMENT */
} }
G_DEFINE_BOXED_TYPE (GstMpegTSTOT, gst_mpegts_tot, G_DEFINE_BOXED_TYPE (GstMpegTsTOT, gst_mpegts_tot,
(GBoxedCopyFunc) _gst_mpegts_tot_copy, (GFreeFunc) _gst_mpegts_tot_free); (GBoxedCopyFunc) _gst_mpegts_tot_copy, (GFreeFunc) _gst_mpegts_tot_free);
static GstMpegTSTOT * static GstMpegTsTOT *
_parse_tot (GstMpegTSSection * section) _parse_tot (GstMpegTsSection * section)
{ {
guint8 *data; guint8 *data;
GstMpegTSTOT *tot; GstMpegTsTOT *tot;
guint16 desc_len; guint16 desc_len;
/* FIXME : Check minimum length */ /* FIXME : Check minimum length */
GST_DEBUG ("TOT"); GST_DEBUG ("TOT");
tot = g_slice_new0 (GstMpegTSTOT); tot = g_slice_new0 (GstMpegTsTOT);
tot->utc_time = _parse_utc_time (section->data + 3); tot->utc_time = _parse_utc_time (section->data + 3);
@ -1326,15 +1326,15 @@ _parse_tot (GstMpegTSSection * section)
/** /**
* gst_mpegts_section_get_tot: * gst_mpegts_section_get_tot:
* @section: a #GstMpegTSSection of type %GST_MPEGTS_SECTION_TOT * @section: a #GstMpegTsSection of type %GST_MPEGTS_SECTION_TOT
* *
* Returns the #GstMpegTSTOT contained in the @section. * Returns the #GstMpegTsTOT contained in the @section.
* *
* Returns: The #GstMpegTSTOT contained in the section, or %NULL if an error * Returns: The #GstMpegTsTOT contained in the section, or %NULL if an error
* happened. * happened.
*/ */
const GstMpegTSTOT * const GstMpegTsTOT *
gst_mpegts_section_get_tot (GstMpegTSSection * section) gst_mpegts_section_get_tot (GstMpegTsSection * section)
{ {
g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TOT, NULL); g_return_val_if_fail (section->section_type == GST_MPEGTS_SECTION_TOT, NULL);
g_return_val_if_fail (section->cached_parsed || section->data, NULL); g_return_val_if_fail (section->cached_parsed || section->data, NULL);
@ -1348,7 +1348,7 @@ gst_mpegts_section_get_tot (GstMpegTSSection * section)
goto parse_failure; goto parse_failure;
} }
return (const GstMpegTSTOT *) section->cached_parsed; return (const GstMpegTsTOT *) section->cached_parsed;
bad_crc: bad_crc:
{ {
@ -1396,8 +1396,8 @@ gst_mpegts_initialize (void)
__initialize_descriptors (); __initialize_descriptors ();
} }
static GstMpegTSSectionType static GstMpegTsSectionType
_identify_section (GstMpegTSSectionTableID table_id) _identify_section (GstMpegTsSectionTableID table_id)
{ {
switch (table_id) { switch (table_id) {
case GST_MTS_TABLE_ID_PROGRAM_ASSOCIATION: case GST_MTS_TABLE_ID_PROGRAM_ASSOCIATION:
@ -1435,7 +1435,7 @@ _identify_section (GstMpegTSSectionTableID table_id)
* should contain the table_id field). * should contain the table_id field).
* @data_size: size of the @data argument. * @data_size: size of the @data argument.
* *
* Creates a new #GstMpegTSSection from the provided @data. * Creates a new #GstMpegTsSection from the provided @data.
* *
* Note: Ensuring @data is big enough to contain the full section is the * Note: Ensuring @data is big enough to contain the full section is the
* responsibility of the caller. If it is not big enough, %NULL will be * responsibility of the caller. If it is not big enough, %NULL will be
@ -1444,13 +1444,13 @@ _identify_section (GstMpegTSSectionTableID table_id)
* Note: it is the responsibility of the caller to ensure @data does point * Note: it is the responsibility of the caller to ensure @data does point
* to the beginning of the section. * to the beginning of the section.
* *
* Returns: (transfer full): A new #GstMpegTSSection if the data was valid, * Returns: (transfer full): A new #GstMpegTsSection if the data was valid,
* else %NULL * else %NULL
*/ */
GstMpegTSSection * GstMpegTsSection *
gst_mpegts_section_new (guint16 pid, guint8 * data, gsize data_size) gst_mpegts_section_new (guint16 pid, guint8 * data, gsize data_size)
{ {
GstMpegTSSection *res = NULL; GstMpegTsSection *res = NULL;
guint8 tmp; guint8 tmp;
guint16 section_length; guint16 section_length;
@ -1459,7 +1459,7 @@ gst_mpegts_section_new (guint16 pid, guint8 * data, gsize data_size)
if (G_UNLIKELY (data_size < section_length + 3)) if (G_UNLIKELY (data_size < section_length + 3))
goto short_packet; goto short_packet;
res = g_slice_new0 (GstMpegTSSection); res = g_slice_new0 (GstMpegTsSection);
gst_mini_object_init (GST_MINI_OBJECT_CAST (res), 0, MPEG_TYPE_TS_SECTION, gst_mini_object_init (GST_MINI_OBJECT_CAST (res), 0, MPEG_TYPE_TS_SECTION,
(GstMiniObjectCopyFunction) _gst_mpegts_section_copy, NULL, (GstMiniObjectCopyFunction) _gst_mpegts_section_copy, NULL,
(GstMiniObjectFreeFunction) _gst_mpegts_section_free); (GstMiniObjectFreeFunction) _gst_mpegts_section_free);

View file

@ -27,17 +27,17 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/mpegts/gstmpegtsdescriptor.h> #include <gst/mpegts/gstmpegtsdescriptor.h>
typedef struct _GstMpegTSSection GstMpegTSSection; typedef struct _GstMpegTsSection GstMpegTsSection;
#define GST_TYPE_MPEGTS_SECTION (gst_mpegts_section_get_type()) #define GST_TYPE_MPEGTS_SECTION (gst_mpegts_section_get_type())
#define GST_MPEGTS_SECTION(section) ((GstMpegTSSection*) section) #define GST_MPEGTS_SECTION(section) ((GstMpegTsSection*) section)
#define GST_MPEGTS_SECTION_TYPE(section) (GST_MPEGTS_SECTION (section)->section_type) #define GST_MPEGTS_SECTION_TYPE(section) (GST_MPEGTS_SECTION (section)->section_type)
GType gst_mpegts_section_get_type (void); GType gst_mpegts_section_get_type (void);
/** /**
* GstMpegTSSectionType: * GstMpegTsSectionType:
* @GST_MPEGTS_SECTION_UNKNOWN: Unknown section type * @GST_MPEGTS_SECTION_UNKNOWN: Unknown section type
* @GST_MPEGTS_SECTION_PAT: Program Association Table (ISO/IEC 13818-1) * @GST_MPEGTS_SECTION_PAT: Program Association Table (ISO/IEC 13818-1)
* @GST_MPEGTS_SECTION_PMT: Program Map Table (ISO/IEC 13818-1) * @GST_MPEGTS_SECTION_PMT: Program Map Table (ISO/IEC 13818-1)
@ -51,7 +51,7 @@ GType gst_mpegts_section_get_type (void);
* @GST_MPEGTS_SECTION_TOT: Time Offset Table (EN 300 468) * @GST_MPEGTS_SECTION_TOT: Time Offset Table (EN 300 468)
* @GST_MPEGTS_SECTION_LAST: * @GST_MPEGTS_SECTION_LAST:
* *
* Types of #GstMpegTSSection that the library handles. * Types of #GstMpegTsSection that the library handles.
*/ */
typedef enum { typedef enum {
GST_MPEGTS_SECTION_UNKNOWN = 0, GST_MPEGTS_SECTION_UNKNOWN = 0,
@ -66,7 +66,7 @@ typedef enum {
GST_MPEGTS_SECTION_TDT, GST_MPEGTS_SECTION_TDT,
GST_MPEGTS_SECTION_TOT, GST_MPEGTS_SECTION_TOT,
GST_MPEGTS_SECTION_LAST GST_MPEGTS_SECTION_LAST
} GstMpegTSSectionType; } GstMpegTsSectionType;
/* FIXME : How do we deal with clashing table_id for the various standards: /* FIXME : How do we deal with clashing table_id for the various standards:
* * ISO/IEC 13818-1 and ITU H.222.0 : Takes precedence over all * * ISO/IEC 13818-1 and ITU H.222.0 : Takes precedence over all
@ -79,9 +79,9 @@ typedef enum {
* Do we create a different enum for variants ? * Do we create a different enum for variants ?
*/ */
/** /**
* GstMpegTSSectionTableID: * GstMpegTsSectionTableID:
* *
* Values for a #GstMpegTSSection table_id * Values for a #GstMpegTsSection table_id
*/ */
typedef enum { typedef enum {
/* ITU H.222.0 / IEC 13818-1 */ /* ITU H.222.0 / IEC 13818-1 */
@ -188,10 +188,10 @@ typedef enum {
/* Unset */ /* Unset */
GST_MTS_TABLE_ID_UNSET = 0xFF GST_MTS_TABLE_ID_UNSET = 0xFF
} GstMpegTSSectionTableID; } GstMpegTsSectionTableID;
/** /**
* GstMpegTSSection: * GstMpegTsSection:
* @section_type: The type of section * @section_type: The type of section
* @pid: The pid on which this section was found * @pid: The pid on which this section was found
* @table_id: The table id of this section * @table_id: The table id of this section
@ -205,16 +205,16 @@ typedef enum {
* *
* Mpeg-TS Section Information (SI) (ISO/IEC 13818-1) * Mpeg-TS Section Information (SI) (ISO/IEC 13818-1)
*/ */
struct _GstMpegTSSection struct _GstMpegTsSection
{ {
/*< private >*/ /*< private >*/
GstMiniObject parent; GstMiniObject parent;
/*< public >*/ /*< public >*/
GstMpegTSSectionType section_type; GstMpegTsSectionType section_type;
guint16 pid; guint16 pid;
GstMpegTSSectionTableID table_id; GstMpegTsSectionTableID table_id;
guint16 subtable_extension; guint16 subtable_extension;
guint8 version_number; guint8 version_number;
@ -243,7 +243,7 @@ struct _GstMpegTSSection
}; };
/** /**
* GstMpegTSRunningStatus: * GstMpegTsRunningStatus:
* *
* Running status of a service. * Running status of a service.
* *
@ -257,46 +257,46 @@ typedef enum
GST_MPEGTS_RUNNING_STATUS_PAUSING, GST_MPEGTS_RUNNING_STATUS_PAUSING,
GST_MPEGTS_RUNNING_STATUS_RUNNING, GST_MPEGTS_RUNNING_STATUS_RUNNING,
GST_MPEGTS_RUNNING_STATUS_OFF_AIR GST_MPEGTS_RUNNING_STATUS_OFF_AIR
} GstMpegTSRunningStatus; } GstMpegTsRunningStatus;
/* PAT */ /* PAT */
typedef struct _GstMpegTSPatProgram GstMpegTSPatProgram; typedef struct _GstMpegTsPatProgram GstMpegTsPatProgram;
/** /**
* GstMpegTSPatProgram: * GstMpegTsPatProgram:
* @program_number: the program number * @program_number: the program number
* @network_or_program_map_PID: the network of program map PID * @network_or_program_map_PID: the network of program map PID
* *
* A program entry from a Program Association Table (ITU H.222.0, ISO/IEC 13818-1). * A program entry from a Program Association Table (ITU H.222.0, ISO/IEC 13818-1).
*/ */
struct _GstMpegTSPatProgram struct _GstMpegTsPatProgram
{ {
guint16 program_number; guint16 program_number;
guint16 network_or_program_map_PID; guint16 network_or_program_map_PID;
}; };
GArray *gst_mpegts_section_get_pat (GstMpegTSSection *section); GArray *gst_mpegts_section_get_pat (GstMpegTsSection *section);
/* CAT */ /* CAT */
GArray *gst_mpegts_section_get_cat (GstMpegTSSection *section); GArray *gst_mpegts_section_get_cat (GstMpegTsSection *section);
/* PMT */ /* PMT */
typedef struct _GstMpegTSPMTStream GstMpegTSPMTStream; typedef struct _GstMpegTsPMTStream GstMpegTsPMTStream;
typedef struct _GstMpegTSPMT GstMpegTSPMT; typedef struct _GstMpegTsPMT GstMpegTsPMT;
#define GST_TYPE_MPEGTS_PMT (gst_mpegts_pmt_get_type()) #define GST_TYPE_MPEGTS_PMT (gst_mpegts_pmt_get_type())
#define GST_TYPE_MPEGTS_PMT_STREAM (gst_mpegts_pmt_stream_get_type()) #define GST_TYPE_MPEGTS_PMT_STREAM (gst_mpegts_pmt_stream_get_type())
/** /**
* GstMpegTSPMTStream: * GstMpegTsPMTStream:
* @stream_type: the type of stream * @stream_type: the type of stream
* @pid: the PID of the stream * @pid: the PID of the stream
* @descriptors: (element-type GstMpegTSDescriptor): the descriptors of the * @descriptors: (element-type GstMpegTsDescriptor): the descriptors of the
* stream * stream
* *
* An individual stream definition. * An individual stream definition.
*/ */
struct _GstMpegTSPMTStream struct _GstMpegTsPMTStream
{ {
guint8 stream_type; guint8 stream_type;
guint16 pid; guint16 pid;
@ -305,17 +305,17 @@ struct _GstMpegTSPMTStream
}; };
/** /**
* GstMpegTSPMT: * GstMpegTsPMT:
* @pcr_pid: PID of the stream containing PCR * @pcr_pid: PID of the stream containing PCR
* @descriptors: (element-type GstMpegTSDescriptor): array of #GstMpegTSDescriptor * @descriptors: (element-type GstMpegTsDescriptor): array of #GstMpegTsDescriptor
* @streams: (element-type GstMpegTSPMTStream): Array of #GstMpegTSPMTStream * @streams: (element-type GstMpegTsPMTStream): Array of #GstMpegTsPMTStream
* *
* Program Map Table (ISO/IEC 13818-1). * Program Map Table (ISO/IEC 13818-1).
* *
* The program_number is contained in the subtable_extension field of the * The program_number is contained in the subtable_extension field of the
* container #GstMpegTSSection. * container #GstMpegTsSection.
*/ */
struct _GstMpegTSPMT struct _GstMpegTsPMT
{ {
guint16 pcr_pid; guint16 pcr_pid;
@ -326,28 +326,28 @@ struct _GstMpegTSPMT
GType gst_mpegts_pmt_get_type (void); GType gst_mpegts_pmt_get_type (void);
GType gst_mpegts_pmt_stream_get_type (void); GType gst_mpegts_pmt_stream_get_type (void);
const GstMpegTSPMT *gst_mpegts_section_get_pmt (GstMpegTSSection *section); const GstMpegTsPMT *gst_mpegts_section_get_pmt (GstMpegTsSection *section);
/* TSDT */ /* TSDT */
GArray *gst_mpegts_section_get_tsdt (GstMpegTSSection *section); GArray *gst_mpegts_section_get_tsdt (GstMpegTsSection *section);
/* NIT */ /* NIT */
typedef struct _GstMpegTSNITStream GstMpegTSNITStream; typedef struct _GstMpegTsNITStream GstMpegTsNITStream;
typedef struct _GstMpegTSNIT GstMpegTSNIT; typedef struct _GstMpegTsNIT GstMpegTsNIT;
#define GST_TYPE_MPEGTS_NIT (gst_mpegts_nit_get_type()) #define GST_TYPE_MPEGTS_NIT (gst_mpegts_nit_get_type())
#define GST_TYPE_MPEGTS_NIT_STREAM (gst_mpegts_nit_stream_get_type()) #define GST_TYPE_MPEGTS_NIT_STREAM (gst_mpegts_nit_stream_get_type())
/** /**
* GstMpegTSNITStream: * GstMpegTsNITStream:
* @transport_stream_id: * @transport_stream_id:
* @original_network_id: * @original_network_id:
* @descriptors: (element-type GstMpegTSDescriptor) * @descriptors: (element-type GstMpegTsDescriptor)
* *
*/ */
struct _GstMpegTSNITStream struct _GstMpegTsNITStream
{ {
guint16 transport_stream_id; guint16 transport_stream_id;
guint16 original_network_id; guint16 original_network_id;
@ -356,17 +356,17 @@ struct _GstMpegTSNITStream
}; };
/** /**
* GstMpegTSNIT: * GstMpegTsNIT:
* @actual_network: Whether this NIT corresponds to the actual stream * @actual_network: Whether this NIT corresponds to the actual stream
* @descriptors: (element-type GstMpegTSDescriptor) the global descriptors * @descriptors: (element-type GstMpegTsDescriptor) the global descriptors
* @streams: (element-type GstMpegTSNITStream) the streams * @streams: (element-type GstMpegTsNITStream) the streams
* *
* Network Information Table (ISO/IEC 13818-1 / EN 300 468) * Network Information Table (ISO/IEC 13818-1 / EN 300 468)
* *
* The network_id is contained in the subtable_extension field of the * The network_id is contained in the subtable_extension field of the
* container #GstMpegTSSection. * container #GstMpegTsSection.
*/ */
struct _GstMpegTSNIT struct _GstMpegTsNIT
{ {
gboolean actual_network; gboolean actual_network;
@ -378,16 +378,16 @@ struct _GstMpegTSNIT
GType gst_mpegts_nit_get_type (void); GType gst_mpegts_nit_get_type (void);
GType gst_mpegts_nit_stream_get_type (void); GType gst_mpegts_nit_stream_get_type (void);
const GstMpegTSNIT *gst_mpegts_section_get_nit (GstMpegTSSection *section); const GstMpegTsNIT *gst_mpegts_section_get_nit (GstMpegTsSection *section);
/* BAT */ /* BAT */
typedef struct _GstMpegTSBATStream GstMpegTSBATStream; typedef struct _GstMpegTsBATStream GstMpegTsBATStream;
typedef struct _GstMpegTSBAT GstMpegTSBAT; typedef struct _GstMpegTsBAT GstMpegTsBAT;
#define GST_TYPE_MPEGTS_BAT (gst_mpegts_bat_get_type()) #define GST_TYPE_MPEGTS_BAT (gst_mpegts_bat_get_type())
struct _GstMpegTSBATStream struct _GstMpegTsBATStream
{ {
guint16 transport_stream_id; guint16 transport_stream_id;
guint16 original_network_id; guint16 original_network_id;
@ -396,11 +396,11 @@ struct _GstMpegTSBATStream
}; };
/** /**
* GstMpegTSBAT: * GstMpegTsBAT:
* *
* DVB Bouquet Association Table (EN 300 468) * DVB Bouquet Association Table (EN 300 468)
*/ */
struct _GstMpegTSBAT struct _GstMpegTsBAT
{ {
gboolean actual_network; gboolean actual_network;
@ -415,27 +415,27 @@ GType gst_mpegts_bat_get_type (void);
#define GST_TYPE_MPEGTS_SDT (gst_mpegts_sdt_get_type()) #define GST_TYPE_MPEGTS_SDT (gst_mpegts_sdt_get_type())
#define GST_TYPE_MPEGTS_SDT_SERVICE (gst_mpegts_sdt_service_get_type()) #define GST_TYPE_MPEGTS_SDT_SERVICE (gst_mpegts_sdt_service_get_type())
typedef struct _GstMpegTSSDTService GstMpegTSSDTService; typedef struct _GstMpegTsSDTService GstMpegTsSDTService;
typedef struct _GstMpegTSSDT GstMpegTSSDT; typedef struct _GstMpegTsSDT GstMpegTsSDT;
struct _GstMpegTSSDTService struct _GstMpegTsSDTService
{ {
guint16 service_id; guint16 service_id;
gboolean EIT_schedule_flag; gboolean EIT_schedule_flag;
gboolean EIT_present_following_flag; gboolean EIT_present_following_flag;
GstMpegTSRunningStatus running_status; GstMpegTsRunningStatus running_status;
gboolean free_CA_mode; gboolean free_CA_mode;
GArray *descriptors; GArray *descriptors;
}; };
/** /**
* GstMpegTSSDT: * GstMpegTsSDT:
* *
* Service Description Table (EN 300 468) * Service Description Table (EN 300 468)
*/ */
struct _GstMpegTSSDT struct _GstMpegTsSDT
{ {
guint16 original_network_id; guint16 original_network_id;
gboolean actual_ts; gboolean actual_ts;
@ -446,40 +446,40 @@ struct _GstMpegTSSDT
GType gst_mpegts_sdt_get_type (void); GType gst_mpegts_sdt_get_type (void);
GType gst_mpegts_sdt_service_get_type (void); GType gst_mpegts_sdt_service_get_type (void);
const GstMpegTSSDT *gst_mpegts_section_get_sdt (GstMpegTSSection *section); const GstMpegTsSDT *gst_mpegts_section_get_sdt (GstMpegTsSection *section);
/* EIT */ /* EIT */
#define GST_TYPE_MPEGTS_EIT (gst_mpegts_eit_get_type()) #define GST_TYPE_MPEGTS_EIT (gst_mpegts_eit_get_type())
#define GST_TYPE_MPEGTS_EIT_EVENT (gst_mpegts_eit_event_get_type()) #define GST_TYPE_MPEGTS_EIT_EVENT (gst_mpegts_eit_event_get_type())
typedef struct _GstMpegTSEITEvent GstMpegTSEITEvent; typedef struct _GstMpegTsEITEvent GstMpegTsEITEvent;
typedef struct _GstMpegTSEIT GstMpegTSEIT; typedef struct _GstMpegTsEIT GstMpegTsEIT;
/** /**
* GstMpegTSEITEvent: * GstMpegTsEITEvent:
* *
* Event from a @GstMpegTSEIT * Event from a @GstMpegTsEIT
*/ */
struct _GstMpegTSEITEvent struct _GstMpegTsEITEvent
{ {
guint16 event_id; guint16 event_id;
GstDateTime *start_time; GstDateTime *start_time;
guint32 duration; guint32 duration;
GstMpegTSRunningStatus running_status; GstMpegTsRunningStatus running_status;
gboolean free_CA_mode; gboolean free_CA_mode;
GArray *descriptors; GArray *descriptors;
}; };
/** /**
* GstMpegTSEIT: * GstMpegTsEIT:
* *
* Event Information Table (EN 300 468) * Event Information Table (EN 300 468)
*/ */
struct _GstMpegTSEIT struct _GstMpegTsEIT
{ {
guint16 transport_stream_id; guint16 transport_stream_id;
guint16 original_network_id; guint16 original_network_id;
@ -495,21 +495,21 @@ struct _GstMpegTSEIT
GType gst_mpegts_eit_get_type (void); GType gst_mpegts_eit_get_type (void);
GType gst_mpegts_eit_event_get_type (void); GType gst_mpegts_eit_event_get_type (void);
const GstMpegTSEIT *gst_mpegts_section_get_eit (GstMpegTSSection *section); const GstMpegTsEIT *gst_mpegts_section_get_eit (GstMpegTsSection *section);
/* TDT */ /* TDT */
GstDateTime *gst_mpegts_section_get_tdt (GstMpegTSSection *section); GstDateTime *gst_mpegts_section_get_tdt (GstMpegTsSection *section);
/* TOT */ /* TOT */
typedef struct _GstMpegTSTOT GstMpegTSTOT; typedef struct _GstMpegTsTOT GstMpegTsTOT;
#define GST_TYPE_MPEGTS_TOT (gst_mpegts_tot_get_type()) #define GST_TYPE_MPEGTS_TOT (gst_mpegts_tot_get_type())
/** /**
* GstMpegTSTOT: * GstMpegTsTOT:
* *
* Time Offset Table (EN 300 468) * Time Offset Table (EN 300 468)
*/ */
struct _GstMpegTSTOT struct _GstMpegTsTOT
{ {
GstDateTime *utc_time; GstDateTime *utc_time;
@ -517,18 +517,18 @@ struct _GstMpegTSTOT
}; };
GType gst_mpegts_tot_get_type (void); GType gst_mpegts_tot_get_type (void);
const GstMpegTSTOT *gst_mpegts_section_get_tot (GstMpegTSSection *section); const GstMpegTsTOT *gst_mpegts_section_get_tot (GstMpegTsSection *section);
/* generic */ /* generic */
#define gst_mpegts_section_ref(section) ((GstMpegTSSection*) gst_mini_object_ref (GST_MINI_OBJECT_CAST (section))) #define gst_mpegts_section_ref(section) ((GstMpegTsSection*) gst_mini_object_ref (GST_MINI_OBJECT_CAST (section)))
#define gst_mpegts_section_unref(section) (gst_mini_object_unref (GST_MINI_OBJECT_CAST (section))) #define gst_mpegts_section_unref(section) (gst_mini_object_unref (GST_MINI_OBJECT_CAST (section)))
GstMessage *gst_message_new_mpegts_section (GstObject *parent, GstMpegTSSection *section); GstMessage *gst_message_new_mpegts_section (GstObject *parent, GstMpegTsSection *section);
GstMpegTSSection *gst_message_parse_mpegts_section (GstMessage *message); GstMpegTsSection *gst_message_parse_mpegts_section (GstMessage *message);
GstMpegTSSection *gst_mpegts_section_new (guint16 pid, GstMpegTsSection *gst_mpegts_section_new (guint16 pid,
guint8 * data, guint8 * data,
gsize data_size); gsize data_size);