tools/gst-launch.c: Print something more intelligible for image tags when using the -t switch (#341556).

Original commit message from CVS:
* tools/gst-launch.c: (print_tag):
Print something more intelligible for image tags when
using the -t switch (#341556).
This commit is contained in:
Tim-Philipp Müller 2006-05-12 16:50:37 +00:00
parent 34eabc4eaa
commit aa0515d436
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-05-12 Tim-Philipp Müller <tim at centricular dot net>
* tools/gst-launch.c: (print_tag):
Print something more intelligible for image tags when
using the -t switch (#341556).
2006-05-12 Thomas Vander Stichele <thomas at apestaart dot org> 2006-05-12 Thomas Vander Stichele <thomas at apestaart dot org>
* Makefile.am: * Makefile.am:

View file

@ -245,6 +245,19 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
if (gst_tag_get_type (tag) == G_TYPE_STRING) { if (gst_tag_get_type (tag) == G_TYPE_STRING) {
if (!gst_tag_list_get_string_index (list, tag, i, &str)) if (!gst_tag_list_get_string_index (list, tag, i, &str))
g_assert_not_reached (); g_assert_not_reached ();
} else if (gst_tag_get_type (tag) == GST_TYPE_BUFFER) {
GstBuffer *img;
img = gst_value_get_buffer (gst_tag_list_get_value_index (list, tag, i));
if (img) {
gchar *caps_str;
caps_str = GST_BUFFER_CAPS (img) ?
gst_caps_to_string (GST_BUFFER_CAPS (img)) : g_strdup ("unknown");
str = g_strdup_printf ("buffer of %u bytes, type: %s",
GST_BUFFER_SIZE (img), caps_str);
g_free (caps_str);
}
} else { } else {
str = str =
g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i)); g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i));