gtk: 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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/876>
This commit is contained in:
Stéphane Cerveau 2021-02-12 08:48:21 +01:00
parent 762e3c31b5
commit e4d26e69d3
5 changed files with 15 additions and 9 deletions

View file

@ -59,6 +59,9 @@ static GstStaticPadTemplate gst_gtk_gl_sink_template =
G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink,
GST_TYPE_GTK_BASE_SINK, GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_gl_sink,
"gtkglsink", 0, "Gtk GL Video Sink"));
GST_ELEMENT_REGISTER_DEFINE (gtkglsink, "gtkglsink", GST_RANK_NONE,
GST_TYPE_GTK_GL_SINK);
static void
gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass)

View file

@ -61,6 +61,8 @@ struct _GstGtkGLSink
gulong widget_destroy_sig_handler;
};
GST_ELEMENT_REGISTER_DECLARE (gtkglsink);
G_END_DECLS
#endif /* __GST_GTK_GL_SINK_H__ */

View file

@ -51,6 +51,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
G_DEFINE_TYPE_WITH_CODE (GstGtkSink, gst_gtk_sink, GST_TYPE_GTK_BASE_SINK,
GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, "gtksink", 0,
"Gtk Video Sink"));
GST_ELEMENT_REGISTER_DEFINE (gtksink, "gtksink", GST_RANK_NONE,
GST_TYPE_GTK_SINK);
static void
gst_gtk_sink_class_init (GstGtkSinkClass * klass)

View file

@ -44,6 +44,8 @@ struct _GstGtkSink
GstGtkBaseSink parent;
};
GST_ELEMENT_REGISTER_DECLARE (gtksink);
G_END_DECLS
#endif /* __GST_GTK_SINK_H__ */

View file

@ -30,18 +30,15 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "gtksink",
GST_RANK_NONE, GST_TYPE_GTK_SINK)) {
return FALSE;
}
gboolean ret = FALSE;
ret |= GST_ELEMENT_REGISTER (gtksink, plugin);
#if defined(HAVE_GTK3_GL)
if (!gst_element_register (plugin, "gtkglsink",
GST_RANK_NONE, GST_TYPE_GTK_GL_SINK)) {
return FALSE;
}
ret |= GST_ELEMENT_REGISTER (gtkglsink, plugin);
#endif
return TRUE;
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,