my_g_string_append_printf (s, depth, "Tags:\n");
tags = gst_discoverer_stream_info_get_tags (info);
if (tags) {
- tmp = gst_structure_to_string ((GstStructure *) tags);
+ tmp = gst_tag_list_to_string (tags);
my_g_string_append_printf (s, depth, " %s\n", tmp);
g_free (tmp);
} else {
my_g_string_append_printf (s, depth, "Tags:\n");
tags = gst_discoverer_stream_info_get_tags (info);
if (tags) {
- tmp = gst_structure_to_string ((GstStructure *) tags);
+ tmp = gst_tag_list_to_string (tags);
my_g_string_append_printf (s, depth, " %s\n", tmp);
g_free (tmp);
} else {
my_g_string_append_printf (s, depth, "Tags:\n");
tags = gst_discoverer_stream_info_get_tags (info);
if (tags) {
- tmp = gst_structure_to_string ((GstStructure *) tags);
+ tmp = gst_tag_list_to_string (tags);
my_g_string_append_printf (s, depth, " %s\n", tmp);
g_free (tmp);
} else {
}
}
-static gboolean
-print_tag_each (GQuark field_id, const GValue * value, gpointer user_data)
+static void
+print_tag (const gchar * tag_name, const GValue * value, gint tab)
{
- gint tab = GPOINTER_TO_INT (user_data);
gchar *ser;
if (G_VALUE_HOLDS_STRING (value))
} else
ser = gst_value_serialize (value);
- g_print ("%*s%s: %s\n", tab, " ",
- gst_tag_get_nick (g_quark_to_string (field_id)), ser);
+ g_print ("%*s%s: %s\n", tab, " ", gst_tag_get_nick (tag_name), ser);
g_free (ser);
-
- return TRUE;
}
+/* FIXME: this function is almost identical to print_tag() */
static void
print_tag_foreach (const GstTagList * tags, const gchar * tag,
gpointer user_data)
g_print ("%*sSeekable: %s\n", tab + 1, " ",
(gst_discoverer_info_get_seekable (info) ? "yes" : "no"));
if ((tags = gst_discoverer_info_get_tags (info))) {
+ guint num_tags, i;
+
g_print ("%*sTags: \n", tab + 1, " ");
- gst_structure_foreach ((const GstStructure *) tags, print_tag_each,
- GINT_TO_POINTER (tab + 5));
+ num_tags = gst_tag_list_n_tags (tags);
+ for (i = 0; i < num_tags; ++i) {
+ const GValue *val;
+ const gchar *tag_name;
+
+ tag_name = gst_tag_list_nth_tag_name (tags, i);
+ /* FIXME: print all entries for a tag if there are multiple ones */
+ val = gst_tag_list_get_value_index (tags, tag_name, 0);
+ print_tag (tag_name, val, tab + 5);
+ }
}
if (show_toc && (toc = gst_discoverer_info_get_toc (info))) {
g_print ("%*sTOC: \n", tab + 1, " ");