seek: print tags from the different tracks
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 24 Mar 2009 14:26:57 +0000 (15:26 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 24 Mar 2009 14:26:57 +0000 (15:26 +0100)
tests/examples/seek/seek.c

index 2eddc151c10d0bcdbfb66830af519b04c3d4aad8..e24fe575138e0674dd1c00f4320332fc9ea6c2ec 100644 (file)
@@ -1729,7 +1729,7 @@ update_streams (GstPipeline * pipeline)
 
   if (pipeline_type == 16 && need_streams) {
     GstTagList *tags;
-    gchar *name;
+    gchar *name, *str;
     gint active_idx;
     gboolean state;
 
@@ -1746,6 +1746,11 @@ update_streams (GstPipeline * pipeline)
     active_idx = 0;
     for (i = 0; i < n_video; i++) {
       g_signal_emit_by_name (pipeline, "get-video-tags", i, &tags);
+      if (tags) {
+        str = gst_structure_to_string ((GstStructure *) tags);
+        g_print ("video %d: %s\n", i, str);
+        g_free (str);
+      }
       /* find good name for the label */
       name = g_strdup_printf ("video %d", i + 1);
       gtk_combo_box_append_text (GTK_COMBO_BOX (video_combo), name);
@@ -1758,6 +1763,11 @@ update_streams (GstPipeline * pipeline)
     active_idx = 0;
     for (i = 0; i < n_audio; i++) {
       g_signal_emit_by_name (pipeline, "get-audio-tags", i, &tags);
+      if (tags) {
+        str = gst_structure_to_string ((GstStructure *) tags);
+        g_print ("audio %d: %s\n", i, str);
+        g_free (str);
+      }
       /* find good name for the label */
       name = g_strdup_printf ("audio %d", i + 1);
       gtk_combo_box_append_text (GTK_COMBO_BOX (audio_combo), name);
@@ -1770,10 +1780,15 @@ update_streams (GstPipeline * pipeline)
     active_idx = 0;
     for (i = 0; i < n_text; i++) {
       g_signal_emit_by_name (pipeline, "get-text-tags", i, &tags);
+
       name = NULL;
       if (tags) {
         const GValue *value;
 
+        str = gst_structure_to_string ((GstStructure *) tags);
+        g_print ("text %d: %s\n", i, str);
+        g_free (str);
+
         /* get the language code if we can */
         value = gst_tag_list_get_value_index (tags, GST_TAG_LANGUAGE_CODE, 0);
         if (value && G_VALUE_HOLDS_STRING (value)) {