From 307c4c56af59afce76a57fe3a8720af3b9bf928f Mon Sep 17 00:00:00 2001 From: Zaheer Abbas Merali Date: Tue, 22 Jan 2008 18:40:16 +0000 Subject: gst/mpegtsparse/mpegtspacketizer.c: Add event name and description to the eit structure sent in the bus message. Original commit message from CVS: * gst/mpegtsparse/mpegtspacketizer.c: Add event name and description to the eit structure sent in the bus message. --- ChangeLog | 6 ++++++ gst/mpegtsparse/mpegtspacketizer.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0879f2b6..f559e479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-22 Zaheer Abbas Merali + + * gst/mpegtsparse/mpegtspacketizer.c: + Add event name and description to the eit structure + sent in the bus message. + 2008-01-22 Zaheer Abbas Merali * gst/mpegtsparse/mpegtsparse.c: diff --git a/gst/mpegtsparse/mpegtspacketizer.c b/gst/mpegtsparse/mpegtspacketizer.c index fafd3c9b..80131836 100644 --- a/gst/mpegtsparse/mpegtspacketizer.c +++ b/gst/mpegtsparse/mpegtspacketizer.c @@ -994,6 +994,36 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer, gst_structure_free (event); goto error; } + guint8 *event_descriptor; + GstMPEGDescriptor *mpegdescriptor = + gst_mpeg_descriptor_parse (data, descriptors_loop_length); + event_descriptor = + gst_mpeg_descriptor_find (mpegdescriptor, DESC_DVB_SHORT_EVENT); + if (event_descriptor != NULL) { + guint eventname_length = + DESC_DVB_SHORT_EVENT_name_length (event_descriptor); + gchar *eventname = + (gchar *) DESC_DVB_SHORT_EVENT_name_text (event_descriptor); + guint eventdescription_length = + DESC_DVB_SHORT_EVENT_description_length (event_descriptor); + gchar *eventdescription = + (gchar *) DESC_DVB_SHORT_EVENT_description_text (event_descriptor); + if (eventname[0] < 0x20) { + eventname_length -= 1; + eventname += 1; + } + if (eventdescription[0] < 0x20) { + eventdescription_length -= 1; + eventdescription += 1; + } + + gst_structure_set (event, "name", G_TYPE_STRING, g_strndup (eventname, + eventname_length), NULL); + gst_structure_set (event, "description", G_TYPE_STRING, + g_strndup (eventdescription, eventdescription_length), NULL); + } + + gst_mpeg_descriptor_free (mpegdescriptor); descriptors = g_value_array_new (0); if (!mpegts_packetizer_parse_descriptors (packetizer, -- cgit v1.2.1