From: Stéphane Cerveau Date: Mon, 29 Mar 2021 08:38:07 +0000 (+0200) Subject: amrnb: allow per feature registration X-Git-Tag: 1.19.3~505^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6055ac6d4e52e13c4f924d422bacff5fbd380e7;p=platform%2Fupstream%2Fgstreamer.git amrnb: 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/amrnb/amrnb.c b/ext/amrnb/amrnb.c index aa9c695..3fe3a00 100644 --- a/ext/amrnb/amrnb.c +++ b/ext/amrnb/amrnb.c @@ -27,10 +27,12 @@ static gboolean plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "amrnbdec", - GST_RANK_PRIMARY, GST_TYPE_AMRNBDEC) && - gst_element_register (plugin, "amrnbenc", - GST_RANK_SECONDARY, GST_TYPE_AMRNBENC); + gboolean ret = FALSE; + + ret |= GST_ELEMENT_REGISTER (amrnbdec, plugin); + ret |= GST_ELEMENT_REGISTER (amrnbenc, plugin); + + return ret; } diff --git a/ext/amrnb/amrnbdec.c b/ext/amrnb/amrnbdec.c index fd31b9e..e984fb8 100644 --- a/ext/amrnb/amrnbdec.c +++ b/ext/amrnb/amrnbdec.c @@ -103,6 +103,8 @@ static GstFlowReturn gst_amrnbdec_handle_frame (GstAudioDecoder * dec, #define gst_amrnbdec_parent_class parent_class G_DEFINE_TYPE (GstAmrnbDec, gst_amrnbdec, GST_TYPE_AUDIO_DECODER); +GST_ELEMENT_REGISTER_DEFINE (amrnbdec, "amrnbdec", GST_RANK_PRIMARY, + GST_TYPE_AMRNBDEC); static void gst_amrnbdec_class_init (GstAmrnbDecClass * klass) diff --git a/ext/amrnb/amrnbdec.h b/ext/amrnb/amrnbdec.h index f8407a2..25b3db2 100644 --- a/ext/amrnb/amrnbdec.h +++ b/ext/amrnb/amrnbdec.h @@ -64,6 +64,7 @@ struct _GstAmrnbDecClass { }; GType gst_amrnbdec_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (amrnbdec); G_END_DECLS diff --git a/ext/amrnb/amrnbenc.c b/ext/amrnb/amrnbenc.c index c93546f..8417326 100644 --- a/ext/amrnb/amrnbenc.c +++ b/ext/amrnb/amrnbenc.c @@ -98,6 +98,8 @@ static GstFlowReturn gst_amrnbenc_handle_frame (GstAudioEncoder * enc, #define gst_amrnbenc_parent_class parent_class G_DEFINE_TYPE (GstAmrnbEnc, gst_amrnbenc, GST_TYPE_AUDIO_ENCODER); +GST_ELEMENT_REGISTER_DEFINE (amrnbenc, "amrnbenc", GST_RANK_SECONDARY, + GST_TYPE_AMRNBENC); static void gst_amrnbenc_set_property (GObject * object, guint prop_id, diff --git a/ext/amrnb/amrnbenc.h b/ext/amrnb/amrnbenc.h index 9546a44..83262e4 100644 --- a/ext/amrnb/amrnbenc.h +++ b/ext/amrnb/amrnbenc.h @@ -60,6 +60,7 @@ struct _GstAmrnbEncClass { }; GType gst_amrnbenc_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (amrnbenc); G_END_DECLS