ofa: allow per feature registration

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>
This commit is contained in:
Stéphane Cerveau 2021-02-18 10:41:53 +01:00 committed by GStreamer Marge Bot
parent c2b1368b03
commit 3f1c8d9307
2 changed files with 15 additions and 3 deletions

View file

@ -42,8 +42,7 @@ enum
PROP_FINGERPRINT, 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_finalize (GObject * object);
static void gst_ofa_get_property (GObject * object, guint prop_id, 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, static GstFlowReturn gst_ofa_transform_ip (GstBaseTransform * trans,
GstBuffer * buf); GstBuffer * buf);
static gboolean gst_ofa_sink_event (GstBaseTransform * trans, GstEvent * event); 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 static void
gst_ofa_finalize (GObject * object) gst_ofa_finalize (GObject * object)
@ -249,7 +253,7 @@ gst_ofa_get_property (GObject * object, guint prop_id, GValue * value,
static gboolean static gboolean
plugin_init (GstPlugin * plugin) ofa_element_init (GstPlugin * plugin)
{ {
gboolean ret; gboolean ret;
int major, minor, rev; int major, minor, rev;
@ -271,6 +275,12 @@ plugin_init (GstPlugin * plugin)
return ret; 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 */ /* FIXME: someone write a libofa replacement with an LGPL or BSD license */
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,

View file

@ -74,6 +74,8 @@ struct _GstOFAClass
GType gst_ofa_get_type (void); GType gst_ofa_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (ofa);
G_END_DECLS G_END_DECLS
#endif /* __GST_OFA_H__ */ #endif /* __GST_OFA_H__ */