From c90fccd98650561ffe512b26faafc348155104fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=80ngel=20Farr=C3=A9?= Date: Wed, 8 Jul 2009 10:11:52 +0100 Subject: mpegtsparse: parse carousel identifier descriptor --- gst/mpegdemux/gstmpegdesc.h | 4 ++++ gst/mpegdemux/mpegtspacketizer.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/gst/mpegdemux/gstmpegdesc.h b/gst/mpegdemux/gstmpegdesc.h index 3f99b843..71b74aa2 100644 --- a/gst/mpegdemux/gstmpegdesc.h +++ b/gst/mpegdemux/gstmpegdesc.h @@ -78,6 +78,7 @@ #define DESC_DIRAC_TC_PRIVATE 0xAC /* DVB tags */ +#define DESC_DVB_CAROUSEL_IDENTIFIER 0x13 #define DESC_DVB_NETWORK_NAME 0x40 #define DESC_DVB_SERVICE_LIST 0x41 #define DESC_DVB_STUFFING 0x42 @@ -315,6 +316,9 @@ #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) +/* DVB Carousel Identifier Descriptor */ +#define DESC_DVB_CAROUSEL_IDENTIFIER_carousel_id(desc) (GST_READ_UINT32_BE((desc) + 2)) + typedef struct { guint n_desc; guint8 data_length; diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index 8d8e3c1f..f7e55896 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -534,6 +534,14 @@ mpegts_packetizer_parse_pmt (MpegTSPacketizer * packetizer, gst_structure_set (stream_info, "data-broadcast", GST_TYPE_STRUCTURE, databroadcast_info, NULL); } + desc_data = + gst_mpeg_descriptor_find (desc, DESC_DVB_CAROUSEL_IDENTIFIER); + if (desc_data) { + guint32 carousel_id; + carousel_id = DESC_DVB_CAROUSEL_IDENTIFIER_carousel_id (desc_data); + gst_structure_set (stream_info, "carousel-id", G_TYPE_UINT, + carousel_id, NULL); + } gst_mpeg_descriptor_free (desc); } -- cgit v1.2.1