tracer: simplify hook api
[platform/upstream/gstreamer.git] / gst / gsttracer.h
1 /* GStreamer
2  * Copyright (C) 2013 Stefan Sauer <ensonic@users.sf.net>
3  *
4  * gsttracer.h: tracer base class
5  *
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.
10  *
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.
15  *
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.
20  */
21
22 #ifndef __GST_TRACER_H__
23 #define __GST_TRACER_H__
24
25 #ifndef GST_USE_UNSTABLE_API
26 #warning "The tracer subsystem is unstable API and may change in future."
27 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
28 #endif
29
30 #include <glib.h>
31 #include <glib-object.h>
32 #include <gst/gstconfig.h>
33 #include <gst/gsttracerutils.h>
34
35 G_BEGIN_DECLS
36
37 typedef struct _GstTracer GstTracer;
38 typedef struct _GstTracerPrivate GstTracerPrivate;
39 typedef struct _GstTracerClass GstTracerClass;
40
41 #define GST_TYPE_TRACER            (gst_tracer_get_type())
42 #define GST_TRACER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TRACER,GstTracer))
43 #define GST_TRACER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TRACER,GstTracerClass))
44 #define GST_IS_TRACER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TRACER))
45 #define GST_IS_TRACER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TRACER))
46 #define GST_TRACER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_TRACER,GstTracerClass))
47 #define GST_TRACER_CAST(obj)       ((GstTracer *)(obj))
48
49 struct _GstTracer {
50   GstObject        parent;
51   /*< private >*/
52   GstTracerPrivate *priv;
53   gpointer _gst_reserved[GST_PADDING];
54 };
55
56 typedef void (*GstTracerHookFunction) (GstTracer * self, va_list var_args);
57
58 struct _GstTracerClass {
59   GstObjectClass parent_class;
60     
61   /*< private >*/
62   gpointer _gst_reserved[GST_PADDING];
63 };
64
65 GType gst_tracer_get_type          (void);
66
67 void gst_tracer_register_hook (GstTracer *tracer, GstTracerHookId id, 
68   GstTracerHookFunction func);
69
70 G_END_DECLS
71
72 #endif /* __GST_TRACER_H__ */
73