v4l2codecs: fix v4l2codecdevice get type
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 10 Apr 2020 19:03:04 +0000 (21:03 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 10 Apr 2020 19:05:19 +0000 (21:05 +0200)
Currently the GType of v4l2codecdevice is hardcoded to zero, but it
rather should be delivered by the GType system.

sys/v4l2codecs/gstv4l2codecdevice.c
sys/v4l2codecs/gstv4l2codecdevice.h

index eff61fa..b1e74b8 100644 (file)
@@ -31,8 +31,6 @@
 #define GST_CAT_DEFAULT gstv4l2codecs_debug
 GST_DEBUG_CATEGORY_EXTERN (gstv4l2codecs_debug);
 
-GType _gst_v4l2_codec_device_type = 0;
-
 GST_DEFINE_MINI_OBJECT_TYPE (GstV4l2CodecDevice, gst_v4l2_codec_device);
 
 static void
@@ -51,7 +49,7 @@ gst_v4l2_codec_device_new (const gchar * name, guint32 function,
   GstV4l2CodecDevice *device = g_new0 (GstV4l2CodecDevice, 1);
 
   gst_mini_object_init (GST_MINI_OBJECT_CAST (device),
-      0, _gst_v4l2_codec_device_type, NULL, NULL,
+      0, GST_TYPE_V4L2_CODEC_DEVICE, NULL, NULL,
       (GstMiniObjectFreeFunction) gst_v4l2_codec_device_free);
 
   device->name = g_strdup (name);
index 65f4a8f..a48088c 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <gst/gst.h>
 
-#define GST_TYPE_V4L2_CODEC_DEVICE     (_gst_v4l2_codec_device_type)
+#define GST_TYPE_V4L2_CODEC_DEVICE     (gst_v4l2_codec_device_get_type())
 #define GST_IS_V4L2_CODEC_DEVICE(obj)  (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_V4L2_CODEC_DEVICE))
 #define GST_V4L2_CODEC_DEVICE(obj)     ((GstV4l2CodecDevice *)(obj))