mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
GST_PTR_FORMAT: Add GstBuffer ptr format and use in GST_SCHEDULING
GstBuffer pointers can now be printed using GST_PTR_FORMAT. This is used in the very useful GST_SCHEDULING debug logs in gstpad.c and allows for easier and more information tracking of buffer progress through a pipeline with just debug logging.
This commit is contained in:
parent
49bd7b40ca
commit
138bb17bf9
2 changed files with 21 additions and 8 deletions
|
@ -632,6 +632,23 @@ gst_debug_print_object (gpointer ptr)
|
|||
if (*(GType *) ptr == GST_TYPE_STRUCTURE) {
|
||||
return gst_info_structure_to_string ((GstStructure *) ptr);
|
||||
}
|
||||
if (GST_IS_BUFFER (ptr)) {
|
||||
GstBuffer *buf = (GstBuffer *) ptr;
|
||||
gchar *caps, *ret;
|
||||
|
||||
caps = gst_caps_to_string (GST_BUFFER_CAPS (buf));
|
||||
ret =
|
||||
g_strdup_printf ("%p, data %p, malloc %p, ts %" GST_TIME_FORMAT
|
||||
", dur %" GST_TIME_FORMAT ", size %u, offset %" G_GUINT64_FORMAT
|
||||
", offset_end %" G_GUINT64_FORMAT ", caps: %s", buf,
|
||||
GST_BUFFER_DATA (buf), GST_BUFFER_MALLOCDATA (buf),
|
||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
|
||||
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_BUFFER_SIZE (buf),
|
||||
GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf), caps);
|
||||
|
||||
g_free (caps);
|
||||
return ret;
|
||||
}
|
||||
#ifdef USE_POISONING
|
||||
if (*(guint32 *) ptr == 0xffffffff) {
|
||||
return g_strdup_printf ("<poisoned@%p>", ptr);
|
||||
|
|
12
gst/gstpad.c
12
gst/gstpad.c
|
@ -4258,10 +4258,8 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data,
|
|||
goto no_function;
|
||||
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"calling chainfunction &%s with %s buffer %p, ts %" GST_TIME_FORMAT,
|
||||
GST_DEBUG_FUNCPTR_NAME (chainfunc),
|
||||
(caps) ? gst_structure_get_name (gst_caps_get_structure (caps, 0)) : "",
|
||||
GST_BUFFER (data), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (data)));
|
||||
"calling chainfunction &%s with buffer %" GST_PTR_FORMAT,
|
||||
GST_DEBUG_FUNCPTR_NAME (chainfunc), GST_BUFFER (data));
|
||||
|
||||
if (cache) {
|
||||
cache->peer = gst_object_ref (pad);
|
||||
|
@ -4704,10 +4702,8 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer)
|
|||
goto invalid;
|
||||
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"calling chainfunction &%s with %s buffer %p, ts %" GST_TIME_FORMAT,
|
||||
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)),
|
||||
(caps) ? gst_structure_get_name (gst_caps_get_structure (caps, 0)) : "",
|
||||
GST_BUFFER (buffer), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
|
||||
"calling chainfunction &%s with buffer %" GST_PTR_FORMAT,
|
||||
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)), buffer);
|
||||
|
||||
ret = GST_PAD_CHAINFUNC (peer) (peer, buffer);
|
||||
|
||||
|
|
Loading…
Reference in a new issue