diff options
author | Edward Hervey <bilboed@bilboed.com> | 2014-07-10 11:29:41 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2014-07-11 08:32:07 +0200 |
commit | b191053c7f438d74d4a600e1a92143d1768cf576 (patch) | |
tree | fc9ee68979bc8ff0d9de63cbd6bc5ce00fe56c22 | |
parent | 9e73b487c4427495577fc3def77da39f84fa05b9 (diff) | |
download | gstreamer-plugins-bad-b191053c7f438d74d4a600e1a92143d1768cf576.tar.gz |
examples: Add CAT section and CA descriptor support
https://bugzilla.gnome.org/show_bug.cgi?id=732986
-rw-r--r-- | tests/examples/mpegts/ts-parser.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index e2099c19b..3cfb90c8a 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -507,6 +507,23 @@ dump_descriptors (GPtrArray * descriptors, guint spacing) break; } + case GST_MTS_DESC_CA: + { + guint16 ca_pid, ca_system_id; + const guint8 *private_data; + gsize private_data_size; + if (gst_mpegts_descriptor_parse_ca (desc, &ca_system_id, &ca_pid, + &private_data, &private_data_size)) { + g_printf ("%*s CA system id : 0x%04x\n", spacing, "", ca_system_id); + g_printf ("%*s CA PID : 0x%04x\n", spacing, "", ca_pid); + if (private_data_size) { + g_printf ("%*s Private Data :\n", spacing, ""); + dump_memory_bytes ((guint8 *) private_data, private_data_size, + spacing + 2); + } + } + break; + } case GST_MTS_DESC_DVB_NETWORK_NAME: { gchar *network_name; @@ -1084,6 +1101,17 @@ dump_vct (GstMpegtsSection * section) } static void +dump_cat (GstMpegtsSection * section) +{ + GPtrArray *descriptors; + + descriptors = gst_mpegts_section_get_cat (section); + g_assert (descriptors); + dump_descriptors (descriptors, 7); + g_ptr_array_unref (descriptors); +} + +static void dump_section (GstMpegtsSection * section) { switch (GST_MPEGTS_SECTION_TYPE (section)) { @@ -1093,6 +1121,9 @@ dump_section (GstMpegtsSection * section) case GST_MPEGTS_SECTION_PMT: dump_pmt (section); break; + case GST_MPEGTS_SECTION_CAT: + dump_cat (section); + break; case GST_MPEGTS_SECTION_TDT: dump_tdt (section); break; |