From 41f7a88f6b992546b094c5b69366f8399ad74a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 16 Feb 2021 17:27:24 +0100 Subject: [PATCH] spectrum: 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: --- gst/spectrum/gstspectrum.c | 6 ++++-- gst/spectrum/gstspectrum.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c index 16684d45d1..d95915a8ed 100644 --- a/gst/spectrum/gstspectrum.c +++ b/gst/spectrum/gstspectrum.c @@ -98,6 +98,8 @@ enum #define gst_spectrum_parent_class parent_class G_DEFINE_TYPE (GstSpectrum, gst_spectrum, GST_TYPE_AUDIO_FILTER); +GST_ELEMENT_REGISTER_DEFINE (spectrum, "spectrum", GST_RANK_NONE, + GST_TYPE_SPECTRUM); static void gst_spectrum_finalize (GObject * object); static void gst_spectrum_set_property (GObject * object, guint prop_id, @@ -953,8 +955,8 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer) static gboolean plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "spectrum", GST_RANK_NONE, - GST_TYPE_SPECTRUM); + + return GST_ELEMENT_REGISTER (spectrum, plugin); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/spectrum/gstspectrum.h b/gst/spectrum/gstspectrum.h index df8d7300fb..d73c19f688 100644 --- a/gst/spectrum/gstspectrum.h +++ b/gst/spectrum/gstspectrum.h @@ -90,6 +90,8 @@ struct _GstSpectrumClass GType gst_spectrum_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (spectrum); + G_END_DECLS #endif /* __GST_SPECTRUM_H__ */