diff options
author | Zaheer Abbas Merali <zaheerabbas@merali.org> | 2009-07-07 15:28:04 +0100 |
---|---|---|
committer | Zaheer Abbas Merali <zaheerabbas@merali.org> | 2009-07-08 10:33:29 +0100 |
commit | 66a5549094b3e6bcffc1d7a40a95e9b6160d07bb (patch) | |
tree | e4bd90a07bc8584553579e8206b122c64a7f6f4c /gst/mpegdemux | |
parent | 9b9b8cd58e058800be01256cc4f2886a46264120 (diff) | |
download | gst-plugins-bad-66a5549094b3e6bcffc1d7a40a95e9b6160d07bb.tar.gz gst-plugins-bad-66a5549094b3e6bcffc1d7a40a95e9b6160d07bb.tar.bz2 gst-plugins-bad-66a5549094b3e6bcffc1d7a40a95e9b6160d07bb.zip |
mpegtsparse: add parsing of data broadcast descriptors
Diffstat (limited to 'gst/mpegdemux')
-rw-r--r-- | gst/mpegdemux/gstmpegdesc.h | 13 | ||||
-rw-r--r-- | gst/mpegdemux/mpegtspacketizer.c | 24 |
2 files changed, 37 insertions, 0 deletions
diff --git a/gst/mpegdemux/gstmpegdesc.h b/gst/mpegdemux/gstmpegdesc.h index 84b40009..3f99b843 100644 --- a/gst/mpegdemux/gstmpegdesc.h +++ b/gst/mpegdemux/gstmpegdesc.h @@ -302,6 +302,19 @@ #define DESC_DVB_CABLE_DELIVERY_SYSTEM_symbol_rate(desc) (desc + 9) #define DESC_DVB_CABLE_DELIVERY_SYSTEM_fec_inner(desc) (desc[12] & 0x0F) +/* DVB Data Broadcast Descriptor */ +#define DESC_DVB_DATA_BROADCAST_data_broadcast_id(desc) (GST_READ_UINT16_BE((desc) + 2)) +#define DESC_DVB_DATA_BROADCAST_component_tag(desc) (desc[4]) +#define DESC_DVB_DATA_BROADCAST_selector_length(desc) (desc[5]) +#define DESC_DVB_DATA_BROADCAST_selector(desc) (desc + 6) +#define DESC_DVB_DATA_BROADCAST_iso639_language_code(desc) (desc + 6 + DESC_DVB_DATA_BROADCAST_selector_length(desc)) +#define DESC_DVB_DATA_BROADCAST_text_length(desc) (desc + 9 + DESC_DVB_DATA_BROADCAST_selector_length(desc)) +#define DESC_DVB_DATA_BROADCAST_text(desc) (desc + 10 + DESC_DVB_DATA_BROADCAST_selector_length(desc)) + +/* DVB Data Broadcast Id Descriptor */ +#define DESC_DVB_DATA_BROADCAST_ID_data_broadcast_id(desc) (GST_READ_UINT16_BE((desc) + 2)) +#define DESC_DVB_DATA_BROADCAST_ID_id_selector_byte(desc) (desc + 4) + typedef struct { guint n_desc; guint8 data_length; diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index c9fc325f..8d8e3c1f 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -507,10 +507,34 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer, GstMPEGDescriptor *desc = gst_mpeg_descriptor_parse (data, stream_info_length); if (desc != NULL) { + guint8 *desc_data; if (gst_mpeg_descriptor_find (desc, DESC_DVB_AC3)) { gst_structure_set (stream_info, "has-ac3", G_TYPE_BOOLEAN, TRUE, NULL); } + desc_data = gst_mpeg_descriptor_find (desc, DESC_DVB_DATA_BROADCAST_ID); + if (desc_data) { + guint16 data_broadcast_id; + data_broadcast_id = + DESC_DVB_DATA_BROADCAST_ID_data_broadcast_id (desc_data); + gst_structure_set (stream_info, "data-broadcast-id", G_TYPE_UINT, + data_broadcast_id, NULL); + } + desc_data = gst_mpeg_descriptor_find (desc, DESC_DVB_DATA_BROADCAST); + if (desc_data) { + GstStructure *databroadcast_info; + guint16 data_broadcast_id; + guint8 component_tag; + data_broadcast_id = + DESC_DVB_DATA_BROADCAST_data_broadcast_id (desc_data); + component_tag = DESC_DVB_DATA_BROADCAST_component_tag (desc_data); + databroadcast_info = gst_structure_new ("data-broadcast", "id", + G_TYPE_UINT, data_broadcast_id, "component-tag", component_tag, + NULL); + gst_structure_set (stream_info, "data-broadcast", GST_TYPE_STRUCTURE, + databroadcast_info, NULL); + } + gst_mpeg_descriptor_free (desc); } |