From: Tim-Philipp Müller Date: Wed, 23 Mar 2016 10:31:46 +0000 (+0000) Subject: alloctrace: print size and allocator details for buffers and memories X-Git-Tag: 1.10.4~327 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a35dfb1b16f1768ae31b88e4252e7950db340dd9;p=platform%2Fupstream%2Fgstreamer.git alloctrace: print size and allocator details for buffers and memories --- diff --git a/gst/gsttrace.c b/gst/gsttrace.c index 7cb0a3d..21ce0a7 100644 --- a/gst/gsttrace.c +++ b/gst/gsttrace.c @@ -179,6 +179,15 @@ gst_alloc_trace_print (const GstAllocTrace * trace) extra = g_strdup_printf ("%s", GST_MESSAGE_TYPE_NAME (data)); else extra = gst_structure_to_string (s); + } else if (type == GST_TYPE_BUFFER) { + guint size = gst_buffer_get_size (data); + + extra = g_strdup_printf ("%u bytes", size); + } else if (type == GST_TYPE_MEMORY) { + GstMemory *mem = (GstMemory *) data; + + extra = g_strdup_printf ("%u bytes, %s allocator", (guint) mem->size, + mem->allocator ? mem->allocator->mem_type : "unknown"); } refcount = GST_MINI_OBJECT_REFCOUNT_VALUE (data); }