diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2021-02-25 15:22:15 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-04-11 16:16:55 +0000 |
commit | 891be511057dbcdf1f38740e55cbd376c4b25894 (patch) | |
tree | b077e8cd0b584ebe2a10950ef2398ab3f60b48b4 /gst/camerabin2 | |
parent | 7f60138ef68e2a1fef8ccd4ff3710dfccd243314 (diff) | |
download | gstreamer-plugins-bad-891be511057dbcdf1f38740e55cbd376c4b25894.tar.gz |
gst-plugins: 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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2110>
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstcamerabin2.c | 14 | ||||
-rw-r--r-- | gst/camerabin2/gstcamerabin2.h | 2 | ||||
-rw-r--r-- | gst/camerabin2/gstplugin.c | 13 | ||||
-rw-r--r-- | gst/camerabin2/gstviewfinderbin.c | 14 | ||||
-rw-r--r-- | gst/camerabin2/gstviewfinderbin.h | 2 | ||||
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 9 | ||||
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.h | 2 |
7 files changed, 21 insertions, 35 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 502ed736d..6ac5ce4d2 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -311,6 +311,11 @@ gst_camera_bin2_get_type (void) return gst_camera_bin_type; } +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (camerabin, "camerabin", GST_RANK_NONE, + gst_camera_bin2_get_type (), GST_DEBUG_CATEGORY_INIT (gst_camera_bin_debug, + "camerabin", 0, "CameraBin"); + ); + /* GObject class functions */ static void gst_camera_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -2390,12 +2395,3 @@ gst_camera_bin_get_property (GObject * object, guint prop_id, break; } } - -gboolean -gst_camera_bin2_plugin_init (GstPlugin * plugin) -{ - GST_DEBUG_CATEGORY_INIT (gst_camera_bin_debug, "camerabin", 0, "CameraBin"); - - return gst_element_register (plugin, "camerabin", GST_RANK_NONE, - gst_camera_bin2_get_type ()); -} diff --git a/gst/camerabin2/gstcamerabin2.h b/gst/camerabin2/gstcamerabin2.h index ba55a7ea0..f478daa11 100644 --- a/gst/camerabin2/gstcamerabin2.h +++ b/gst/camerabin2/gstcamerabin2.h @@ -161,7 +161,7 @@ struct _GstCameraBin2Class }; GType gst_camera_bin2_get_type (void); -gboolean gst_camera_bin2_plugin_init (GstPlugin * plugin); +GST_ELEMENT_REGISTER_DECLARE (camerabin); G_END_DECLS diff --git a/gst/camerabin2/gstplugin.c b/gst/camerabin2/gstplugin.c index 320bb2c9a..bc0c816b7 100644 --- a/gst/camerabin2/gstplugin.c +++ b/gst/camerabin2/gstplugin.c @@ -30,14 +30,13 @@ static gboolean plugin_init (GstPlugin * plugin) { - if (!gst_viewfinder_bin_plugin_init (plugin)) - return FALSE; - if (!gst_wrapper_camera_bin_src_plugin_init (plugin)) - return FALSE; - if (!gst_camera_bin2_plugin_init (plugin)) - return FALSE; + gboolean ret = FALSE; - return TRUE; + ret |= GST_ELEMENT_REGISTER (viewfinderbin, plugin); + ret |= GST_ELEMENT_REGISTER (wrappercamerabinsrc, plugin); + ret |= GST_ELEMENT_REGISTER (camerabin, plugin); + + return ret; } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/camerabin2/gstviewfinderbin.c b/gst/camerabin2/gstviewfinderbin.c index 3a96e8956..1c37cef31 100644 --- a/gst/camerabin2/gstviewfinderbin.c +++ b/gst/camerabin2/gstviewfinderbin.c @@ -63,6 +63,11 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* class initialization */ #define gst_viewfinder_bin_parent_class parent_class G_DEFINE_TYPE (GstViewfinderBin, gst_viewfinder_bin, GST_TYPE_BIN); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (viewfinderbin, "viewfinderbin", + GST_RANK_NONE, gst_viewfinder_bin_get_type (), + GST_DEBUG_CATEGORY_INIT (gst_viewfinder_bin_debug, "viewfinderbin", 0, + "ViewFinderBin"); + ); static void gst_viewfinder_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * spec); @@ -358,12 +363,3 @@ gst_viewfinder_bin_get_property (GObject * object, guint prop_id, break; } } - -gboolean -gst_viewfinder_bin_plugin_init (GstPlugin * plugin) -{ - GST_DEBUG_CATEGORY_INIT (gst_viewfinder_bin_debug, "viewfinderbin", 0, - "ViewFinderBin"); - return gst_element_register (plugin, "viewfinderbin", GST_RANK_NONE, - gst_viewfinder_bin_get_type ()); -} diff --git a/gst/camerabin2/gstviewfinderbin.h b/gst/camerabin2/gstviewfinderbin.h index 3479120f7..28845dbd7 100644 --- a/gst/camerabin2/gstviewfinderbin.h +++ b/gst/camerabin2/gstviewfinderbin.h @@ -53,7 +53,7 @@ struct _GstViewfinderBinClass }; GType gst_viewfinder_bin_get_type (void); -gboolean gst_viewfinder_bin_plugin_init (GstPlugin * plugin); +GST_ELEMENT_REGISTER_DECLARE (viewfinderbin); G_END_DECLS diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 6fd11292a..491007e0d 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -52,6 +52,8 @@ GST_DEBUG_CATEGORY (wrapper_camera_bin_src_debug); #define gst_wrapper_camera_bin_src_parent_class parent_class G_DEFINE_TYPE (GstWrapperCameraBinSrc, gst_wrapper_camera_bin_src, GST_TYPE_BASE_CAMERA_SRC); +GST_ELEMENT_REGISTER_DEFINE (wrappercamerabinsrc, "wrappercamerabinsrc", + GST_RANK_NONE, gst_wrapper_camera_bin_src_get_type ()); static GstStaticPadTemplate vfsrc_template = GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME, @@ -1169,10 +1171,3 @@ gst_wrapper_camera_bin_src_init (GstWrapperCameraBinSrc * self) self->mode = GST_BASE_CAMERA_SRC_CAST (self)->mode; self->app_vid_filter = NULL; } - -gboolean -gst_wrapper_camera_bin_src_plugin_init (GstPlugin * plugin) -{ - return gst_element_register (plugin, "wrappercamerabinsrc", GST_RANK_NONE, - gst_wrapper_camera_bin_src_get_type ()); -} diff --git a/gst/camerabin2/gstwrappercamerabinsrc.h b/gst/camerabin2/gstwrappercamerabinsrc.h index 90ab0ccd7..66a6723ef 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.h +++ b/gst/camerabin2/gstwrappercamerabinsrc.h @@ -124,7 +124,7 @@ struct _GstWrapperCameraBinSrcClass GstBaseCameraSrcClass parent; }; -gboolean gst_wrapper_camera_bin_src_plugin_init (GstPlugin * plugin); +GST_ELEMENT_REGISTER_DECLARE (wrappercamerabinsrc); G_END_DECLS |