mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
tracer: switch to quarks and add another hook for buffer flow
Use pre-defines quarks as this will be called quite often.
This commit is contained in:
parent
68b1473846
commit
764b5833b9
5 changed files with 67 additions and 10 deletions
21
gst/gstpad.c
21
gst/gstpad.c
|
@ -4498,8 +4498,29 @@ __gst_pad_push (GstPad * pad, GstBuffer * buffer)
|
|||
*
|
||||
* MT safe.
|
||||
*/
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
static inline GstFlowReturn __gst_pad_push_list (GstPad * pad,
|
||||
GstBufferList * list);
|
||||
#endif
|
||||
|
||||
GstFlowReturn
|
||||
gst_pad_push_list (GstPad * pad, GstBufferList * list)
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
{
|
||||
const gboolean trace = gst_tracer_is_enabled (GST_TRACER_HOOK_ID_BUFFERS);
|
||||
GstFlowReturn res;
|
||||
|
||||
if (trace)
|
||||
gst_tracer_push_buffer_list_pre (pad, list);
|
||||
res = __gst_pad_push_list (pad, list);
|
||||
if (trace)
|
||||
gst_tracer_push_buffer_list_post (pad, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static inline GstFlowReturn
|
||||
__gst_pad_push_list (GstPad * pad, GstBufferList * list)
|
||||
#endif
|
||||
{
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
|
||||
g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
|
||||
|
|
|
@ -70,7 +70,9 @@ static const gchar *_quark_strings[] = {
|
|||
"GstMessageNeedContext", "GstMessageHaveContext", "context", "context-type",
|
||||
"GstMessageStreamStart", "group-id", "uri-redirection",
|
||||
"GstMessageDeviceAdded", "GstMessageDeviceRemoved", "device",
|
||||
"uri-redirection-permanent"
|
||||
"uri-redirection-permanent",
|
||||
"push_buffer::pre", "push_buffer::post", "push_buffer_list::pre",
|
||||
"push_buffer_list::post", ".ts", "return", "pad", "buffer", "list"
|
||||
};
|
||||
|
||||
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||
|
|
|
@ -202,7 +202,16 @@ typedef enum _GstQuarkId
|
|||
GST_QUARK_MESSAGE_DEVICE_REMOVED = 171,
|
||||
GST_QUARK_DEVICE = 172,
|
||||
GST_QUARK_URI_REDIRECTION_PERMANENT = 173,
|
||||
GST_QUARK_MAX = 174
|
||||
GST_QUARK_PUSH_BUFFER_PRE = 174,
|
||||
GST_QUARK_PUSH_BUFFER_POST = 175,
|
||||
GST_QUARK_PUSH_BUFFER_LIST_PRE = 176,
|
||||
GST_QUARK_PUSH_BUFFER_LIST_POST = 177,
|
||||
GST_QUARK_DOT_TS = 178,
|
||||
GST_QUARK_RETURN = 179,
|
||||
GST_QUARK_PAD = 180,
|
||||
GST_QUARK_BUFFER = 181,
|
||||
GST_QUARK_LIST = 182,
|
||||
GST_QUARK_MAX = 183
|
||||
} GstQuarkId;
|
||||
|
||||
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "gst_private.h"
|
||||
#include "gstenumtypes.h"
|
||||
#include "gstquark.h"
|
||||
#include "gstregistry.h"
|
||||
#include "gsttracer.h"
|
||||
#include "gsttracerfactory.h"
|
||||
|
@ -295,19 +296,41 @@ dispatch (GstTracerHookId id, GstStructure * s)
|
|||
void
|
||||
gst_tracer_push_buffer_pre (GstPad * pad, GstBuffer * buffer)
|
||||
{
|
||||
// TODO(ensonic): gst_structure_new_id
|
||||
dispatch (GST_TRACER_HOOK_ID_BUFFERS, gst_structure_new ("push_buffer::pre",
|
||||
".ts", G_TYPE_UINT64, gst_util_get_timestamp (),
|
||||
"pad", GST_TYPE_PAD, pad, "buffer", GST_TYPE_BUFFER, buffer, NULL));
|
||||
dispatch (GST_TRACER_HOOK_ID_BUFFERS,
|
||||
gst_structure_new_id (GST_QUARK (PUSH_BUFFER_PRE),
|
||||
GST_QUARK (DOT_TS), G_TYPE_UINT64, gst_util_get_timestamp (),
|
||||
GST_QUARK (PAD), GST_TYPE_PAD, pad,
|
||||
GST_QUARK (BUFFER), GST_TYPE_BUFFER, buffer, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
gst_tracer_push_buffer_post (GstPad * pad, GstFlowReturn res)
|
||||
{
|
||||
// TODO(ensonic): gst_structure_new_id
|
||||
dispatch (GST_TRACER_HOOK_ID_BUFFERS, gst_structure_new ("push_buffer::post",
|
||||
".ts", G_TYPE_UINT64, gst_util_get_timestamp (),
|
||||
"pad", GST_TYPE_PAD, pad, "return", G_TYPE_INT, res, NULL));
|
||||
dispatch (GST_TRACER_HOOK_ID_BUFFERS,
|
||||
gst_structure_new_id (GST_QUARK (PUSH_BUFFER_POST),
|
||||
GST_QUARK (DOT_TS), G_TYPE_UINT64, gst_util_get_timestamp (),
|
||||
GST_QUARK (PAD), GST_TYPE_PAD, pad,
|
||||
GST_QUARK (RETURN), G_TYPE_INT, res, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
gst_tracer_push_buffer_list_pre (GstPad * pad, GstBufferList * list)
|
||||
{
|
||||
dispatch (GST_TRACER_HOOK_ID_BUFFERS,
|
||||
gst_structure_new_id (GST_QUARK (PUSH_BUFFER_LIST_PRE),
|
||||
GST_QUARK (DOT_TS), G_TYPE_UINT64, gst_util_get_timestamp (),
|
||||
GST_QUARK (PAD), GST_TYPE_PAD, pad,
|
||||
GST_QUARK (LIST), GST_TYPE_BUFFER_LIST, list, NULL));
|
||||
}
|
||||
|
||||
void
|
||||
gst_tracer_push_buffer_list_post (GstPad * pad, GstFlowReturn res)
|
||||
{
|
||||
dispatch (GST_TRACER_HOOK_ID_BUFFERS,
|
||||
gst_structure_new_id (GST_QUARK (PUSH_BUFFER_LIST_POST),
|
||||
GST_QUARK (DOT_TS), G_TYPE_UINT64, gst_util_get_timestamp (),
|
||||
GST_QUARK (PAD), GST_TYPE_PAD, pad,
|
||||
GST_QUARK (RETURN), G_TYPE_INT, res, NULL));
|
||||
}
|
||||
|
||||
#endif /* GST_DISABLE_GST_DEBUG */
|
||||
|
|
|
@ -106,6 +106,8 @@ gboolean gst_tracer_is_enabled (GstTracerHookId id);
|
|||
void gst_tracer_push_buffer_pre (GstPad *pad, GstBuffer *buffer);
|
||||
void gst_tracer_push_buffer_post (GstPad *pad, GstFlowReturn res);
|
||||
|
||||
void gst_tracer_push_buffer_list_pre (GstPad * pad, GstBufferList * list);
|
||||
void gst_tracer_push_buffer_list_post (GstPad * pad, GstFlowReturn res);
|
||||
|
||||
#endif /* GST_DISABLE_GST_DEBUG */
|
||||
|
||||
|
|
Loading…
Reference in a new issue