From 213753b9d8936d4102d78135378cb1091b6fcceb Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 16 Feb 2021 17:10:33 +0100 Subject: [PATCH] deinterlace: 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/deinterlace/gstdeinterlace.c | 20 ++++++++++++-------- gst/deinterlace/gstdeinterlace.h | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index acdfde9..d573916 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -342,6 +342,7 @@ static void gst_deinterlace_update_qos (GstDeinterlace * self, static void gst_deinterlace_reset_qos (GstDeinterlace * self); static void gst_deinterlace_read_qos (GstDeinterlace * self, gdouble * proportion, GstClockTime * time); +static gboolean deinterlace_element_init (GstPlugin * plugin); #define IS_TELECINE(m) ((m) == GST_VIDEO_INTERLACE_MODE_MIXED && self->pattern > 1) @@ -365,9 +366,9 @@ _do_init (GType object_type) } #endif -G_DEFINE_TYPE (GstDeinterlace, gst_deinterlace, GST_TYPE_ELEMENT); - #define parent_class gst_deinterlace_parent_class +G_DEFINE_TYPE (GstDeinterlace, gst_deinterlace, GST_TYPE_ELEMENT); +GST_ELEMENT_REGISTER_DEFINE_CUSTOM (deinterlace, deinterlace_element_init); static const struct { @@ -3314,8 +3315,9 @@ gst_deinterlace_src_query (GstPad * pad, GstObject * parent, GstQuery * query) return res; } + static gboolean -plugin_init (GstPlugin * plugin) +deinterlace_element_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (deinterlace_debug, "deinterlace", 0, "Deinterlacer"); @@ -3323,12 +3325,14 @@ plugin_init (GstPlugin * plugin) orc_init (); #endif - if (!gst_element_register (plugin, "deinterlace", GST_RANK_NONE, - GST_TYPE_DEINTERLACE)) { - return FALSE; - } + return gst_element_register (plugin, "deinterlace", GST_RANK_NONE, + GST_TYPE_DEINTERLACE); +} - return TRUE; +static gboolean +plugin_init (GstPlugin * plugin) +{ + return GST_ELEMENT_REGISTER (deinterlace, plugin); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/gst/deinterlace/gstdeinterlace.h b/gst/deinterlace/gstdeinterlace.h index 65b438a..e3cd4b2 100644 --- a/gst/deinterlace/gstdeinterlace.h +++ b/gst/deinterlace/gstdeinterlace.h @@ -206,6 +206,8 @@ struct _GstDeinterlaceClass GType gst_deinterlace_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (deinterlace); + G_END_DECLS #endif /* __GST_DEINTERLACE_H__ */ -- 2.7.4