flite: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Tue, 30 Mar 2021 09:34:54 +0000 (11:34 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 30 Mar 2021 10:49:49 +0000 (10:49 +0000)
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

<https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2123>

ext/flite/gstflite.c
ext/flite/gstflitetestsrc.c

index c28baa6..9082b2b 100644 (file)
 #include <flite/flite.h>
 
 GType gst_flite_test_src_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (flitetestsrc);
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  flite_init ();
-
-  gst_element_register (plugin, "flitetestsrc", GST_RANK_NONE,
-      gst_flite_test_src_get_type ());
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (flitetestsrc, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 63ed90d..397d133 100644 (file)
@@ -90,8 +90,11 @@ GST_STATIC_PAD_TEMPLATE ("src",
         "rate = (int) 48000, " "channels = (int) [1, 8]")
     );
 
+GST_ELEMENT_REGISTER_DECLARE (flitetestsrc);
 #define gst_flite_test_src_parent_class parent_class
 G_DEFINE_TYPE (GstFliteTestSrc, gst_flite_test_src, GST_TYPE_BASE_SRC);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (flitetestsrc, "flitetestsrc",
+    GST_RANK_NONE, gst_flite_test_src_get_type (), flite_init ());
 
 static void gst_flite_test_src_set_property (GObject * object,
     guint prop_id, const GValue * value, GParamSpec * pspec);