summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2013-07-06 10:59:08 +0200
committerEdward Hervey <edward@collabora.com>2013-07-06 10:59:55 +0200
commitb4e226174974db8ce7fee1d9489ea0eb8fb7a7b3 (patch)
treec523a27943b9a26e746102f6bd725c560f3926dd /tests
parentd95bb488647d69938668246590ea3aae128d8d41 (diff)
examples: Registration descriptor support
And output the length of the descriptors
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/mpegts/ts-parser.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c
index 19989e1566..ba38b3aaf3 100644
--- a/tests/examples/mpegts/ts-parser.c
+++ b/tests/examples/mpegts/ts-parser.c
@@ -127,9 +127,20 @@ dump_descriptors (GArray * descriptors, guint spacing)
for (i = 0; i < descriptors->len; i++) {
GstMpegTsDescriptor *desc =
&g_array_index (descriptors, GstMpegTsDescriptor, i);
- g_printf ("%*s [descriptor 0x%02x (%s)]\n", spacing, "",
- desc->descriptor_tag, descriptor_name (desc->descriptor_tag));
+ g_printf ("%*s [descriptor 0x%02x (%s) length:%d]\n", spacing, "",
+ desc->descriptor_tag, descriptor_name (desc->descriptor_tag),
+ desc->descriptor_length);
switch (desc->descriptor_tag) {
+ case GST_MTS_DESC_REGISTRATION:
+ {
+ const guint8 *data = desc->descriptor_data + 2;
+#define SAFE_CHAR(a) (g_ascii_isalnum(a) ? a : '.')
+ g_printf ("%*s Registration : %c%c%c%c\n", spacing, "",
+ SAFE_CHAR (data[0]), SAFE_CHAR (data[1]),
+ SAFE_CHAR (data[2]), SAFE_CHAR (data[3]));
+
+ break;
+ }
case GST_MTS_DESC_DVB_NETWORK_NAME:
{
gchar *network_name;