From 96a923fab2cf8f8986c8974b521004e1184ea537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Thu, 18 Feb 2021 15:42:44 +0100 Subject: [PATCH] openmpt: 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: --- ext/openmpt/gstopenmptdec.c | 3 ++- ext/openmpt/gstopenmptdec.h | 1 + ext/openmpt/plugin.c | 6 +----- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/openmpt/gstopenmptdec.c b/ext/openmpt/gstopenmptdec.c index 9c84113158..70e2dae4b8 100644 --- a/ext/openmpt/gstopenmptdec.c +++ b/ext/openmpt/gstopenmptdec.c @@ -95,7 +95,8 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", G_DEFINE_TYPE (GstOpenMptDec, gst_openmpt_dec, GST_TYPE_NONSTREAM_AUDIO_DECODER); - +GST_ELEMENT_REGISTER_DEFINE (openmptdec, "openmptdec", GST_RANK_PRIMARY + 2, + gst_openmpt_dec_get_type ()); static void gst_openmpt_dec_finalize (GObject * object); diff --git a/ext/openmpt/gstopenmptdec.h b/ext/openmpt/gstopenmptdec.h index 93e283f4f0..e5fc5b50e6 100644 --- a/ext/openmpt/gstopenmptdec.h +++ b/ext/openmpt/gstopenmptdec.h @@ -74,6 +74,7 @@ struct _GstOpenMptDecClass GType gst_openmpt_dec_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (openmptdec); G_END_DECLS diff --git a/ext/openmpt/plugin.c b/ext/openmpt/plugin.c index 6487fa2b61..b775960788 100644 --- a/ext/openmpt/plugin.c +++ b/ext/openmpt/plugin.c @@ -29,11 +29,7 @@ static gboolean plugin_init (GstPlugin * plugin) { - gboolean ret = TRUE; - ret = ret - && gst_element_register (plugin, "openmptdec", GST_RANK_PRIMARY + 2, - gst_openmpt_dec_get_type ()); - return ret; + return GST_ELEMENT_REGISTER (openmptdec, plugin); }