mpegts: add private data specifier descriptor

https://bugzilla.gnome.org/show_bug.cgi?id=727403
This commit is contained in:
Stefan Ringel 2014-04-10 15:59:50 +02:00 committed by Sebastian Dröge
parent 8407ee9ee9
commit 065abf6d54
3 changed files with 43 additions and 0 deletions

View file

@ -300,6 +300,8 @@ GstMpegTsDVBLinkageEvent
GstMpegTsDVBLinkageExtendedEvent
GstMpegTsDVBLinkageDescriptor
gst_mpegts_descriptor_parse_dvb_linkage
<SUBSECTION private_data_specifier>
gst_mpegts_descriptor_parse_dvb_private_data_specifier
<SUBSECTION data_broadcast>
GstMpegTsDataBroadcastDescriptor
gst_mpegts_descriptor_parse_dvb_data_broadcast

View file

@ -1247,6 +1247,42 @@ gst_mpegts_descriptor_parse_terrestrial_delivery_system (const
return TRUE;
}
/* GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER (0x5F) */
/**
* gst_mpegts_descriptor_parse_dvb_private_data_specifier:
* @descriptor: a %GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER #GstMpegTsDescriptor
* @private_data_specifier: (out): the private data specifier id
* registered by http://www.dvbservices.com/
* @private_data: (out): additional data or NULL
* @length: (out): length of %private_data
*
* Parses out the private data specifier from the @descriptor.
*
* Returns: %TRUE if the parsing happened correctly, else %FALSE.
*/
gboolean
gst_mpegts_descriptor_parse_dvb_private_data_specifier (const
GstMpegTsDescriptor * descriptor, guint32 * private_data_specifier,
guint8 ** private_data, guint8 * length)
{
guint8 *data;
g_return_val_if_fail (descriptor != NULL
&& private_data_specifier != NULL, FALSE);
__common_desc_checks (descriptor,
GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER, 4, FALSE);
data = (guint8 *) descriptor->data + 2;
*private_data_specifier = GST_READ_UINT32_BE (data);
*length = descriptor->length - 4;
*private_data = g_memdup (data + 4, *length);
return TRUE;
}
/* GST_MTS_DESC_DVB_DATA_BROADCAST (0x64) */
/**
* gst_mpegts_descriptor_parse_dvb_data_broadcast:

View file

@ -626,6 +626,11 @@ struct _GstMpegTsTerrestrialDeliverySystemDescriptor
gboolean gst_mpegts_descriptor_parse_terrestrial_delivery_system (const GstMpegTsDescriptor
*descriptor, GstMpegTsTerrestrialDeliverySystemDescriptor * res);
/* GST_MTS_DESC_DVB_PRIVATE_DATA_SPECIFIER (0x5F) */
gboolean gst_mpegts_descriptor_parse_dvb_private_data_specifier (const GstMpegTsDescriptor
* descriptor, guint32 * private_data_specifier, guint8 ** private_data,
guint8 * length);
/* GST_MTS_DESC_DVB_FREQUENCY_LIST (0x62) */
/* FIXME : Implement */