cutter: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 16 Feb 2021 16:11:26 +0000 (17:11 +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/cutter/gstcutter.c
gst/cutter/gstcutter.h

index a8d5d44..aa1424f 100644 (file)
@@ -84,6 +84,7 @@ enum
 
 #define gst_cutter_parent_class parent_class
 G_DEFINE_TYPE (GstCutter, gst_cutter, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (cutter, "cutter", GST_RANK_NONE, GST_TYPE_CUTTER);
 
 static GstStateChangeReturn
 gst_cutter_change_state (GstElement * element, GstStateChange transition);
@@ -487,10 +488,7 @@ gst_cutter_get_property (GObject * object, guint prop_id,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "cutter", GST_RANK_NONE, GST_TYPE_CUTTER))
-    return FALSE;
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (cutter, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 3875f8f..31c135b 100644 (file)
@@ -75,6 +75,8 @@ struct _GstCutterClass
 
 GType gst_cutter_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (cutter);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */