summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2008-01-22 18:40:16 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-01-22 18:40:16 +0000
commit307c4c56af59afce76a57fe3a8720af3b9bf928f (patch)
tree6470858e4e1587e6ee5d4ba8ffc3c8da68056c01
parentfa8f099a5acfefb28bd5f032d03122caa925ba00 (diff)
downloadgst-plugins-bad-307c4c56af59afce76a57fe3a8720af3b9bf928f.tar.gz
gst-plugins-bad-307c4c56af59afce76a57fe3a8720af3b9bf928f.tar.bz2
gst-plugins-bad-307c4c56af59afce76a57fe3a8720af3b9bf928f.zip
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.
-rw-r--r--ChangeLog6
-rw-r--r--gst/mpegtsparse/mpegtspacketizer.c30
2 files changed, 36 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0879f2b6..f559e479 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-01-22 Zaheer Abbas Merali <zaheerabbas at merali dot org>
+ * gst/mpegtsparse/mpegtspacketizer.c:
+ Add event name and description to the eit structure
+ sent in the bus message.
+
+2008-01-22 Zaheer Abbas Merali <zaheerabbas at merali dot org>
+
* gst/mpegtsparse/mpegtsparse.c:
Revert const removal from previous commit.
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,