2 * Copyright (C) 2013 Stefan Sauer <ensonic@users.sf.net>
4 * gsttracer.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.
22 #ifndef __GST_TRACER_H__
23 #define __GST_TRACER_H__
26 #include <glib-object.h>
27 #include <gst/gstconfig.h>
28 #include <gst/gstbin.h>
32 #ifndef GST_DISABLE_GST_DEBUG
34 /* hook flags and ids */
38 GST_TRACER_HOOK_NONE = 0,
39 GST_TRACER_HOOK_BUFFERS = (1 << 0),
40 GST_TRACER_HOOK_EVENTS = (1 << 1),
41 GST_TRACER_HOOK_MESSAGES = (1 << 2),
42 GST_TRACER_HOOK_QUERIES = (1 << 3),
43 GST_TRACER_HOOK_TOPOLOGY = (1 << 4),
47 GST_TRACER_HOOK_ALL = (1 << 5) - 1
52 GST_TRACER_HOOK_ID_BUFFERS = 0,
53 GST_TRACER_HOOK_ID_EVENTS,
54 GST_TRACER_HOOK_ID_MESSAGES,
55 GST_TRACER_HOOK_ID_QUERIES,
56 GST_TRACER_HOOK_ID_TOPLOGY,
58 GST_TRACER_HOOK_ID_TIMER
60 GST_TRACER_HOOK_ID_LAST
65 typedef struct _GstTracer GstTracer;
66 typedef struct _GstTracerPrivate GstTracerPrivate;
67 typedef struct _GstTracerClass GstTracerClass;
69 #define GST_TYPE_TRACER (gst_tracer_get_type())
70 #define GST_TRACER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TRACER,GstTracer))
71 #define GST_TRACER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TRACER,GstTracerClass))
72 #define GST_IS_TRACER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TRACER))
73 #define GST_IS_TRACER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TRACER))
74 #define GST_TRACER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_TRACER,GstTracerClass))
75 #define GST_TRACER_CAST(obj) ((GstTracer *)(obj))
80 GstTracerPrivate *priv;
81 gpointer _gst_reserved[GST_PADDING];
84 typedef void (*GstTracerInvokeFunction) (GstTracer * self, GstTracerHookId id, GstStructure *s);
86 struct _GstTracerClass {
87 GstObjectClass parent_class;
90 GstTracerInvokeFunction invoke;
93 gpointer _gst_reserved[GST_PADDING];
96 GType gst_tracer_get_type (void);
100 void _priv_gst_tracer_init (void);
101 void _priv_gst_tracer_deinit (void);
103 gboolean gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type);
105 gboolean gst_tracer_is_enabled (GstTracerHookId id);
106 void gst_tracer_push_buffer_pre (GstPad *pad, GstBuffer *buffer);
107 void gst_tracer_push_buffer_post (GstPad *pad, GstFlowReturn res);
109 void gst_tracer_push_buffer_list_pre (GstPad * pad, GstBufferList * list);
110 void gst_tracer_push_buffer_list_post (GstPad * pad, GstFlowReturn res);
112 #endif /* GST_DISABLE_GST_DEBUG */
116 #endif /* __GST_TRACER_H__ */