2 * Copyright (C) 2013 Stefan Sauer <ensonic@users.sf.net>
4 * gsttracerutils.h: tracing subsystem
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef __GST_TRACER_UTILS_H__
24 #define __GST_TRACER_UTILS_H__
27 #include <glib-object.h>
28 #include <gst/gstconfig.h>
29 #include <gst/gstbin.h>
30 #include <gst/gstutils.h>
34 #ifndef GST_DISABLE_GST_TRACER_HOOKS
38 void _priv_gst_tracing_init (void);
39 void _priv_gst_tracing_deinit (void);
43 /* These enums need to match the number and order
44 * of strings declared in _quark_table, in gsttracerutils.c */
45 typedef enum /*< skip >*/
47 GST_TRACER_QUARK_HOOK_PAD_PUSH_PRE = 0,
48 GST_TRACER_QUARK_HOOK_PAD_PUSH_POST,
49 GST_TRACER_QUARK_HOOK_PAD_PUSH_LIST_PRE,
50 GST_TRACER_QUARK_HOOK_PAD_PUSH_LIST_POST,
51 GST_TRACER_QUARK_HOOK_PAD_PULL_RANGE_PRE,
52 GST_TRACER_QUARK_HOOK_PAD_PULL_RANGE_POST,
53 GST_TRACER_QUARK_HOOK_PAD_PUSH_EVENT_PRE ,
54 GST_TRACER_QUARK_HOOK_PAD_PUSH_EVENT_POST,
55 GST_TRACER_QUARK_HOOK_PAD_QUERY_PRE ,
56 GST_TRACER_QUARK_HOOK_PAD_QUERY_POST,
57 GST_TRACER_QUARK_HOOK_ELEMENT_POST_MESSAGE_PRE,
58 GST_TRACER_QUARK_HOOK_ELEMENT_POST_MESSAGE_POST,
59 GST_TRACER_QUARK_HOOK_ELEMENT_QUERY_PRE,
60 GST_TRACER_QUARK_HOOK_ELEMENT_QUERY_POST,
61 GST_TRACER_QUARK_HOOK_ELEMENT_NEW,
62 GST_TRACER_QUARK_HOOK_ELEMENT_ADD_PAD,
63 GST_TRACER_QUARK_HOOK_ELEMENT_REMOVE_PAD,
64 GST_TRACER_QUARK_HOOK_BIN_ADD_PRE,
65 GST_TRACER_QUARK_HOOK_BIN_ADD_POST,
66 GST_TRACER_QUARK_HOOK_BIN_REMOVE_PRE,
67 GST_TRACER_QUARK_HOOK_BIN_REMOVE_POST,
68 GST_TRACER_QUARK_HOOK_PAD_LINK_PRE,
69 GST_TRACER_QUARK_HOOK_PAD_LINK_POST,
70 GST_TRACER_QUARK_HOOK_PAD_UNLINK_PRE,
71 GST_TRACER_QUARK_HOOK_PAD_UNLINK_POST,
72 GST_TRACER_QUARK_HOOK_ELEMENT_CHANGE_STATE_PRE,
73 GST_TRACER_QUARK_HOOK_ELEMENT_CHANGE_STATE_POST,
74 GST_TRACER_QUARK_HOOK_MINI_OBJECT_CREATED,
75 GST_TRACER_QUARK_HOOK_MINI_OBJECT_DESTROYED,
76 GST_TRACER_QUARK_HOOK_OBJECT_CREATED,
77 GST_TRACER_QUARK_HOOK_OBJECT_DESTROYED,
81 extern GQuark _priv_gst_tracer_quark_table[GST_TRACER_QUARK_MAX];
83 #define GST_TRACER_QUARK(q) _priv_gst_tracer_quark_table[GST_TRACER_QUARK_##q]
85 /* tracing module helpers */
92 extern gboolean _priv_tracer_enabled;
93 /* key are hook-id quarks, values are GstTracerHook */
94 extern GHashTable *_priv_tracers;
96 #define GST_TRACER_IS_ENABLED (_priv_tracer_enabled)
98 #define GST_TRACER_TS \
99 GST_CLOCK_DIFF (_priv_gst_start_time, gst_util_get_timestamp ())
103 #define GST_TRACER_ARGS h->tracer, ts
104 #define GST_TRACER_DISPATCH(key,type,args) G_STMT_START{ \
105 if (GST_TRACER_IS_ENABLED) { \
106 GstClockTime ts = GST_TRACER_TS; \
109 __l = g_hash_table_lookup (_priv_tracers, GINT_TO_POINTER (key)); \
110 for (__n = __l; __n; __n = g_list_next (__n)) { \
111 h = (GstTracerHook *) __n->data; \
112 ((type)(h->func)) args; \
114 __l = g_hash_table_lookup (_priv_tracers, NULL); \
115 for (__n = __l; __n; __n = g_list_next (__n)) { \
116 h = (GstTracerHook *) __n->data; \
117 ((type)(h->func)) args; \
123 * GstTracerHookPadPushPre:
124 * @self: the tracer instance
125 * @ts: the current timestamp
127 * @buffer: the buffer
129 * Pre-hook for gst_pad_push() named "pad-push-pre".
131 typedef void (*GstTracerHookPadPushPre) (GObject *self, GstClockTime ts,
132 GstPad *pad, GstBuffer *buffer);
133 #define GST_TRACER_PAD_PUSH_PRE(pad, buffer) G_STMT_START{ \
134 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PUSH_PRE), \
135 GstTracerHookPadPushPre, (GST_TRACER_ARGS, pad, buffer)); \
139 * GstTracerHookPadPushPost:
140 * @self: the tracer instance
141 * @ts: the current timestamp
143 * @res: the result of gst_pad_push()
145 * Post-hook for gst_pad_push() named "pad-push-post".
147 typedef void (*GstTracerHookPadPushPost) (GObject * self, GstClockTime ts,
148 GstPad *pad, GstFlowReturn res);
149 #define GST_TRACER_PAD_PUSH_POST(pad, res) G_STMT_START{ \
150 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PUSH_POST), \
151 GstTracerHookPadPushPost, (GST_TRACER_ARGS, pad, res)); \
155 * GstTracerHookPadPushListPre:
156 * @self: the tracer instance
157 * @ts: the current timestamp
159 * @list: the buffer-list
161 * Pre-hook for gst_pad_push_list() named "pad-push-list-pre".
163 typedef void (*GstTracerHookPadPushListPre) (GObject *self, GstClockTime ts,
164 GstPad *pad, GstBufferList *list);
165 #define GST_TRACER_PAD_PUSH_LIST_PRE(pad, list) G_STMT_START{ \
166 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PUSH_LIST_PRE), \
167 GstTracerHookPadPushListPre, (GST_TRACER_ARGS, pad, list)); \
171 * GstTracerHookPadPushListPost:
172 * @self: the tracer instance
173 * @ts: the current timestamp
175 * @res: the result of gst_pad_push_list()
177 * Post-hook for gst_pad_push_list() named "pad-push-list-post".
179 typedef void (*GstTracerHookPadPushListPost) (GObject *self, GstClockTime ts,
182 #define GST_TRACER_PAD_PUSH_LIST_POST(pad, res) G_STMT_START{ \
183 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PUSH_LIST_POST), \
184 GstTracerHookPadPushListPost, (GST_TRACER_ARGS, pad, res)); \
188 * GstTracerHookPadPullRangePre:
189 * @self: the tracer instance
190 * @ts: the current timestamp
192 * @offset: the stream offset
193 * @size: the requested size
195 * Pre-hook for gst_pad_pull_range() named "pad-pull-range-pre".
197 typedef void (*GstTracerHookPadPullRangePre) (GObject *self, GstClockTime ts,
198 GstPad *pad, guint64 offset, guint size);
199 #define GST_TRACER_PAD_PULL_RANGE_PRE(pad, offset, size) G_STMT_START{ \
200 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PULL_RANGE_PRE), \
201 GstTracerHookPadPullRangePre, (GST_TRACER_ARGS, pad, offset, size)); \
205 * GstTracerHookPadPullRangePost:
206 * @self: the tracer instance
207 * @ts: the current timestamp
209 * @buffer: the buffer
210 * @res: the result of gst_pad_pull_range()
212 * Post-hook for gst_pad_pull_range() named "pad-pull-range-post".
214 typedef void (*GstTracerHookPadPullRangePost) (GObject *self, GstClockTime ts,
215 GstPad *pad, GstBuffer *buffer, GstFlowReturn res);
216 #define GST_TRACER_PAD_PULL_RANGE_POST(pad, buffer, res) G_STMT_START{ \
217 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PULL_RANGE_POST), \
218 GstTracerHookPadPullRangePost, (GST_TRACER_ARGS, pad, buffer, res)); \
222 * GstTracerHookPadPushEventPre:
223 * @self: the tracer instance
224 * @ts: the current timestamp
228 * Pre-hook for gst_pad_push_event() named "pad-push-event-pre".
230 typedef void (*GstTracerHookPadPushEventPre) (GObject *self, GstClockTime ts,
231 GstPad *pad, GstEvent *event);
232 #define GST_TRACER_PAD_PUSH_EVENT_PRE(pad, event) G_STMT_START{ \
233 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PUSH_EVENT_PRE), \
234 GstTracerHookPadPushEventPre, (GST_TRACER_ARGS, pad, event)); \
238 * GstTracerHookPadPushEventPost:
239 * @self: the tracer instance
240 * @ts: the current timestamp
242 * @res: the result of gst_pad_push_event()
244 * Post-hook for gst_pad_push_event() named "pad-push-event-post".
246 typedef void (*GstTracerHookPadPushEventPost) (GObject *self, GstClockTime ts,
247 GstPad *pad, gboolean res);
248 #define GST_TRACER_PAD_PUSH_EVENT_POST(pad, res) G_STMT_START{ \
249 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_PUSH_EVENT_POST), \
250 GstTracerHookPadPushEventPost, (GST_TRACER_ARGS, pad, res)); \
254 * GstTracerHookPadQueryPre:
255 * @self: the tracer instance
256 * @ts: the current timestamp
260 * Pre-hook for gst_pad_query() named "pad-query-pre".
262 typedef void (*GstTracerHookPadQueryPre) (GObject *self, GstClockTime ts,
263 GstPad *pad, GstQuery *query);
264 #define GST_TRACER_PAD_QUERY_PRE(pad, query) G_STMT_START{ \
265 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_QUERY_PRE), \
266 GstTracerHookPadQueryPre, (GST_TRACER_ARGS, pad, query)); \
270 * GstTracerHookPadQueryPost:
271 * @self: the tracer instance
272 * @ts: the current timestamp
275 * @res: the result of gst_pad_query()
277 * Post-hook for gst_pad_query() named "pad-query-post".
279 typedef void (*GstTracerHookPadQueryPost) (GObject *self, GstClockTime ts,
280 GstPad *pad, GstQuery *query, gboolean res);
281 #define GST_TRACER_PAD_QUERY_POST(pad, query, res) G_STMT_START{ \
282 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_QUERY_POST), \
283 GstTracerHookPadQueryPost, (GST_TRACER_ARGS, pad, query, res)); \
287 * GstTracerHookElementPostMessagePre:
288 * @self: the tracer instance
289 * @ts: the current timestamp
290 * @element: the element
291 * @message: the message
293 * Pre-hook for gst_element_post_message() named "element-post-message-pre".
295 typedef void (*GstTracerHookElementPostMessagePre) (GObject *self,
296 GstClockTime ts, GstElement *element, GstMessage *message);
297 #define GST_TRACER_ELEMENT_POST_MESSAGE_PRE(element, message) G_STMT_START{ \
298 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_POST_MESSAGE_PRE), \
299 GstTracerHookElementPostMessagePre, (GST_TRACER_ARGS, element, message)); \
303 * GstTracerHookElementPostMessagePost:
304 * @self: the tracer instance
305 * @ts: the current timestamp
306 * @element: the element
307 * @res: the result of gst_element_post_message()
309 * Pre-hook for gst_element_post_message() named "element-post-message-post".
311 typedef void (*GstTracerHookElementPostMessagePost) (GObject *self,
312 GstClockTime ts, GstElement *element, gboolean res);
313 #define GST_TRACER_ELEMENT_POST_MESSAGE_POST(element, res) G_STMT_START{ \
314 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_POST_MESSAGE_POST), \
315 GstTracerHookElementPostMessagePost, (GST_TRACER_ARGS, element, res)); \
319 * GstTracerHookElementQueryPre:
320 * @self: the tracer instance
321 * @ts: the current timestamp
322 * @element: the element
325 * Pre-hook for gst_element_query() named "element-query-pre".
327 typedef void (*GstTracerHookElementQueryPre) (GObject *self, GstClockTime ts,
328 GstElement *element, GstQuery *query);
329 #define GST_TRACER_ELEMENT_QUERY_PRE(element, query) G_STMT_START{ \
330 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_QUERY_PRE), \
331 GstTracerHookElementQueryPre, (GST_TRACER_ARGS, element, query)); \
335 * GstTracerHookElementQueryPost:
336 * @self: the tracer instance
337 * @ts: the current timestamp
338 * @element: the element
340 * @res: the result of gst_element_query()
342 * Post-hook for gst_element_query() named "element-query-post".
344 typedef void (*GstTracerHookElementQueryPost) (GObject *self, GstClockTime ts,
345 GstElement *element, GstQuery *query, gboolean res);
346 #define GST_TRACER_ELEMENT_QUERY_POST(element, query, res) G_STMT_START{ \
347 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_QUERY_POST), \
348 GstTracerHookElementQueryPost, (GST_TRACER_ARGS, element, query, res)); \
352 * GstTracerHookElementNew:
353 * @self: the tracer instance
354 * @ts: the current timestamp
355 * @element: the element
357 * Hook for gst_element_new() named "element-new".
359 typedef void (*GstTracerHookElementNew) (GObject *self, GstClockTime ts,
360 GstElement *element);
361 #define GST_TRACER_ELEMENT_NEW(element) G_STMT_START{ \
362 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_NEW), \
363 GstTracerHookElementNew, (GST_TRACER_ARGS, element)); \
367 * GstTracerHookElementAddPad:
368 * @self: the tracer instance
369 * @ts: the current timestamp
370 * @element: the element
373 * Hook for gst_element_add_pad() named "element-add-pad".
375 typedef void (*GstTracerHookElementAddPad) (GObject *self, GstClockTime ts,
376 GstElement *element, GstPad *pad);
377 #define GST_TRACER_ELEMENT_ADD_PAD(element, pad) G_STMT_START{ \
378 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_ADD_PAD), \
379 GstTracerHookElementAddPad, (GST_TRACER_ARGS, element, pad)); \
383 * GstTracerHookElementRemovePad:
384 * @self: the tracer instance
385 * @ts: the current timestamp
386 * @element: the element
389 * Hook for gst_element_remove_pad() named "element-remove-pad".
391 typedef void (*GstTracerHookElementRemovePad) (GObject *self, GstClockTime ts,
392 GstElement *element, GstPad *pad);
393 #define GST_TRACER_ELEMENT_REMOVE_PAD(element, pad) G_STMT_START{ \
394 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_REMOVE_PAD), \
395 GstTracerHookElementRemovePad, (GST_TRACER_ARGS, element, pad)); \
399 * GstTracerHookElementChangeStatePre:
400 * @self: the tracer instance
401 * @ts: the current timestamp
402 * @element: the element
403 * @transition: the transition
405 * Pre-hook for gst_element_change_state() named "element-change-state-pre".
407 typedef void (*GstTracerHookElementChangeStatePre) (GObject *self,
408 GstClockTime ts, GstElement *element, GstStateChange transition);
409 #define GST_TRACER_ELEMENT_CHANGE_STATE_PRE(element, transition) G_STMT_START{ \
410 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_CHANGE_STATE_PRE), \
411 GstTracerHookElementChangeStatePre, (GST_TRACER_ARGS, element, transition)); \
415 * GstTracerHookElementChangeStatePost:
416 * @self: the tracer instance
417 * @ts: the current timestamp
418 * @element: the element
419 * @transition: the transition
420 * @result: the result of gst_pad_push()
422 * Post-hook for gst_element_change_state() named "element-change-state-post".
424 typedef void (*GstTracerHookElementChangeStatePost) (GObject *self,
425 GstClockTime ts, GstElement *element, GstStateChange transition,
426 GstStateChangeReturn result);
427 #define GST_TRACER_ELEMENT_CHANGE_STATE_POST(element, transition, result) G_STMT_START{ \
428 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_ELEMENT_CHANGE_STATE_POST), \
429 GstTracerHookElementChangeStatePost, (GST_TRACER_ARGS, element, transition, result)); \
433 * GstTracerHookBinAddPre:
434 * @self: the tracer instance
435 * @ts: the current timestamp
437 * @element: the element
439 * Pre-hook for gst_bin_add() named "bin-add-pre".
441 typedef void (*GstTracerHookBinAddPre) (GObject *self, GstClockTime ts,
442 GstBin *bin, GstElement *element);
443 #define GST_TRACER_BIN_ADD_PRE(bin, element) G_STMT_START{ \
444 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_BIN_ADD_PRE), \
445 GstTracerHookBinAddPre, (GST_TRACER_ARGS, bin, element)); \
449 * GstTracerHookBinAddPost:
450 * @self: the tracer instance
451 * @ts: the current timestamp
453 * @element: the element
454 * @result: the result of gst_bin_add()
456 * Post-hook for gst_bin_add() named "bin-add-post".
458 typedef void (*GstTracerHookBinAddPost) (GObject *self, GstClockTime ts,
459 GstBin *bin, GstElement *element, gboolean result);
460 #define GST_TRACER_BIN_ADD_POST(bin, element, result) G_STMT_START{ \
461 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_BIN_ADD_POST), \
462 GstTracerHookBinAddPost, (GST_TRACER_ARGS, bin, element, result)); \
466 * GstTracerHookBinRemovePre:
467 * @self: the tracer instance
468 * @ts: the current timestamp
470 * @element: the element
472 * Pre-hook for gst_bin_remove() named "bin-remove-pre".
474 typedef void (*GstTracerHookBinRemovePre) (GObject *self, GstClockTime ts,
475 GstBin *bin, GstElement *element);
476 #define GST_TRACER_BIN_REMOVE_PRE(bin, element) G_STMT_START{ \
477 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_BIN_REMOVE_PRE), \
478 GstTracerHookBinRemovePre, (GST_TRACER_ARGS, bin, element)); \
482 * GstTracerHookBinRemovePost:
483 * @self: the tracer instance
484 * @ts: the current timestamp
486 * @result: the result of gst_bin_remove()
488 * Post-hook for gst_bin_remove() named "bin-remove-post".
490 typedef void (*GstTracerHookBinRemovePost) (GObject *self, GstClockTime ts,
491 GstBin *bin, gboolean result);
492 #define GST_TRACER_BIN_REMOVE_POST(bin, result) G_STMT_START{ \
493 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_BIN_REMOVE_POST), \
494 GstTracerHookBinRemovePost, (GST_TRACER_ARGS, bin, result)); \
498 * GstTracerHookPadLinkPre:
499 * @self: the tracer instance
500 * @ts: the current timestamp
501 * @srcpad: the srcpad
502 * @sinkpad: the sinkpad
504 * Pre-hook for gst_pad_link() named "pad-link-pre".
506 typedef void (*GstTracerHookPadLinkPre) (GObject *self, GstClockTime ts,
507 GstPad *srcpad, GstPad *sinkpad);
508 #define GST_TRACER_PAD_LINK_PRE(srcpad, sinkpad) G_STMT_START{ \
509 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_LINK_PRE), \
510 GstTracerHookPadLinkPre, (GST_TRACER_ARGS, srcpad, sinkpad)); \
514 * GstTracerHookPadLinkPost:
515 * @self: the tracer instance
516 * @ts: the current timestamp
517 * @srcpad: the srcpad
518 * @sinkpad: the sinkpad
519 * @result: the result of gst_pad_link()
521 * Post-hook for gst_pad_link() named "pad-link-post".
523 typedef void (*GstTracerHookPadLinkPost) (GObject *self, GstClockTime ts,
524 GstPad *srcpad, GstPad *sinkpad, GstPadLinkReturn result);
525 #define GST_TRACER_PAD_LINK_POST(srcpad, sinkpad, result) G_STMT_START{ \
526 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_LINK_POST), \
527 GstTracerHookPadLinkPost, (GST_TRACER_ARGS, srcpad, sinkpad, result)); \
531 * GstTracerHookPadUnlinkPre:
532 * @self: the tracer instance
533 * @ts: the current timestamp
534 * @srcpad: the srcpad
535 * @sinkpad: the sinkpad
537 * Pre-hook for gst_pad_unlink() named "pad-unlink-pre".
539 typedef void (*GstTracerHookPadUnlinkPre) (GObject *self, GstClockTime ts,
540 GstPad *srcpad, GstPad *sinkpad);
541 #define GST_TRACER_PAD_UNLINK_PRE(srcpad, sinkpad) G_STMT_START{ \
542 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_UNLINK_PRE), \
543 GstTracerHookPadUnlinkPre, (GST_TRACER_ARGS, srcpad, sinkpad)); \
547 * GstTracerHookPadUnlinkPost:
548 * @self: the tracer instance
549 * @ts: the current timestamp
550 * @srcpad: the srcpad
551 * @sinkpad: the sinkpad
552 * @result: the result of gst_pad_push()
554 * Post-hook for gst_pad_unlink() named "pad-unlink-post".
556 typedef void (*GstTracerHookPadUnlinkPost) (GObject *self, GstClockTime ts,
557 GstPad *srcpad, GstPad *sinkpad, gboolean result);
558 #define GST_TRACER_PAD_UNLINK_POST(srcpad, sinkpad, result) G_STMT_START{ \
559 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PAD_UNLINK_POST), \
560 GstTracerHookPadUnlinkPost, (GST_TRACER_ARGS, srcpad, sinkpad, result)); \
564 * GstTracerHookMiniObjectCreated:
565 * @self: the tracer instance
566 * @ts: the current timestamp
567 * @object: the mini object being created
569 * Hook called when a #GstMiniObject is created named "mini-object-created".
571 typedef void (*GstTracerHookMiniObjectCreated) (GObject *self, GstClockTime ts,
572 GstMiniObject *object);
573 #define GST_TRACER_MINI_OBJECT_CREATED(object) G_STMT_START{ \
574 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_MINI_OBJECT_CREATED), \
575 GstTracerHookMiniObjectCreated, (GST_TRACER_ARGS, object)); \
579 * GstTracerHookMiniObjectDestroyed:
580 * @self: the tracer instance
581 * @ts: the current timestamp
582 * @object: the mini object being destroyed
584 * Hook called when a #GstMiniObject is being destroyed named
585 * "mini-object-destroyed".
587 typedef void (*GstTracerHookMiniObjectDestroyed) (GObject *self, GstClockTime ts,
588 GstMiniObject *object);
589 #define GST_TRACER_MINI_OBJECT_DESTROYED(object) G_STMT_START{ \
590 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_MINI_OBJECT_DESTROYED), \
591 GstTracerHookMiniObjectDestroyed, (GST_TRACER_ARGS, object)); \
595 * GstTracerHookObjectCreated:
596 * @self: the tracer instance
597 * @ts: the current timestamp
598 * @object: the object being created
600 * Hook called when a #GstObject is created named "object-created".
602 typedef void (*GstTracerHookObjectCreated) (GObject *self, GstClockTime ts,
604 #define GST_TRACER_OBJECT_CREATED(object) G_STMT_START{ \
605 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_OBJECT_CREATED), \
606 GstTracerHookObjectCreated, (GST_TRACER_ARGS, object)); \
610 * GstTracerHookObjectDestroyed:
611 * @self: the tracer instance
612 * @ts: the current timestamp
613 * @object: the object being destroyed
615 * Hook called when a #GstObject is being destroyed named
616 * "object-destroyed".
618 typedef void (*GstTracerHookObjectDestroyed) (GObject *self, GstClockTime ts,
620 #define GST_TRACER_OBJECT_DESTROYED(object) G_STMT_START{ \
621 GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_OBJECT_DESTROYED), \
622 GstTracerHookObjectDestroyed, (GST_TRACER_ARGS, object)); \
626 #else /* !GST_DISABLE_GST_TRACER_HOOKS */
628 #define GST_TRACER_PAD_PUSH_PRE(pad, buffer)
629 #define GST_TRACER_PAD_PUSH_POST(pad, res)
630 #define GST_TRACER_PAD_PUSH_LIST_PRE(pad, list)
631 #define GST_TRACER_PAD_PUSH_LIST_POST(pad, res)
632 #define GST_TRACER_PAD_PULL_RANGE_PRE(pad, offset, size)
633 #define GST_TRACER_PAD_PULL_RANGE_POST(pad, buffer, res)
634 #define GST_TRACER_PAD_PUSH_EVENT_PRE(pad, event)
635 #define GST_TRACER_PAD_PUSH_EVENT_POST(pad, res)
636 #define GST_TRACER_PAD_QUERY_PRE(pad, query)
637 #define GST_TRACER_PAD_QUERY_POST(pad, query, res)
638 #define GST_TRACER_ELEMENT_POST_MESSAGE_PRE(element, message)
639 #define GST_TRACER_ELEMENT_POST_MESSAGE_POST(element, res)
640 #define GST_TRACER_ELEMENT_QUERY_PRE(element, query)
641 #define GST_TRACER_ELEMENT_QUERY_POST(element, query, res)
642 #define GST_TRACER_ELEMENT_NEW(element)
643 #define GST_TRACER_ELEMENT_ADD_PAD(element, pad)
644 #define GST_TRACER_ELEMENT_REMOVE_PAD(element, pad)
645 #define GST_TRACER_ELEMENT_CHANGE_STATE_PRE(element, transition)
646 #define GST_TRACER_ELEMENT_CHANGE_STATE_POST(element, transition, res)
647 #define GST_TRACER_BIN_ADD_PRE(bin, element)
648 #define GST_TRACER_BIN_ADD_POST(bin, element, res)
649 #define GST_TRACER_BIN_REMOVE_PRE(bin, element)
650 #define GST_TRACER_BIN_REMOVE_POST(bin, res)
651 #define GST_TRACER_PAD_LINK_PRE(srcpad, sinkpad)
652 #define GST_TRACER_PAD_LINK_POST(srcpad, sinkpad, res)
653 #define GST_TRACER_PAD_UNLINK_PRE(srcpad, sinkpad)
654 #define GST_TRACER_PAD_UNLINK_POST(srcpad, sinkpad, res)
655 #define GST_TRACER_MINI_OBJECT_CREATED(object)
656 #define GST_TRACER_MINI_OBJECT_DESTROYED(object)
657 #define GST_TRACER_OBJECT_CREATED(object)
658 #define GST_TRACER_OBJECT_DESTROYED(object)
660 #endif /* GST_DISABLE_GST_TRACER_HOOKS */
664 #endif /* __GST_TRACER_UTILS_H__ */