summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/design/draft-tracing.txt6
-rw-r--r--gst/gsttracer.c6
-rw-r--r--gst/gsttracer.h2
-rw-r--r--plugins/tracers/gstlog.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/docs/design/draft-tracing.txt b/docs/design/draft-tracing.txt
index 605ef346a3..ac4ef20a09 100644
--- a/docs/design/draft-tracing.txt
+++ b/docs/design/draft-tracing.txt
@@ -95,18 +95,18 @@ Plugin api
TracerPlugins are plugin features. They have a simple api:
-GstTracerHookMask init(gchar *params);
+'instance creation'
Plugins can attach handlers to one or more hooks. They use a HookMask to tell
which events they are interested in. The params are the extra detail from the
environment var.
-void invoke(GstStructure *s);
+void invoke(GstTracerHookId id, GstStructure *s);
Hooks marshall the parameters given to a trace hook into a GstStructure and also
add some extra into such as a timestamp. The hooks will receive this structure.
Hooks will be called from misc threads. The trace plugins should only consume
(=read) the provided data. Most trace plugins will log data to a trace channel.
-void done(void);
+'instance destruction'
Plugins can output results and release data. This would ideally be done at the
end of the applications, but gst_deinit() is not mandatory. gst_tracelib was
using a gcc_destructor
diff --git a/gst/gsttracer.c b/gst/gsttracer.c
index 45bedcc2c6..2d0f703928 100644
--- a/gst/gsttracer.c
+++ b/gst/gsttracer.c
@@ -123,13 +123,13 @@ gst_tracer_get_property (GObject * object, guint prop_id,
}
static void
-gst_tracer_invoke (GstTracer * self, GstStructure * s)
+gst_tracer_invoke (GstTracer * self, GstTracerHookId id, GstStructure * s)
{
GstTracerClass *klass = GST_TRACER_GET_CLASS (self);
g_return_if_fail (klass->invoke);
- klass->invoke (s);
+ klass->invoke (id, s);
}
/* tracing modules */
@@ -287,7 +287,7 @@ dispatch (GstTracerHookId id, GstStructure * s)
{
GList *node;
for (node = tracers[id]; node; node = g_list_next (node)) {
- gst_tracer_invoke (node->data, s);
+ gst_tracer_invoke (node->data, id, s);
}
}
diff --git a/gst/gsttracer.h b/gst/gsttracer.h
index f99e326066..026edb48ac 100644
--- a/gst/gsttracer.h
+++ b/gst/gsttracer.h
@@ -81,7 +81,7 @@ struct _GstTracer {
gpointer _gst_reserved[GST_PADDING];
};
-typedef void (*GstTracerInvokeFunction) (GstStructure *s);
+typedef void (*GstTracerInvokeFunction) (GstTracerHookId id, GstStructure *s);
struct _GstTracerClass {
GstObjectClass parent_class;
diff --git a/plugins/tracers/gstlog.c b/plugins/tracers/gstlog.c
index a4c7c0ca37..f8cf95caae 100644
--- a/plugins/tracers/gstlog.c
+++ b/plugins/tracers/gstlog.c
@@ -34,7 +34,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_log_debug);
G_DEFINE_TYPE_WITH_CODE (GstLogTracer, gst_log_tracer, GST_TYPE_TRACER,
_do_init);
-static void gst_log_tracer_invoke (GstStructure * s);
+static void gst_log_tracer_invoke (GstTracerHookId id, GstStructure * s);
static void
gst_log_tracer_class_init (GstLogTracerClass * klass)
@@ -51,10 +51,10 @@ gst_log_tracer_init (GstLogTracer * self)
}
static void
-gst_log_tracer_invoke (GstStructure * s)
+gst_log_tracer_invoke (GstTracerHookId id, GstStructure * s)
{
gchar *str = gst_structure_to_string (s);
- /* TODO(ensonic): log to different categories depending on GstHookId */
+ /* TODO(ensonic): log to different categories depending on 'id' */
GST_TRACE ("%s", str);
g_free (str);
}