basevideocodec: Don't use G_TYPE_REGISTER_BOXED() yet
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 13 Dec 2011 09:17:41 +0000 (10:17 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 14 Dec 2011 20:15:29 +0000 (21:15 +0100)
This would require GLib 2.26.

omx/gstbasevideocodec.c

index 45e2a5c..a1dc91d 100644 (file)
@@ -45,9 +45,21 @@ static void gst_base_video_codec_finalize (GObject * object);
 static GstStateChangeReturn gst_base_video_codec_change_state (GstElement *
     element, GstStateChange transition);
 
-G_DEFINE_BOXED_TYPE (GstVideoState, gst_video_frame,
-    (GBoxedCopyFunc) gst_video_frame_ref,
-    (GBoxedFreeFunc) gst_video_frame_unref);
+GType
+gst_video_frame_get_type (void)
+{
+  static volatile gsize type = 0;
+
+  if (g_once_init_enter (&type)) {
+    GType _type;
+
+    _type = g_boxed_type_register_static ("GstVideoFrame",
+        (GBoxedCopyFunc) gst_video_frame_ref,
+        (GBoxedFreeFunc) gst_video_frame_unref);
+    g_once_init_leave (&type, _type);
+  }
+  return (GType) type;
+}
 
 GST_BOILERPLATE (GstBaseVideoCodec, gst_base_video_codec, GstElement,
     GST_TYPE_ELEMENT);