From: Edward Hervey Date: Sun, 19 Dec 2010 12:22:23 +0000 (+0100) Subject: gst-discoverer: show global tags by default X-Git-Tag: 1.19.3~511^2~6555^2~1306 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c84beebb253fee89e3bd76dd0d97c7eeadbc97d;p=platform%2Fupstream%2Fgstreamer.git gst-discoverer: show global tags by default --- diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c index bff1b79..2182c0f 100644 --- a/tools/gst-discoverer.c +++ b/tools/gst-discoverer.c @@ -204,9 +204,6 @@ print_stream_info (GstDiscovererStreamInfo * info, void *depth) desc = gst_stream_video_information_to_string (info, GPOINTER_TO_INT (depth) + 1); - } - - if (desc) { g_print ("%s", desc); g_free (desc); } @@ -240,13 +237,35 @@ print_topology (GstDiscovererStreamInfo * info, gint depth) } } +static gboolean +print_tag_each (GQuark field_id, const GValue * value, gpointer user_data) +{ + gint tab = GPOINTER_TO_INT (user_data); + gchar *ser; + + ser = gst_value_serialize (value); + + g_print ("%*s%s: %s\n", tab, " ", + gst_tag_get_nick (g_quark_to_string (field_id)), ser); + g_free (ser); + + return TRUE; +} + static void print_properties (GstDiscovererInfo * info, gint tab) { + const GstTagList *tags; + g_print ("%*sDuration: %" GST_TIME_FORMAT "\n", tab + 1, " ", GST_TIME_ARGS (gst_discoverer_info_get_duration (info))); g_print ("%*sSeekable: %s\n", tab + 1, " ", (gst_discoverer_info_get_seekable (info) ? "yes" : "no")); + if ((tags = gst_discoverer_info_get_tags (info))) { + g_print ("%*sTags: \n", tab + 1, " "); + gst_structure_foreach ((const GstStructure *) tags, print_tag_each, + GINT_TO_POINTER (tab + 5)); + } } static void