From: Thiago Santos Date: Mon, 19 May 2014 17:50:13 +0000 (-0300) Subject: examples: mpegts: add function to dump ETT tables X-Git-Tag: 1.19.3~507^2~10980 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01178115a42a6353aaabfc5d6bd85bd33e98343d;p=platform%2Fupstream%2Fgstreamer.git examples: mpegts: add function to dump ETT tables https://bugzilla.gnome.org/show_bug.cgi?id=730435 --- diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index f10f403..029a274 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -604,6 +604,42 @@ dump_eit (GstMpegTsSection * section) } static void +dump_ett (GstMpegTsSection * section) +{ + const GstMpegTsAtscETT *ett = gst_mpegts_section_get_atsc_ett (section); + guint i, len; + + g_assert (ett); + + g_printf (" service_id : 0x%04x\n", section->subtable_extension); + g_printf (" protocol_version : 0x%04x\n", ett->protocol_version); + g_printf (" etm_id : 0x%04x\n", ett->etm_id); + + len = ett->messages->len; + g_printf (" %d Messages(s):\n", len); + for (i = 0; i < len; i++) { + gint j, n; + GstMpegTsAtscMultString *mstring = g_ptr_array_index (ett->messages, i); + + n = mstring->segments->len; + g_printf (" iso_639_langcode:%s\n", mstring->iso_639_langcode); + g_printf (" segments:%d\n", n); + for (j = 0; j < n; j++) { + GstMpegTsAtscStringSegment *segment = + g_ptr_array_index (mstring->segments, j); + + g_printf (" Compression:0x%x\n", + segment->compression_type); + g_printf (" Mode:0x%x\n", segment->mode); + g_printf (" Len:%u\n", + segment->compressed_data_size); + g_printf (" %s\n", + gst_mpegts_atsc_string_segment_get_string (segment)); + } + } +} + +static void dump_nit (GstMpegTsSection * section) { const GstMpegTsNIT *nit = gst_mpegts_section_get_nit (section); @@ -800,6 +836,9 @@ dump_section (GstMpegTsSection * section) case GST_MPEGTS_SECTION_ATSC_TVCT: dump_vct (section); break; + case GST_MPEGTS_SECTION_ATSC_ETT: + dump_ett (section); + break; default: g_printf (" Unknown section type\n"); break;