diff options
author | Stefan Ringel <linuxtv@stefanringel.de> | 2014-05-28 12:19:43 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2014-05-29 14:29:15 +0200 |
commit | 1c9bbb1e00a06a3ca97730f16bca032b9d2e0ba7 (patch) | |
tree | cf708dd3622d8f42276715c3e477511b98d34e7e /tests | |
parent | 74681cf00a3ab17d54963e7dbb8b2abaf259fd8e (diff) | |
download | gstreamer-plugins-bad-1c9bbb1e00a06a3ca97730f16bca032b9d2e0ba7.tar.gz |
example: ts-parser: add component descriptor
https://bugzilla.gnome.org/show_bug.cgi?id=730854
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examples/mpegts/ts-parser.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index 9a4eeed6a..d157702d7 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -407,6 +407,26 @@ dump_linkage (GstMpegTsDescriptor * desc, guint spacing) } static void +dump_component (GstMpegTsDescriptor * desc, guint spacing) +{ + GstMpegTsComponentDescriptor res; + + res.text = NULL; + + if (gst_mpegts_descriptor_parse_dvb_component (desc, &res)) { + g_printf ("%*s stream_content : 0x%02x (%s)\n", spacing, "", + res.stream_content, + enum_name (GST_TYPE_MPEG_TS_COMPONENT_STREAM_CONTENT, + res.stream_content)); + g_printf ("%*s component_type : 0x%02x\n", spacing, "", res.component_type); + g_printf ("%*s component_tag : 0x%02x\n", spacing, "", res.component_tag); + g_printf ("%*s language_code : %s\n", spacing, "", res.language_code); + g_printf ("%*s text : %s\n", spacing, "", + res.text ? res.text : "NULL"); + } +} + +static void dump_iso_639_language (GstMpegTsDescriptor * desc, guint spacing) { guint i; @@ -560,6 +580,9 @@ dump_descriptors (GPtrArray * descriptors, guint spacing) case GST_MTS_DESC_DVB_LINKAGE: dump_linkage (desc, spacing + 2); break; + case GST_MTS_DESC_DVB_COMPONENT: + dump_component (desc, spacing + 2); + break; case GST_MTS_DESC_ISO_639_LANGUAGE: dump_iso_639_language (desc, spacing + 2); break; @@ -1099,6 +1122,7 @@ main (int argc, gchar ** argv) g_type_class_ref (GST_TYPE_MPEG_TS_TERRESTRIAL_HIERARCHY); g_type_class_ref (GST_TYPE_MPEG_TS_DVB_LINKAGE_TYPE); g_type_class_ref (GST_TYPE_MPEG_TS_DVB_LINKAGE_HAND_OVER_TYPE); + g_type_class_ref (GST_TYPE_MPEG_TS_COMPONENT_STREAM_CONTENT); mainloop = g_main_loop_new (NULL, FALSE); |