diff options
author | Zaheer Abbas Merali <zaheerabbas@merali.org> | 2009-07-02 15:58:00 +0100 |
---|---|---|
committer | Zaheer Abbas Merali <zaheerabbas@merali.org> | 2009-07-02 15:58:00 +0100 |
commit | 2e6de387ac4c1a4db433f3340ef19e00edc35b64 (patch) | |
tree | 6cf378206e02eae771d108294b1bb9acc674abb9 /gst/mpegdemux | |
parent | 8fade13db154dcf0b39cf5c15793d0f1f632f7ae (diff) | |
download | gst-plugins-bad-2e6de387ac4c1a4db433f3340ef19e00edc35b64.tar.gz gst-plugins-bad-2e6de387ac4c1a4db433f3340ef19e00edc35b64.tar.bz2 gst-plugins-bad-2e6de387ac4c1a4db433f3340ef19e00edc35b64.zip |
mpegtsparse: fix sdt parsing.
fix parsing of everything for each service from eit schedule flag on and also
add a running-status parameter to the bus message structure.
Diffstat (limited to 'gst/mpegdemux')
-rw-r--r-- | gst/mpegdemux/mpegtspacketizer.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/gst/mpegdemux/mpegtspacketizer.c b/gst/mpegdemux/mpegtspacketizer.c index b986fa60..c9fc325f 100644 --- a/gst/mpegdemux/mpegtspacketizer.c +++ b/gst/mpegdemux/mpegtspacketizer.c @@ -1264,17 +1264,16 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer, service_id = GST_READ_UINT16_BE (data); data += 2; - /* reserved */ - data += 1; + EIT_schedule = ((*data & 0x02) == 2); + EIT_present_following = (*data & 0x01) == 1; + data += 1; tmp = GST_READ_UINT16_BE (data); - data += 2; - EIT_schedule = (tmp >> 15); - EIT_present_following = (tmp >> 14) & 0x01; - running_status = (tmp >> 5) & 0x03; - scrambled = (tmp >> 4) & 0x01; + running_status = (*data >> 5) & 0x07; + scrambled = (*data >> 4) & 0x01; descriptors_loop_length = tmp & 0x0FFF; + data += 2; /* TODO send tag event down relevant pad for channel name and provider */ service_name = g_strdup_printf ("service-%d", service_id); @@ -1307,7 +1306,26 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer, (gchar *) DESC_DVB_SERVICE_name_text (service_descriptor); if (servicename_length + serviceprovider_name_length + 2 <= DESC_LENGTH (service_descriptor)) { - + gchar *running_status_tmp; + switch (running_status) { + case 0: + running_status_tmp = "undefined"; + break; + case 1: + running_status_tmp = "not running"; + break; + case 2: + running_status_tmp = "starts in a few seconds"; + break; + case 3: + running_status_tmp = "pausing"; + break; + case 4: + running_status_tmp = "running"; + break; + default: + running_status_tmp = "reserved"; + } servicename_tmp = get_encoding_and_convert (servicename, servicename_length); serviceprovider_name_tmp = @@ -1317,7 +1335,8 @@ mpegts_packetizer_parse_sdt (MpegTSPacketizer * packetizer, gst_structure_set (service, "name", G_TYPE_STRING, servicename_tmp, "provider-name", G_TYPE_STRING, serviceprovider_name_tmp, - "scrambled", G_TYPE_BOOLEAN, scrambled, NULL); + "scrambled", G_TYPE_BOOLEAN, scrambled, + "running-status", G_TYPE_STRING, running_status_tmp, NULL); g_free (servicename_tmp); g_free (serviceprovider_name_tmp); |