From: Stéphane Cerveau Date: Mon, 29 Mar 2021 08:37:26 +0000 (+0200) Subject: a52dec: allow per feature registration X-Git-Tag: 1.19.3~505^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a423f23fc70f48e4a6041b3c11ccabf8673feb6d;p=platform%2Fupstream%2Fgstreamer.git a52dec: 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: --- diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c index 25db783..5beba90 100644 --- a/ext/a52dec/gsta52dec.c +++ b/ext/a52dec/gsta52dec.c @@ -92,8 +92,11 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", "rate = (int) [ 4000, 96000 ], " "channels = (int) [ 1, 6 ]") ); +static gboolean a52_element_init (GstPlugin * plugin); + #define gst_a52dec_parent_class parent_class G_DEFINE_TYPE (GstA52Dec, gst_a52dec, GST_TYPE_AUDIO_DECODER); +GST_ELEMENT_REGISTER_DEFINE_CUSTOM (a52dec, a52_element_init); static gboolean gst_a52dec_start (GstAudioDecoder * dec); static gboolean gst_a52dec_stop (GstAudioDecoder * dec); @@ -822,17 +825,20 @@ gst_a52dec_get_property (GObject * object, guint prop_id, GValue * value, } static gboolean -plugin_init (GstPlugin * plugin) +a52_element_init (GstPlugin * plugin) { #if HAVE_ORC orc_init (); #endif - if (!gst_element_register (plugin, "a52dec", GST_RANK_SECONDARY, - GST_TYPE_A52DEC)) - return FALSE; + return gst_element_register (plugin, "a52dec", GST_RANK_SECONDARY, + GST_TYPE_A52DEC); +} - return TRUE; +static gboolean +plugin_init (GstPlugin * plugin) +{ + return GST_ELEMENT_REGISTER (a52dec, plugin); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/a52dec/gsta52dec.h b/ext/a52dec/gsta52dec.h index 4d1f650..c50450e 100644 --- a/ext/a52dec/gsta52dec.h +++ b/ext/a52dec/gsta52dec.h @@ -73,6 +73,7 @@ struct _GstA52DecClass { }; GType gst_a52dec_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (a52dec); #ifndef A52_MONO #define A52_MONO 1