deinterlace: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 16 Feb 2021 16:10:33 +0000 (17:10 +0100)
committerStéphane Cerveau <scerveau@collabora.com>
Mon, 29 Mar 2021 10:45:23 +0000 (12:45 +0200)
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/876>

gst/deinterlace/gstdeinterlace.c
gst/deinterlace/gstdeinterlace.h

index acdfde9..d573916 100644 (file)
@@ -342,6 +342,7 @@ static void gst_deinterlace_update_qos (GstDeinterlace * self,
 static void gst_deinterlace_reset_qos (GstDeinterlace * self);
 static void gst_deinterlace_read_qos (GstDeinterlace * self,
     gdouble * proportion, GstClockTime * time);
+static gboolean deinterlace_element_init (GstPlugin * plugin);
 
 #define IS_TELECINE(m) ((m) == GST_VIDEO_INTERLACE_MODE_MIXED && self->pattern > 1)
 
@@ -365,9 +366,9 @@ _do_init (GType object_type)
 }
 #endif
 
-G_DEFINE_TYPE (GstDeinterlace, gst_deinterlace, GST_TYPE_ELEMENT);
-
 #define parent_class gst_deinterlace_parent_class
+G_DEFINE_TYPE (GstDeinterlace, gst_deinterlace, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (deinterlace, deinterlace_element_init);
 
 static const struct
 {
@@ -3314,8 +3315,9 @@ gst_deinterlace_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
   return res;
 }
 
+
 static gboolean
-plugin_init (GstPlugin * plugin)
+deinterlace_element_init (GstPlugin * plugin)
 {
   GST_DEBUG_CATEGORY_INIT (deinterlace_debug, "deinterlace", 0, "Deinterlacer");
 
@@ -3323,12 +3325,14 @@ plugin_init (GstPlugin * plugin)
   orc_init ();
 #endif
 
-  if (!gst_element_register (plugin, "deinterlace", GST_RANK_NONE,
-          GST_TYPE_DEINTERLACE)) {
-    return FALSE;
-  }
+  return gst_element_register (plugin, "deinterlace", GST_RANK_NONE,
+      GST_TYPE_DEINTERLACE);
+}
 
-  return TRUE;
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  return GST_ELEMENT_REGISTER (deinterlace, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 65b438a..e3cd4b2 100644 (file)
@@ -206,6 +206,8 @@ struct _GstDeinterlaceClass
 
 GType gst_deinterlace_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (deinterlace);
+
 G_END_DECLS
 
 #endif /* __GST_DEINTERLACE_H__ */