From 51ed45ef894d6fdcc5d86d6ea4b89b30e69a866c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Mon, 29 Mar 2021 14:06:30 +0200 Subject: [PATCH] audioresample: 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/audioresample/gstaudioresample.c | 15 +++++---------- gst/audioresample/gstaudioresample.h | 1 + 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 3b35718614..f031bb64f5 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -136,7 +136,10 @@ static void gst_audio_resample_push_drain (GstAudioResample * resample, #define gst_audio_resample_parent_class parent_class G_DEFINE_TYPE (GstAudioResample, gst_audio_resample, GST_TYPE_BASE_TRANSFORM); - +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (audioresample, "audioresample", + GST_RANK_PRIMARY, GST_TYPE_AUDIO_RESAMPLE, + GST_DEBUG_CATEGORY_INIT (audio_resample_debug, "audioresample", 0, + "audio resampling element")); static void gst_audio_resample_class_init (GstAudioResampleClass * klass) { @@ -1121,15 +1124,7 @@ gst_audio_resample_get_property (GObject * object, guint prop_id, static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (audio_resample_debug, "audioresample", 0, - "audio resampling element"); - - if (!gst_element_register (plugin, "audioresample", GST_RANK_PRIMARY, - GST_TYPE_AUDIO_RESAMPLE)) { - return FALSE; - } - - return TRUE; + return GST_ELEMENT_REGISTER (audioresample, plugin); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/audioresample/gstaudioresample.h b/gst/audioresample/gstaudioresample.h index 205512a4ee..e0af9abfcf 100644 --- a/gst/audioresample/gstaudioresample.h +++ b/gst/audioresample/gstaudioresample.h @@ -64,6 +64,7 @@ struct _GstAudioResample { GstAudioInfo out; GstAudioConverter *converter; }; +GST_ELEMENT_REGISTER_DECLARE (audioresample); G_END_DECLS