summaryrefslogtreecommitdiff
path: root/tests/examples/mpegts
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2014-07-10 11:29:41 +0200
committerEdward Hervey <edward@collabora.com>2014-07-11 08:32:07 +0200
commitb191053c7f438d74d4a600e1a92143d1768cf576 (patch)
treefc9ee68979bc8ff0d9de63cbd6bc5ce00fe56c22 /tests/examples/mpegts
parent9e73b487c4427495577fc3def77da39f84fa05b9 (diff)
examples: Add CAT section and CA descriptor support
https://bugzilla.gnome.org/show_bug.cgi?id=732986
Diffstat (limited to 'tests/examples/mpegts')
-rw-r--r--tests/examples/mpegts/ts-parser.c31
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;