From 1f2f0f31bf50aab4fd02c8f8c4e9708f777530bb Mon Sep 17 00:00:00 2001 From: Jesper Larsen Date: Tue, 19 Nov 2013 11:36:14 +0100 Subject: [PATCH] examples: ts-parser: Add DVB teletext/subtitling https://bugzilla.gnome.org/show_bug.cgi?id=721682 --- tests/examples/mpegts/ts-parser.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index 2609e70..3fee8a4 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -239,6 +239,44 @@ dump_descriptors (GPtrArray * descriptors, guint spacing) } } break; + case GST_MTS_DESC_DVB_SUBTITLING: + { + gchar lang[4]; + guint8 type; + guint16 composition; + guint16 ancillary; + guint i; + + for (i = 0; + gst_mpegts_descriptor_parse_dvb_subtitling_idx (desc, i, &lang, + &type, &composition, &ancillary); i++) { + g_printf ("%*s Subtitling, language_code:%s\n", spacing, "", lang); + g_printf ("%*s type : %u\n", spacing, "", type); + g_printf ("%*s composition page id : %u\n", spacing, "", + composition); + g_printf ("%*s ancillary page id : %u\n", spacing, "", + ancillary); + } + } + break; + case GST_MTS_DESC_DVB_TELETEXT: + { + GstMpegTsDVBTeletextType type; + gchar lang[4]; + guint8 magazine, page_number; + guint i; + + for (i = 0; + gst_mpegts_descriptor_parse_dvb_teletext_idx (desc, i, &lang, &type, + &magazine, &page_number); i++) { + g_printf ("%*s Teletext, type:0x%02x (%s)\n", spacing, "", type, + enum_name (GST_TYPE_MPEG_TS_DVB_TELETEXT_TYPE, type)); + g_printf ("%*s language : %s\n", spacing, "", lang); + g_printf ("%*s magazine : %u\n", spacing, "", magazine); + g_printf ("%*s page number : %u\n", spacing, "", page_number); + } + } + break; default: break; } @@ -527,6 +565,7 @@ main (int argc, gchar ** argv) g_type_class_ref (GST_TYPE_MPEG_TS_MISC_DESCRIPTOR_TYPE); g_type_class_ref (GST_TYPE_MPEG_TS_ISO639_AUDIO_TYPE); g_type_class_ref (GST_TYPE_MPEG_TS_DVB_SERVICE_TYPE); + g_type_class_ref (GST_TYPE_MPEG_TS_DVB_TELETEXT_TYPE); g_type_class_ref (GST_TYPE_MPEG_TS_STREAM_TYPE); mainloop = g_main_loop_new (NULL, FALSE); -- 2.7.4