mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
mpegts: Add support for content descriptor
https://bugzilla.gnome.org/show_bug.cgi?id=724034
This commit is contained in:
parent
792fc1cf01
commit
beb31d127b
2 changed files with 51 additions and 0 deletions
|
@ -590,6 +590,45 @@ gst_mpegts_descriptor_parse_dvb_component (const GstMpegTsDescriptor
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* GST_MTS_DESC_DVB_CONTENT (0x54) */
|
||||
/**
|
||||
* gst_mpegts_descriptor_parse_dvb_content:
|
||||
* @descriptor: a %GST_MTS_DESC_DVB_CONTENT #GstMpegTsDescriptor
|
||||
* @content: (out) (transfer none) (element-type GstMpegTsContent): #GstMpegTsContent
|
||||
*
|
||||
* Extracts the DVB content information from @descriptor:
|
||||
*
|
||||
* Returns: %TRUE if the parsing happened correctly, else %FALSE.
|
||||
*/
|
||||
gboolean
|
||||
gst_mpegts_descriptor_parse_dvb_content (const GstMpegTsDescriptor
|
||||
* descriptor, GPtrArray ** content)
|
||||
{
|
||||
guint8 *data;
|
||||
guint8 len, tmp;
|
||||
|
||||
g_return_val_if_fail (descriptor != NULL && descriptor->data != NULL, FALSE);
|
||||
g_return_val_if_fail (descriptor->tag == GST_MTS_DESC_DVB_CONTENT, FALSE);
|
||||
|
||||
data = (guint8 *) descriptor->data + 2;
|
||||
len = descriptor->length;
|
||||
|
||||
*content = g_ptr_array_new ();
|
||||
for (guint8 i = 0; i < len;) {
|
||||
GstMpegTsContent *cont = malloc (sizeof (GstMpegTsContent));
|
||||
tmp = *data;
|
||||
cont->content_nibble_1 = (tmp & 0xf0) >> 4;
|
||||
cont->content_nibble_2 = tmp & 0x0f;
|
||||
data += 1;
|
||||
cont->user_byte = *data;
|
||||
data += 1;
|
||||
i += 2;
|
||||
g_ptr_array_add (*content, cont);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* GST_MTS_DESC_DVB_TERRESTRIAL_DELIVERY_SYSTEM (0x5A) */
|
||||
/**
|
||||
* gst_mpegts_descriptor_parse_dvb_terrestrial_delivary_system:
|
||||
|
|
|
@ -342,6 +342,18 @@ gboolean gst_mpegts_descriptor_parse_dvb_component (const GstMpegTsDescriptor *d
|
|||
gboolean gst_mpegts_descriptor_parse_dvb_stream_identifier (const GstMpegTsDescriptor *descriptor,
|
||||
guint8 *component_tag);
|
||||
|
||||
/* GST_MTS_DESC_DVB_CONTENT (0x54) */
|
||||
typedef struct _GstMpegTsContent GstMpegTsContent;
|
||||
struct _GstMpegTsContent
|
||||
{
|
||||
guint8 content_nibble_1;
|
||||
guint8 content_nibble_2;
|
||||
guint8 user_byte;
|
||||
};
|
||||
|
||||
gboolean gst_mpegts_descriptor_parse_dvb_content (const GstMpegTsDescriptor *
|
||||
descriptor, GPtrArray ** content);
|
||||
|
||||
/* GST_MTS_DESC_DVB_TELETEXT (0x56) */
|
||||
/**
|
||||
* GstMpegTsDVBTeletextType:
|
||||
|
|
Loading…
Reference in a new issue