videobox: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 16 Feb 2021 13:54:15 +0000 (14:54 +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/videobox/gstvideobox.c
gst/videobox/gstvideobox.h

index 0e69c7c..0fa7655 100644 (file)
@@ -2409,6 +2409,9 @@ GST_STATIC_PAD_TEMPLATE ("sink",
 
 #define gst_video_box_parent_class parent_class
 G_DEFINE_TYPE (GstVideoBox, gst_video_box, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (videobox, "videobox", GST_RANK_NONE,
+    GST_TYPE_VIDEO_BOX, GST_DEBUG_CATEGORY_INIT (videobox_debug, "videobox", 0,
+        "Resizes a video by adding borders or cropping"));
 
 static void gst_video_box_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
@@ -3336,11 +3339,7 @@ gst_video_box_transform_frame (GstVideoFilter * vfilter,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (videobox_debug, "videobox", 0,
-      "Resizes a video by adding borders or cropping");
-
-  return gst_element_register (plugin, "videobox", GST_RANK_NONE,
-      GST_TYPE_VIDEO_BOX);
+  return GST_ELEMENT_REGISTER (videobox, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index cbb98ac..f2e5585 100644 (file)
@@ -89,4 +89,6 @@ struct _GstVideoBoxClass
 
 GType gst_video_box_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (videobox);
+
 #endif /* __GST_VIDEO_BOX_H__ */