element: remove inactive pad g_warning in add_pad
[platform/upstream/gstreamer.git] / gst / gsttracer.c
index 668b98a..eaeddbd 100644 (file)
 
 /**
  * SECTION:gsttracer
+ * @title: GstTracer
  * @short_description: Tracing base class
  *
  * Tracing modules will subclass #GstTracer and register through
  * gst_tracer_register(). Modules can attach to various hook-types - see
- * #GstTracerHook. When invoked they receive hook specific contextual data, 
- * which they must not modify.
+ * gst_tracing_register_hook(). When invoked they receive hook specific
+ * contextual data, which they must not modify.
+ *
+ * Since: 1.8
  */
 
 #define GST_USE_UNSTABLE_API
@@ -35,6 +38,7 @@
 #include "gstenumtypes.h"
 #include "gsttracer.h"
 #include "gsttracerfactory.h"
+#include "gsttracerutils.h"
 
 GST_DEBUG_CATEGORY_EXTERN (tracer_debug);
 #define GST_CAT_DEFAULT tracer_debug
@@ -61,7 +65,7 @@ struct _GstTracerPrivate
 };
 
 #define gst_tracer_parent_class parent_class
-G_DEFINE_ABSTRACT_TYPE (GstTracer, gst_tracer, GST_TYPE_OBJECT);
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstTracer, gst_tracer, GST_TYPE_OBJECT);
 
 static void
 gst_tracer_dispose (GObject * object)
@@ -84,14 +88,12 @@ gst_tracer_class_init (GstTracerClass * klass)
       NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 
   g_object_class_install_properties (gobject_class, PROP_LAST, properties);
-  g_type_class_add_private (klass, sizeof (GstTracerPrivate));
 }
 
 static void
 gst_tracer_init (GstTracer * tracer)
 {
-  tracer->priv = G_TYPE_INSTANCE_GET_PRIVATE (tracer, GST_TYPE_TRACER,
-      GstTracerPrivate);
+  tracer->priv = gst_tracer_get_instance_private (tracer);
 }
 
 static void
@@ -128,6 +130,17 @@ gst_tracer_get_property (GObject * object, guint prop_id,
 
 /* tracing modules */
 
+/**
+ * gst_tracer_register:
+ * @plugin: (allow-none): A #GstPlugin, or %NULL for a static typefind function
+ * @name: The name for registering
+ * @type: GType of tracer to register
+ *
+ * Create a new tracer-factory  capable of instantiating objects of the
+ * @type and add the factory to @plugin.
+ *
+ * Returns: %TRUE, if the registering succeeded, %FALSE on error
+ */
 gboolean
 gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type)
 {
@@ -154,7 +167,7 @@ gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type)
     return TRUE;
   }
 
-  factory = g_object_newv (GST_TYPE_TRACER_FACTORY, 0, NULL);
+  factory = g_object_new (GST_TYPE_TRACER_FACTORY, NULL);
   GST_DEBUG_OBJECT (factory, "new tracer factory for %s", name);
 
   gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name);
@@ -181,27 +194,3 @@ gst_tracer_register (GstPlugin * plugin, const gchar * name, GType type)
 
   return TRUE;
 }
-
-/* tracing module helpers */
-
-void
-gst_tracer_log_trace (GstStructure * s)
-{
-  GST_TRACE ("%" GST_PTR_FORMAT, s);
-  /* expands to:
-     gst_debug_log_valist (
-     GST_CAT_DEFAULT, GST_LEVEL_TRACE,
-     file, func, line, object
-     "%" GST_PTR_FORMAT, s);
-     // does it make sense to use the {file, line, func} from the tracer hook?
-     // a)
-     // - we'd need to pass them in the macros to gst_tracer_dispatch()
-     // - and each tracer needs to grab them from the va_list and pass them here
-     // b)
-     // - we create a content in dispatch, pass that to the tracer
-     // - and the tracer will pass that here
-     // ideally we also use *our* ts instead of the one that
-     // gst_debug_log_default() will pick
-   */
-  gst_structure_free (s);
-}