From c2ccead61f522e67cc181a0b474496fedc5638b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Thu, 18 Feb 2021 09:50:21 +0100 Subject: [PATCH] libde265: 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/libde265/gstlibde265.c | 5 +---- ext/libde265/libde265-dec.c | 13 ++----------- ext/libde265/libde265-dec.h | 4 ++-- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ext/libde265/gstlibde265.c b/ext/libde265/gstlibde265.c index 0a5db69b79..3f5bbd9984 100644 --- a/ext/libde265/gstlibde265.c +++ b/ext/libde265/gstlibde265.c @@ -28,10 +28,7 @@ static gboolean plugin_init (GstPlugin * plugin) { - gboolean ret; - - ret = gst_libde265_dec_plugin_init (plugin); - return ret; + return GST_ELEMENT_REGISTER (libde265dec, plugin); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/libde265/libde265-dec.c b/ext/libde265/libde265-dec.c index 1e014a8e2c..60b7596a53 100644 --- a/ext/libde265/libde265-dec.c +++ b/ext/libde265/libde265-dec.c @@ -47,6 +47,8 @@ #define parent_class gst_libde265_dec_parent_class G_DEFINE_TYPE (GstLibde265Dec, gst_libde265_dec, GST_TYPE_VIDEO_DECODER); +GST_ELEMENT_REGISTER_DEFINE (libde265dec, "libde265dec", + GST_RANK_SECONDARY, GST_TYPE_LIBDE265_DEC); static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -872,14 +874,3 @@ error_input: gst_buffer_unmap (frame->input_buffer, &info); return GST_FLOW_ERROR; } - -gboolean -gst_libde265_dec_plugin_init (GstPlugin * plugin) -{ - /* create an elementfactory for the libde265 decoder element */ - if (!gst_element_register (plugin, "libde265dec", - GST_RANK_SECONDARY, GST_TYPE_LIBDE265_DEC)) - return FALSE; - - return TRUE; -} diff --git a/ext/libde265/libde265-dec.h b/ext/libde265/libde265-dec.h index 03b76bd2c6..ab85e1e46e 100644 --- a/ext/libde265/libde265-dec.h +++ b/ext/libde265/libde265-dec.h @@ -64,8 +64,8 @@ typedef struct _GstLibde265DecClass GType gst_libde265_dec_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (libde265dec) + G_END_DECLS -gboolean gst_libde265_dec_plugin_init (GstPlugin * plugin); - #endif /* __GST_LIBDE265_DEC_H__ */