GST_API
gboolean gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type);
+GST_API
+GList* gst_tracing_get_active_tracers (void);
+
#endif
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracer, gst_object_unref)
}
#endif /* GST_DISABLE_GST_TRACER_HOOKS */
+
+/**
+ * gst_tracing_get_active_tracers:
+ *
+ * Get a list of all active tracer objects owned by the tracing framework for
+ * the entirety of the run-time of the process or till gst_deinit() is called.
+ *
+ * Returns: (transfer full) (element-type Gst.Tracer): A #GList of
+ * #GstTracer objects
+ *
+ * Since: 1.18
+ */
+GList *
+gst_tracing_get_active_tracers (void)
+{
+ GList *tracers, *h_list, *h_node, *t_node;
+ GstTracerHook *hook;
+
+ if (!_priv_tracer_enabled || !_priv_tracers)
+ return NULL;
+
+ tracers = NULL;
+ h_list = g_hash_table_get_values (_priv_tracers);
+ for (h_node = h_list; h_node; h_node = g_list_next (h_node)) {
+ for (t_node = h_node->data; t_node; t_node = g_list_next (t_node)) {
+ hook = (GstTracerHook *) t_node->data;
+ /* Skip duplicate tracers from different hooks. This function is O(n), but
+ * that should be fine since the number of tracers enabled on a process
+ * should be small. */
+ if (g_list_index (tracers, hook->tracer) >= 0)
+ continue;
+ tracers = g_list_prepend (tracers, gst_object_ref (hook->tracer));
+ }
+ }
+ g_list_free (h_list);
+
+ return tracers;
+}