tee: Check for the removed pad flag also in the slow pushing path
[platform/upstream/gstreamer.git] / gst / gsttracerutils.c
index 85689e5..2522cbf 100644 (file)
@@ -19,9 +19,7 @@
  * Boston, MA 02110-1301, USA.
  */
 
-/**
- * SECTION:gsttracerutils
- * @short_description: Tracing subsystem
+/* Tracing subsystem:
  *
  * The tracing subsystem provides hooks in the core library and API for modules
  * to attach to them.
@@ -29,7 +27,7 @@
  * The user can activate tracers by setting the environment variable GST_TRACE
  * to a ';' separated list of tracers.
  *
- * Note that instanciating tracers at runtime is possible but is not thread safe
+ * Note that instantiating tracers at runtime is possible but is not thread safe
  * and needs to be done before any pipeline state is set to PAUSED.
  */
 
@@ -57,7 +55,8 @@ static const gchar *_quark_strings[] = {
   "pad-link-pre", "pad-link-post", "pad-unlink-pre", "pad-unlink-post",
   "element-change-state-pre", "element-change-state-post",
   "mini-object-created", "mini-object-destroyed", "object-created",
-  "object-destroyed",
+  "object-destroyed", "mini-object-reffed", "mini-object-unreffed",
+  "object-reffed", "object-unreffed",
 };
 
 GQuark _priv_gst_tracer_quark_table[GST_TRACER_QUARK_MAX];
@@ -115,12 +114,18 @@ _priv_gst_tracing_init (void)
       if ((feature = gst_registry_lookup_feature (registry, t[i]))) {
         factory = GST_TRACER_FACTORY (gst_plugin_feature_load (feature));
         if (factory) {
+          GstTracer *tracer;
+
           GST_INFO_OBJECT (factory, "creating tracer: type-id=%u",
               (guint) factory->type);
 
+          tracer = g_object_new (factory->type, "params", params, NULL);
+
+          /* Clear floating flag */
+          gst_object_ref_sink (tracer);
+
           /* tracers register them self to the hooks */
-          gst_object_unref (g_object_new (factory->type, "params", params,
-                  NULL));
+          gst_object_unref (tracer);
         } else {
           GST_WARNING_OBJECT (feature,
               "loading plugin containing feature %s failed!", t[i]);
@@ -191,4 +196,12 @@ gst_tracing_register_hook (GstTracer * tracer, const gchar * detail,
   gst_tracing_register_hook_id (tracer, g_quark_try_string (detail), func);
 }
 
+#else /* !GST_DISABLE_GST_TRACER_HOOKS */
+
+void
+gst_tracing_register_hook (GstTracer * tracer, const gchar * detail,
+    GCallback func)
+{
+}
+
 #endif /* GST_DISABLE_GST_TRACER_HOOKS */