mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
tracer: harmonize the query hooks
In post hooks always pass the return value as the last param. Pass the query also to post hooks since it is still alive.
This commit is contained in:
parent
fb249dadcb
commit
2f41e7bc6a
5 changed files with 38 additions and 19 deletions
|
@ -1677,7 +1677,7 @@ gst_element_query (GstElement * element, GstQuery * query)
|
|||
res = klass->query (element, query);
|
||||
}
|
||||
|
||||
GST_TRACER_ELEMENT_QUERY_POST (element, res);
|
||||
GST_TRACER_ELEMENT_QUERY_POST (element, query, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -3903,7 +3903,7 @@ gst_pad_query (GstPad * pad, GstQuery * query)
|
|||
|
||||
GST_DEBUG_OBJECT (pad, "sent query %p (%s), result %d", query,
|
||||
GST_QUERY_TYPE_NAME (query), res);
|
||||
GST_TRACER_PAD_QUERY_POST (pad, res, query);
|
||||
GST_TRACER_PAD_QUERY_POST (pad, query, res);
|
||||
|
||||
if (res != TRUE)
|
||||
goto query_failed;
|
||||
|
|
|
@ -266,16 +266,16 @@ typedef void (*GstTracerHookPadQueryPre) (GObject *self, GstClockTime ts,
|
|||
* @self: the tracer instance
|
||||
* @ts: the current timestamp
|
||||
* @pad: the pad
|
||||
* @res: the result of gst_pad_query()
|
||||
* @query: the query
|
||||
* @res: the result of gst_pad_query()
|
||||
*
|
||||
* Post-hook for gst_pad_query() named "pad-query-post".
|
||||
*/
|
||||
typedef void (*GstTracerHookPadQueryPost) (GObject *self, GstClockTime ts,
|
||||
GstPad *pad, gboolean res, GstQuery *query);
|
||||
#define GST_TRACER_PAD_QUERY_POST(pad, res, query) G_STMT_START{ \
|
||||
GstPad *pad, GstQuery *query, gboolean res);
|
||||
#define GST_TRACER_PAD_QUERY_POST(pad, query, res) G_STMT_START{ \
|
||||
GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_QUERY_POST), \
|
||||
GstTracerHookPadQueryPost, (GST_TRACER_ARGS, pad, res, query)); \
|
||||
GstTracerHookPadQueryPost, (GST_TRACER_ARGS, pad, query, res)); \
|
||||
}G_STMT_END
|
||||
|
||||
/**
|
||||
|
@ -331,15 +331,16 @@ typedef void (*GstTracerHookElementQueryPre) (GObject *self, GstClockTime ts,
|
|||
* @self: the tracer instance
|
||||
* @ts: the current timestamp
|
||||
* @element: the element
|
||||
* @query: the query
|
||||
* @res: the result of gst_element_query()
|
||||
*
|
||||
* Post-hook for gst_element_query() named "element-query-post".
|
||||
*/
|
||||
typedef void (*GstTracerHookElementQueryPost) (GObject *self, GstClockTime ts,
|
||||
GstElement *element, gboolean res);
|
||||
#define GST_TRACER_ELEMENT_QUERY_POST(element, res) G_STMT_START{ \
|
||||
GstElement *element, GstQuery *query, gboolean res);
|
||||
#define GST_TRACER_ELEMENT_QUERY_POST(element, query, res) G_STMT_START{ \
|
||||
GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_QUERY_POST), \
|
||||
GstTracerHookElementQueryPost, (GST_TRACER_ARGS, element, res)); \
|
||||
GstTracerHookElementQueryPost, (GST_TRACER_ARGS, element, query, res)); \
|
||||
}G_STMT_END
|
||||
|
||||
/**
|
||||
|
@ -565,11 +566,11 @@ typedef void (*GstTracerHookPadUnlinkPost) (GObject *self, GstClockTime ts,
|
|||
#define GST_TRACER_PAD_PUSH_EVENT_PRE(pad, event)
|
||||
#define GST_TRACER_PAD_PUSH_EVENT_POST(pad, res)
|
||||
#define GST_TRACER_PAD_QUERY_PRE(pad, query)
|
||||
#define GST_TRACER_PAD_QUERY_POST(pad, res, query)
|
||||
#define GST_TRACER_PAD_QUERY_POST(pad, query, res)
|
||||
#define GST_TRACER_ELEMENT_POST_MESSAGE_PRE(element, message)
|
||||
#define GST_TRACER_ELEMENT_POST_MESSAGE_POST(element, res)
|
||||
#define GST_TRACER_ELEMENT_QUERY_PRE(element, query)
|
||||
#define GST_TRACER_ELEMENT_QUERY_POST(element, res)
|
||||
#define GST_TRACER_ELEMENT_QUERY_POST(element, query, res)
|
||||
#define GST_TRACER_ELEMENT_NEW(element)
|
||||
#define GST_TRACER_ELEMENT_ADD_PAD(element, pad)
|
||||
#define GST_TRACER_ELEMENT_REMOVE_PAD(element, pad)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* SECTION:gstlog
|
||||
* @short_description: log hook event
|
||||
*
|
||||
* A tracing module that logs all data from all hooks.
|
||||
* A tracing module that logs all data from all hooks.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -142,6 +142,22 @@ do_push_event_post (GstTracer * self, guint64 ts, GstPad * pad, gboolean res)
|
|||
GST_TIME_ARGS (ts), pad, res);
|
||||
}
|
||||
|
||||
static void
|
||||
do_pad_query_pre (GstTracer * self, guint64 ts, GstPad * pad, GstQuery * query)
|
||||
{
|
||||
do_log (GST_CAT_QUERY,
|
||||
"%" GST_TIME_FORMAT ", pad=%" GST_PTR_FORMAT ", query=%"
|
||||
GST_PTR_FORMAT, GST_TIME_ARGS (ts), pad, query);
|
||||
}
|
||||
|
||||
static void
|
||||
do_pad_query_post (GstTracer * self, guint64 ts, GstPad * pad, gboolean res)
|
||||
{
|
||||
do_log (GST_CAT_QUERY,
|
||||
"%" GST_TIME_FORMAT ", pad=%" GST_PTR_FORMAT ", res=%d",
|
||||
GST_TIME_ARGS (ts), pad, res);
|
||||
}
|
||||
|
||||
static void
|
||||
do_post_message_pre (GstTracer * self, guint64 ts, GstElement * elem,
|
||||
GstMessage * msg)
|
||||
|
@ -161,7 +177,8 @@ do_post_message_post (GstTracer * self, guint64 ts, GstElement * elem,
|
|||
}
|
||||
|
||||
static void
|
||||
do_query_pre (GstTracer * self, guint64 ts, GstElement * elem, GstQuery * query)
|
||||
do_element_query_pre (GstTracer * self, guint64 ts, GstElement * elem,
|
||||
GstQuery * query)
|
||||
{
|
||||
do_log (GST_CAT_QUERY,
|
||||
"%" GST_TIME_FORMAT ", element=%" GST_PTR_FORMAT ", query=%"
|
||||
|
@ -169,7 +186,8 @@ do_query_pre (GstTracer * self, guint64 ts, GstElement * elem, GstQuery * query)
|
|||
}
|
||||
|
||||
static void
|
||||
do_query_post (GstTracer * self, guint64 ts, GstElement * elem, gboolean res)
|
||||
do_element_query_post (GstTracer * self, guint64 ts, GstElement * elem,
|
||||
gboolean res)
|
||||
{
|
||||
do_log (GST_CAT_QUERY,
|
||||
"%" GST_TIME_FORMAT ", element=%" GST_PTR_FORMAT ", res=%d",
|
||||
|
@ -318,17 +336,17 @@ gst_log_tracer_init (GstLogTracer * self)
|
|||
gst_tracing_register_hook (tracer, "pad-push-event-post",
|
||||
G_CALLBACK (do_push_event_post));
|
||||
gst_tracing_register_hook (tracer, "pad-query-pre",
|
||||
G_CALLBACK (do_query_pre));
|
||||
G_CALLBACK (do_pad_query_pre));
|
||||
gst_tracing_register_hook (tracer, "pad-query-post",
|
||||
G_CALLBACK (do_query_post));
|
||||
G_CALLBACK (do_pad_query_post));
|
||||
gst_tracing_register_hook (tracer, "element-post-message-pre",
|
||||
G_CALLBACK (do_post_message_pre));
|
||||
gst_tracing_register_hook (tracer, "element-post-message-post",
|
||||
G_CALLBACK (do_post_message_post));
|
||||
gst_tracing_register_hook (tracer, "element-query-pre",
|
||||
G_CALLBACK (do_query_pre));
|
||||
G_CALLBACK (do_element_query_pre));
|
||||
gst_tracing_register_hook (tracer, "element-query-post",
|
||||
G_CALLBACK (do_query_post));
|
||||
G_CALLBACK (do_element_query_post));
|
||||
gst_tracing_register_hook (tracer, "element-new",
|
||||
G_CALLBACK (do_element_new));
|
||||
gst_tracing_register_hook (tracer, "element-add-pad",
|
||||
|
|
|
@ -539,7 +539,7 @@ do_query_pre (GstStatsTracer * self, guint64 ts, GstPad * this_pad,
|
|||
|
||||
static void
|
||||
do_query_post (GstStatsTracer * self, guint64 ts, GstPad * this_pad,
|
||||
gboolean res, GstQuery * qry)
|
||||
GstQuery * qry, gboolean res)
|
||||
{
|
||||
GstPadStats *this_pad_stats = get_pad_stats (self, this_pad);
|
||||
GstPad *that_pad = GST_PAD_PEER (this_pad);
|
||||
|
|
Loading…
Reference in a new issue