summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStefan Ringel <linuxtv@stefanringel.de>2014-05-28 12:23:12 +0200
committerEdward Hervey <bilboed@bilboed.com>2014-05-29 14:29:15 +0200
commitc35dc33b7fec609a450792e46b308f47dc55a173 (patch)
treee5404f13defdac35d41d123fd40bf93f23cace9b /tests
parent1c9bbb1e00a06a3ca97730f16bca032b9d2e0ba7 (diff)
downloadgstreamer-plugins-bad-c35dc33b7fec609a450792e46b308f47dc55a173.tar.gz
example: ts-parser: add content descriptor
https://bugzilla.gnome.org/show_bug.cgi?id=730854
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/mpegts/ts-parser.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c
index d157702d7..cc57b27ce 100644
--- a/tests/examples/mpegts/ts-parser.c
+++ b/tests/examples/mpegts/ts-parser.c
@@ -427,6 +427,28 @@ dump_component (GstMpegTsDescriptor * desc, guint spacing)
}
static void
+dump_content (GstMpegTsDescriptor * desc, guint spacing)
+{
+ GPtrArray *contents;
+ guint i;
+
+ if (gst_mpegts_descriptor_parse_dvb_content (desc, &contents)) {
+ for (i = 0; i < contents->len; i++) {
+ GstMpegTsContent *item = g_ptr_array_index (contents, i);
+ g_printf ("%*s content nibble 1 : 0x%01x (%s)\n", spacing, "",
+ item->content_nibble_1,
+ enum_name (GST_TYPE_MPEG_TS_CONTENT_NIBBLE_HI,
+ item->content_nibble_1));
+ g_printf ("%*s content nibble 2 : 0x%01x\n", spacing, "",
+ item->content_nibble_2);
+ g_printf ("%*s user_byte : 0x%02x\n", spacing, "",
+ item->user_byte);
+ }
+ g_ptr_array_unref (contents);
+ }
+}
+
+static void
dump_iso_639_language (GstMpegTsDescriptor * desc, guint spacing)
{
guint i;
@@ -583,6 +605,9 @@ dump_descriptors (GPtrArray * descriptors, guint spacing)
case GST_MTS_DESC_DVB_COMPONENT:
dump_component (desc, spacing + 2);
break;
+ case GST_MTS_DESC_DVB_CONTENT:
+ dump_content (desc, spacing + 2);
+ break;
case GST_MTS_DESC_ISO_639_LANGUAGE:
dump_iso_639_language (desc, spacing + 2);
break;
@@ -1123,6 +1148,7 @@ main (int argc, gchar ** argv)
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);
+ g_type_class_ref (GST_TYPE_MPEG_TS_CONTENT_NIBBLE_HI);
mainloop = g_main_loop_new (NULL, FALSE);