diff options
author | Stefan Ringel <linuxtv@stefanringel.de> | 2014-04-10 16:00:50 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-04-16 09:21:45 +0200 |
commit | ace60abef5e5a90b216e30f67142a957fa964b5e (patch) | |
tree | 45343fec1e489634d30d5f3bb39dc85f355f6049 | |
parent | 065abf6d542a7dcf86678a8aa6975e78562a64bd (diff) | |
download | gstreamer-plugins-bad-ace60abef5e5a90b216e30f67142a957fa964b5e.tar.gz |
mpegts: add data broadcast id descriptor
https://bugzilla.gnome.org/show_bug.cgi?id=727403
-rw-r--r-- | docs/libs/gst-plugins-bad-libs-sections.txt | 2 | ||||
-rw-r--r-- | gst-libs/gst/mpegts/gst-dvb-descriptor.c | 36 | ||||
-rw-r--r-- | gst-libs/gst/mpegts/gst-dvb-descriptor.h | 3 |
3 files changed, 40 insertions, 1 deletions
diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt index 25f1b1a32..7a039ef3b 100644 --- a/docs/libs/gst-plugins-bad-libs-sections.txt +++ b/docs/libs/gst-plugins-bad-libs-sections.txt @@ -305,6 +305,8 @@ gst_mpegts_descriptor_parse_dvb_private_data_specifier <SUBSECTION data_broadcast> GstMpegTsDataBroadcastDescriptor gst_mpegts_descriptor_parse_dvb_data_broadcast +<SUBSECTION data_broadcast_id> +gst_mpegts_descriptor_parse_dvb_data_broadcast_id <SUBSECTION parental_rating> GstMpegTsDVBParentalRatingItem gst_mpegts_descriptor_parse_dvb_parental_rating diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.c b/gst-libs/gst/mpegts/gst-dvb-descriptor.c index 735821a1c..b84c564a5 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.c +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.c @@ -1325,6 +1325,42 @@ gst_mpegts_descriptor_parse_dvb_data_broadcast (const GstMpegTsDescriptor return TRUE; } +/* GST_MTS_DESC_DVB_DATA_BROADCAST_ID (0x66) */ +/** + * gst_mpegts_descriptor_parse_dvb_data_broadcast_id: + * @descriptor: a %GST_MTS_DESC_DVB_DATA_BROADCAST_ID #GstMpegTsDescriptor + * @data_broadcast_id: (out): the data broadcast id + * @id_selector_bytes: (out): the selector bytes, if present + * @len: (out): the length of #id_selector_bytes + * + * Parses out the data broadcast id from the @descriptor. + * + * Returns: %TRUE if the parsing happened correctly, else %FALSE. + */ +gboolean +gst_mpegts_descriptor_parse_dvb_data_broadcast_id (const GstMpegTsDescriptor + * descriptor, guint16 * data_broadcast_id, guint8 ** id_selector_bytes, + guint8 * len) +{ + guint8 *data; + + g_return_val_if_fail (descriptor != NULL && data_broadcast_id != NULL && + id_selector_bytes != NULL, FALSE); + __common_desc_checks (descriptor, GST_MTS_DESC_DVB_DATA_BROADCAST_ID, 2, + FALSE); + + data = (guint8 *) descriptor->data + 2; + + *data_broadcast_id = GST_READ_UINT16_BE (data); + data += 2; + + *len = descriptor->length - 2; + + *id_selector_bytes = g_memdup (data, *len); + + return TRUE; +} + /* GST_MTS_DESC_EXT_DVB_T2_DELIVERY_SYSTEM (0x7F && 0x04) */ static void _gst_mpegts_t2_delivery_system_cell_extension_free diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.h b/gst-libs/gst/mpegts/gst-dvb-descriptor.h index 95fb9a510..a556ddfa4 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.h +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.h @@ -658,7 +658,8 @@ gboolean gst_mpegts_descriptor_parse_dvb_data_broadcast (const GstMpegTsDescript *descriptor, GstMpegTsDataBroadcastDescriptor * res); /* GST_MTS_DESC_DVB_DATA_BROADCAST_ID (0x66) */ -/* FIXME : Implement */ +gboolean gst_mpegts_descriptor_parse_dvb_data_broadcast_id (const GstMpegTsDescriptor + * descriptor, guint16 * data_broadcast_id, guint8 ** id_selector_bytes, guint8 * len); /* GST_MTS_DESC_DVB_AC3 (0x6a) */ /* FIXME : Implement */ |