openni2: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Thu, 18 Feb 2021 14:48:12 +0000 (15:48 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 23 Mar 2021 14:19:17 +0000 (14:19 +0000)
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-bad/-/merge_requests/2038>

ext/openni2/gstopenni2.cpp
ext/openni2/gstopenni2src.cpp
ext/openni2/gstopenni2src.h

index 493f0a5..0509194 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_openni2src_plugin_init (plugin))
-    return FALSE;
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (openni2src, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 696dca2..8df5b65 100644 (file)
@@ -111,6 +111,8 @@ static GstFlowReturn openni2_read_gstbuffer (GstOpenni2Src * src,
 
 #define parent_class gst_openni2_src_parent_class
 G_DEFINE_TYPE (GstOpenni2Src, gst_openni2_src, GST_TYPE_PUSH_SRC);
+GST_ELEMENT_REGISTER_DEFINE (openni2src, "openni2src", GST_RANK_NONE,
+    GST_TYPE_OPENNI2_SRC);
 
 static void
 gst_openni2_src_class_init (GstOpenni2SrcClass * klass)
@@ -512,14 +514,6 @@ gst_openni2src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
   return GST_BASE_SRC_CLASS (parent_class)->decide_allocation (bsrc, query);
 }
 
-gboolean
-gst_openni2src_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "openni2src", GST_RANK_NONE,
-      GST_TYPE_OPENNI2_SRC);
-}
-
-
 static gboolean
 openni2_initialise_library (void)
 {
index 39ec2a0..216fba2 100644 (file)
@@ -75,7 +75,8 @@ struct _GstOpenni2SrcClass
 };
 
 GType gst_openni2_src_get_type (void);
-gboolean gst_openni2src_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (openni2src);
 
 G_END_DECLS
 #endif /* __GST_OPENNI2_SRC_H__ */