tracers: log: Log buffer-chain

Commit de30de865c added a hook for pad-chain-{pre,post} and
pad-chain-list-{pre,post}. As explained in that commit, hooking the
chain is helpful because it allows you to hook to buffer propagation in
both srcpads (pad-push) and sinkpads (pad-chain).

This patch uses the new hooks to log pad-chain in the log tracer.
Before, only pad-push was logged, so you could only follow the flow of
buffers through the srcpads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8329>
This commit is contained in:
Alicia Boya García 2025-01-20 18:48:11 +01:00 committed by GStreamer Marge Bot
parent 4bd7e194f6
commit e8ef562d01

View file

@ -51,9 +51,11 @@
*
* * `GST_DEBUG=GST_BUFFER:TRACE`
* * `pad-push-pre`, `pad-push-post`
* * `pad-chain-pre`, `pad-chain-post`
* * `pad-pull-range-pre`, `pad-pull-range-post`
* * `GST_DEBUG=GST_BUFFER_LIST:TRACE`
* * `pad-push-list-pre`, `pad-push-list-post`
* * `pad-chain-list-pre`, `pad-chain-list-post`
* * `GST_DEBUG=GST_EVENT:TRACE`
* * `pad-push-event-pre`, `pad-push-event-post`
* * `GST_DEBUG=GST_QUERY:TRACE`
@ -188,6 +190,42 @@ do_push_buffer_list_post (GstTracer * self, guint64 ts, GstPad * pad,
GST_TIME_ARGS (ts), pad, res);
}
static void
do_chain_buffer_pre (GstTracer * self, guint64 ts, GstPad * pad,
GstFlowReturn res)
{
do_log (GST_CAT_BUFFER, GST_FUNCTION, (GObject *) pad,
"%" GST_TIME_FORMAT ", pad=%" GST_PTR_FORMAT ", res=%d",
GST_TIME_ARGS (ts), pad, res);
}
static void
do_chain_buffer_post (GstTracer * self, guint64 ts, GstPad * pad,
GstFlowReturn res)
{
do_log (GST_CAT_BUFFER, GST_FUNCTION, (GObject *) pad,
"%" GST_TIME_FORMAT ", pad=%" GST_PTR_FORMAT ", res=%d",
GST_TIME_ARGS (ts), pad, res);
}
static void
do_chain_buffer_list_pre (GstTracer * self, guint64 ts, GstPad * pad,
GstFlowReturn res)
{
do_log (GST_CAT_BUFFER_LIST, GST_FUNCTION, (GObject *) pad,
"%" GST_TIME_FORMAT ", pad=%" GST_PTR_FORMAT ", res=%d",
GST_TIME_ARGS (ts), pad, res);
}
static void
do_chain_buffer_list_post (GstTracer * self, guint64 ts, GstPad * pad,
GstFlowReturn res)
{
do_log (GST_CAT_BUFFER_LIST, GST_FUNCTION, (GObject *) pad,
"%" GST_TIME_FORMAT ", pad=%" GST_PTR_FORMAT ", res=%d",
GST_TIME_ARGS (ts), pad, res);
}
static void
do_pull_range_pre (GstTracer * self, guint64 ts, GstPad * pad, guint64 offset,
guint size)
@ -437,6 +475,14 @@ gst_log_tracer_init (GstLogTracer * self)
G_CALLBACK (do_push_buffer_list_pre));
gst_tracing_register_hook (tracer, "pad-push-list-post",
G_CALLBACK (do_push_buffer_list_post));
gst_tracing_register_hook (tracer, "pad-chain-pre",
G_CALLBACK (do_chain_buffer_pre));
gst_tracing_register_hook (tracer, "pad-chain-post",
G_CALLBACK (do_chain_buffer_post));
gst_tracing_register_hook (tracer, "pad-chain-list-pre",
G_CALLBACK (do_chain_buffer_list_pre));
gst_tracing_register_hook (tracer, "pad-chain-list-post",
G_CALLBACK (do_chain_buffer_list_post));
gst_tracing_register_hook (tracer, "pad-pull-range-pre",
G_CALLBACK (do_pull_range_pre));
gst_tracing_register_hook (tracer, "pad-pull-range-post",