ofa: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Thu, 18 Feb 2021 09:41:53 +0000 (10:41 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 23 Mar 2021 14:19:17 +0000 (14:19 +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

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

ext/ofa/gstofa.c
ext/ofa/gstofa.h

index 70d7ae6..77ad32e 100644 (file)
@@ -42,8 +42,7 @@ enum
   PROP_FINGERPRINT,
 };
 
-#define parent_class gst_ofa_parent_class
-G_DEFINE_TYPE (GstOFA, gst_ofa, GST_TYPE_AUDIO_FILTER);
+
 
 static void gst_ofa_finalize (GObject * object);
 static void gst_ofa_get_property (GObject * object, guint prop_id,
@@ -51,6 +50,11 @@ static void gst_ofa_get_property (GObject * object, guint prop_id,
 static GstFlowReturn gst_ofa_transform_ip (GstBaseTransform * trans,
     GstBuffer * buf);
 static gboolean gst_ofa_sink_event (GstBaseTransform * trans, GstEvent * event);
+static gboolean ofa_element_init (GstPlugin * plugin);
+
+#define parent_class gst_ofa_parent_class
+G_DEFINE_TYPE (GstOFA, gst_ofa, GST_TYPE_AUDIO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (ofa, ofa_element_init);
 
 static void
 gst_ofa_finalize (GObject * object)
@@ -249,7 +253,7 @@ gst_ofa_get_property (GObject * object, guint prop_id, GValue * value,
 
 
 static gboolean
-plugin_init (GstPlugin * plugin)
+ofa_element_init (GstPlugin * plugin)
 {
   gboolean ret;
   int major, minor, rev;
@@ -271,6 +275,12 @@ plugin_init (GstPlugin * plugin)
   return ret;
 }
 
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  return GST_ELEMENT_REGISTER (ofa, plugin);
+}
+
 /* FIXME: someone write a libofa replacement with an LGPL or BSD license */
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
index e719df5..47f6668 100644 (file)
@@ -74,6 +74,8 @@ struct _GstOFAClass
 
 GType gst_ofa_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (ofa);
+
 G_END_DECLS
 
 #endif /* __GST_OFA_H__ */