From 7bfcfd660fccc2d6ddb7f6b6d4c548a6a5feabc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 16 Feb 2021 17:27:12 +0100 Subject: [PATCH] monoscope: 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/monoscope/gstmonoscope.c | 9 +++++---- gst/monoscope/gstmonoscope.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/monoscope/gstmonoscope.c b/gst/monoscope/gstmonoscope.c index 6ecf6bba4b..867e7ec0e0 100644 --- a/gst/monoscope/gstmonoscope.c +++ b/gst/monoscope/gstmonoscope.c @@ -75,6 +75,10 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", #define gst_monoscope_parent_class parent_class G_DEFINE_TYPE (GstMonoscope, gst_monoscope, GST_TYPE_ELEMENT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (monoscope, "monoscope", + GST_RANK_NONE, GST_TYPE_MONOSCOPE, + GST_DEBUG_CATEGORY_INIT (monoscope_debug, "monoscope", 0, + "monoscope element");); static void gst_monoscope_finalize (GObject * object); static GstFlowReturn gst_monoscope_chain (GstPad * pad, GstObject * parent, @@ -583,11 +587,8 @@ gst_monoscope_change_state (GstElement * element, GstStateChange transition) static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (monoscope_debug, "monoscope", 0, - "monoscope element"); + return GST_ELEMENT_REGISTER (monoscope, plugin); - return gst_element_register (plugin, "monoscope", - GST_RANK_NONE, GST_TYPE_MONOSCOPE); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/monoscope/gstmonoscope.h b/gst/monoscope/gstmonoscope.h index da2332713b..f8f8211483 100644 --- a/gst/monoscope/gstmonoscope.h +++ b/gst/monoscope/gstmonoscope.h @@ -78,6 +78,8 @@ struct _GstMonoscopeClass GType gst_monoscope_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (monoscope); + G_END_DECLS #endif /* __GST_MONOSCOPE__ */