Use macros to register boxed types thread safely
[platform/upstream/gstreamer.git] / gst / gstcaps.c
index cc410a3..922c77c 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,
@@ -351,16 +351,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: