goom: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 16 Feb 2021 16:11:14 +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/goom/gstgoom.c
gst/goom/gstgoom.h

index 4942345..e40bfa7 100644 (file)
@@ -99,8 +99,10 @@ static void gst_goom_finalize (GObject * object);
 static gboolean gst_goom_setup (GstAudioVisualizer * base);
 static gboolean gst_goom_render (GstAudioVisualizer * base, GstBuffer * audio,
     GstVideoFrame * video);
+static gboolean goom_element_init (GstPlugin * plugin);
 
 G_DEFINE_TYPE (GstGoom, gst_goom, GST_TYPE_AUDIO_VISUALIZER);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (goom, goom_element_init);
 
 static void
 gst_goom_class_init (GstGoomClass * klass)
@@ -192,7 +194,7 @@ gst_goom_render (GstAudioVisualizer * base, GstBuffer * audio,
 }
 
 static gboolean
-plugin_init (GstPlugin * plugin)
+goom_element_init (GstPlugin * plugin)
 {
   GST_DEBUG_CATEGORY_INIT (goom_debug, "goom", 0, "goom visualisation element");
 
@@ -203,6 +205,12 @@ plugin_init (GstPlugin * plugin)
   return gst_element_register (plugin, "goom", GST_RANK_NONE, GST_TYPE_GOOM);
 }
 
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  return GST_ELEMENT_REGISTER (goom, plugin);
+}
+
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     goom,
index 25975dd..d192460 100644 (file)
@@ -59,7 +59,8 @@ struct _GstGoomClass
 };
 
 GType gst_goom_get_type (void);
-gboolean gst_goom_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (goom);
 
 G_END_DECLS