[0.11] gstreamer: trace: print caps in dump

Wim Taymans wtay at kemper.freedesktop.org
Thu Feb 2 08:06:59 PST 2012


Module: gstreamer
Branch: 0.11
Commit: da793d7255c8ee5c2f08356ad256cd35410f1715
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=da793d7255c8ee5c2f08356ad256cd35410f1715

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Feb  2 16:59:12 2012 +0100

trace: print caps in dump

---

 gst/gsttrace.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/gst/gsttrace.c b/gst/gsttrace.c
index f6e50e0..3c837a7 100644
--- a/gst/gsttrace.c
+++ b/gst/gsttrace.c
@@ -167,6 +167,7 @@ gst_alloc_trace_print (const GstAllocTrace * trace)
     while (mem_live) {
       gpointer data = mem_live->data;
       const gchar *type_name;
+      gchar *extra = NULL;
 
       if (trace->offset == -2) {
         if (G_IS_OBJECT (data))
@@ -180,9 +181,16 @@ gst_alloc_trace_print (const GstAllocTrace * trace)
 
         type = G_STRUCT_MEMBER (GType, data, trace->offset);
         type_name = g_type_name (type);
+
+        if (type == GST_TYPE_CAPS)
+          extra = gst_caps_to_string (data);
       }
 
-      g_print ("  %-20.20s : %p\n", type_name, data);
+      if (extra) {
+        g_print ("  %-20.20s : %p (\"%s\")\n", type_name, data, extra);
+        g_free (extra);
+      } else
+        g_print ("  %-20.20s : %p\n", type_name, data);
 
       mem_live = mem_live->next;
     }



More information about the gstreamer-commits mailing list