From 985d19deaa59514227f8f655a07a5651b31e5bfe Mon Sep 17 00:00:00 2001 From: Stefan Ringel Date: Thu, 17 Apr 2014 14:55:29 +0200 Subject: [PATCH] mpegts: add stuffing descriptor https://bugzilla.gnome.org/show_bug.cgi?id=728364 --- docs/libs/gst-plugins-bad-libs-sections.txt | 2 ++ gst-libs/gst/mpegts/gst-dvb-descriptor.c | 26 +++++++++++++++++++++ gst-libs/gst/mpegts/gst-dvb-descriptor.h | 5 ++++ 3 files changed, 33 insertions(+) diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt index c1f7216901..2a0d53345e 100644 --- a/docs/libs/gst-plugins-bad-libs-sections.txt +++ b/docs/libs/gst-plugins-bad-libs-sections.txt @@ -323,6 +323,8 @@ gst_mpegts_descriptor_parse_dvb_ca_identifier GstMpegTsDVBServiceListItem gst_mpegts_descriptor_parse_dvb_service_list + +gst_mpegts_descriptor_parse_dvb_stuffing GST_TYPE_MPEG_TSDVB_CODE_RATE gst_mpegts_dvb_code_rate_get_type diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.c b/gst-libs/gst/mpegts/gst-dvb-descriptor.c index caa593d84e..3f1275f912 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.c +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.c @@ -159,6 +159,32 @@ gst_mpegts_descriptor_parse_dvb_service_list (const GstMpegTsDescriptor * return TRUE; } +/* GST_MTS_DESC_DVB_STUFFING (0x42) */ +/** + * gst_mpegts_descriptor_parse_dvb_stuffing: + * @descriptor: a %GST_MTS_DESC_DVB_STUFFING #GstMpegTsDescriptor + * @stuffing_bytes: (out): the stuffing bytes + * + * Parses out the stuffing bytes from the @descriptor. + * + * Returns: %TRUE if the parsing happened correctly, else %FALSE. + */ +gboolean +gst_mpegts_descriptor_parse_dvb_stuffing (const GstMpegTsDescriptor * + descriptor, guint8 ** stuffing_bytes) +{ + guint8 *data; + + g_return_val_if_fail (descriptor != NULL && stuffing_bytes != NULL, FALSE); + __common_desc_checks (descriptor, GST_MTS_DESC_DVB_STUFFING, 0, FALSE); + + data = (guint8 *) descriptor->data + 2; + + *stuffing_bytes = g_memdup (data, descriptor->length); + + return TRUE; +} + /* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */ /** * gst_mpegts_descriptor_parse_satellite_delivery_system: diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.h b/gst-libs/gst/mpegts/gst-dvb-descriptor.h index 3e4f496bf0..65804c1ace 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.h +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.h @@ -161,6 +161,11 @@ gboolean gst_mpegts_descriptor_parse_dvb_network_name (const GstMpegTsDescriptor GstMpegTsDescriptor *gst_mpegts_descriptor_from_dvb_network_name (const gchar * name); +/* GST_MTS_DESC_DVB_STUFFING (0x42) */ +gboolean gst_mpegts_descriptor_parse_dvb_stuffing (const GstMpegTsDescriptor * descriptor, + guint8 ** stuffing_bytes); + + /* GST_MTS_DESC_DVB_SATELLITE_DELIVERY_SYSTEM (0x43) */ typedef struct _GstMpegTsSatelliteDeliverySystemDescriptor GstMpegTsSatelliteDeliverySystemDescriptor;