examples: ts-parser: Add DVB teletext/subtitling
authorJesper Larsen <jesper.larsen@ixonos.com>
Tue, 19 Nov 2013 10:36:14 +0000 (11:36 +0100)
committerEdward Hervey <edward@collabora.com>
Sat, 15 Mar 2014 17:16:13 +0000 (18:16 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=721682

tests/examples/mpegts/ts-parser.c

index 2609e70..3fee8a4 100644 (file)
@@ -239,6 +239,44 @@ dump_descriptors (GPtrArray * descriptors, guint spacing)
         }
       }
         break;
+      case GST_MTS_DESC_DVB_SUBTITLING:
+      {
+        gchar lang[4];
+        guint8 type;
+        guint16 composition;
+        guint16 ancillary;
+        guint i;
+
+        for (i = 0;
+            gst_mpegts_descriptor_parse_dvb_subtitling_idx (desc, i, &lang,
+                &type, &composition, &ancillary); i++) {
+          g_printf ("%*s   Subtitling, language_code:%s\n", spacing, "", lang);
+          g_printf ("%*s      type                : %u\n", spacing, "", type);
+          g_printf ("%*s      composition page id : %u\n", spacing, "",
+              composition);
+          g_printf ("%*s      ancillary page id   : %u\n", spacing, "",
+              ancillary);
+        }
+      }
+        break;
+      case GST_MTS_DESC_DVB_TELETEXT:
+      {
+        GstMpegTsDVBTeletextType type;
+        gchar lang[4];
+        guint8 magazine, page_number;
+        guint i;
+
+        for (i = 0;
+            gst_mpegts_descriptor_parse_dvb_teletext_idx (desc, i, &lang, &type,
+                &magazine, &page_number); i++) {
+          g_printf ("%*s   Teletext, type:0x%02x (%s)\n", spacing, "", type,
+              enum_name (GST_TYPE_MPEG_TS_DVB_TELETEXT_TYPE, type));
+          g_printf ("%*s      language    : %s\n", spacing, "", lang);
+          g_printf ("%*s      magazine    : %u\n", spacing, "", magazine);
+          g_printf ("%*s      page number : %u\n", spacing, "", page_number);
+        }
+      }
+        break;
       default:
         break;
     }
@@ -527,6 +565,7 @@ main (int argc, gchar ** argv)
   g_type_class_ref (GST_TYPE_MPEG_TS_MISC_DESCRIPTOR_TYPE);
   g_type_class_ref (GST_TYPE_MPEG_TS_ISO639_AUDIO_TYPE);
   g_type_class_ref (GST_TYPE_MPEG_TS_DVB_SERVICE_TYPE);
+  g_type_class_ref (GST_TYPE_MPEG_TS_DVB_TELETEXT_TYPE);
   g_type_class_ref (GST_TYPE_MPEG_TS_STREAM_TYPE);
 
   mainloop = g_main_loop_new (NULL, FALSE);