From 051ae23c2f8059a817c752bf575066b6bd0204bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Thu, 18 Feb 2021 15:48:12 +0100 Subject: [PATCH] openni2: allow per feature registration 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: --- ext/openni2/gstopenni2.cpp | 5 +---- ext/openni2/gstopenni2src.cpp | 10 ++-------- ext/openni2/gstopenni2src.h | 3 ++- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ext/openni2/gstopenni2.cpp b/ext/openni2/gstopenni2.cpp index 493f0a57b1..0509194a8c 100644 --- a/ext/openni2/gstopenni2.cpp +++ b/ext/openni2/gstopenni2.cpp @@ -48,10 +48,7 @@ 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, diff --git a/ext/openni2/gstopenni2src.cpp b/ext/openni2/gstopenni2src.cpp index 696dca23b6..8df5b65b31 100644 --- a/ext/openni2/gstopenni2src.cpp +++ b/ext/openni2/gstopenni2src.cpp @@ -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) { diff --git a/ext/openni2/gstopenni2src.h b/ext/openni2/gstopenni2src.h index 39ec2a0c10..216fba2ca7 100644 --- a/ext/openni2/gstopenni2src.h +++ b/ext/openni2/gstopenni2src.h @@ -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__ */