From 61fbbfc278f027cb7d801aac4299ff7b9e69008c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 11 Jan 2004 22:39:00 +0000 Subject: [PATCH] tools/gst-inspect.c: improve output of caps a bit Original commit message from CVS: 2004-01-11 Benjamin Otte * tools/gst-inspect.c: (print_caps): improve output of caps a bit --- ChangeLog | 5 +++++ tools/gst-inspect.c | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 134a8fd811..c4f5f4586d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-11 Benjamin Otte + + * tools/gst-inspect.c: (print_caps): + improve output of caps a bit + 2004-01-11 David Schleef * gst/gstbuffer.c: (gst_buffer_create_sub): Subbuffers should diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 11c54aed51..13bf257721 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -9,9 +9,25 @@ static void print_caps (const GstCaps *caps, const gchar *pfx) { - char *s; + char *s, *tmp; + char **v; s = gst_caps_to_string (caps); + + tmp = g_strdup_printf ("\n %s", pfx); + v = g_strsplit (s, ", ", -1); + g_free (s); + s = g_strjoinv (tmp, v); + g_strfreev (v); + g_free (tmp); + + tmp = g_strdup_printf ("\n%s", pfx); + v = g_strsplit (s, "; ", -1); + g_free (s); + s = g_strjoinv (tmp, v); + g_free (tmp); + g_strfreev (v); + g_print ("%s%s\n", pfx, s); g_free(s); }