gst: add some performance logging
[platform/upstream/gstreamer.git] / gst / gstcaps.c
index 1cf0263..d40bd0f 100644 (file)
@@ -44,7 +44,7 @@
  *  <programlisting>
  *  GstCaps *caps;
  *  caps = gst_caps_new_simple ("video/x-raw",
- *       "format", G_TYPE_STRING, "I420"),
+ *       "format", G_TYPE_STRING, "I420",
  *       "framerate", GST_TYPE_FRACTION, 25, 1,
  *       "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
  *       "width", G_TYPE_INT, 320,
@@ -150,6 +150,9 @@ _gst_caps_copy (const GstCaps * caps)
   GST_CAPS_FLAGS (newcaps) = GST_CAPS_FLAGS (caps);
   n = GST_CAPS_LEN (caps);
 
+  GST_CAT_DEBUG_OBJECT (GST_CAT_PERFORMANCE, caps, "doing copy %p -> %p",
+      caps, newcaps);
+
   for (i = 0; i < n; i++) {
     structure = gst_caps_get_structure_unchecked (caps, i);
     gst_caps_append_structure (newcaps, gst_structure_copy (structure));
@@ -351,16 +354,7 @@ gst_caps_new_full_valist (GstStructure * structure, va_list var_args)
   return caps;
 }
 
-GType
-gst_static_caps_get_type (void)
-{
-  static GType staticcaps_type = 0;
-
-  if (G_UNLIKELY (staticcaps_type == 0)) {
-    staticcaps_type = g_pointer_type_register_static ("GstStaticCaps");
-  }
-  return staticcaps_type;
-}
+G_DEFINE_POINTER_TYPE (GstStaticCaps, gst_static_caps);
 
 /**
  * gst_static_caps_get:
@@ -395,15 +389,14 @@ gst_static_caps_get (GstStaticCaps * static_caps)
     if (G_UNLIKELY (string == NULL))
       goto no_string;
 
-    GST_CAT_TRACE (GST_CAT_CAPS, "creating %p", static_caps);
-
     *caps = gst_caps_from_string (string);
 
     /* convert to string */
     if (G_UNLIKELY (*caps == NULL))
       g_critical ("Could not convert static caps \"%s\"", string);
 
-    GST_CAT_TRACE (GST_CAT_CAPS, "created %p", static_caps);
+    GST_CAT_TRACE (GST_CAT_CAPS, "created %p from string %s", static_caps,
+        string);
   done:
     G_UNLOCK (static_caps_lock);
   }