From 0cd82b1b8a6702168648362c2024c4cf566a7660 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sat, 6 Mar 2021 22:09:27 +0100 Subject: [PATCH] API: remove video sink plugin selection Clapper only has and supports one video sink. I would rather replace it than forcing support for multiple plugins. --- lib/gst/clapper/gstclapper-gtk4-plugin.c | 26 ++---------------------- lib/gst/clapper/gstclapper-gtk4-plugin.h | 16 +-------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/lib/gst/clapper/gstclapper-gtk4-plugin.c b/lib/gst/clapper/gstclapper-gtk4-plugin.c index 8fc50c3b..18c14375 100644 --- a/lib/gst/clapper/gstclapper-gtk4-plugin.c +++ b/lib/gst/clapper/gstclapper-gtk4-plugin.c @@ -77,9 +77,7 @@ gst_clapper_gtk4_plugin_constructed (GObject * object) { GstClapperGtk4Plugin *self = GST_CLAPPER_GTK4_PLUGIN (object); - if (!self->video_sink) - self->video_sink = g_object_new (GST_TYPE_CLAPPER_GL_SINK, NULL); - + self->video_sink = g_object_new (GST_TYPE_CLAPPER_GL_SINK, NULL); gst_object_ref_sink (self->video_sink); G_OBJECT_CLASS (parent_class)->constructed (object); @@ -111,35 +109,15 @@ gst_clapper_gtk4_plugin_finalize (GObject * object) G_OBJECT_CLASS (parent_class)->finalize (object); } -#define C_ENUM(v) ((gint) v) - -GType -gst_clapper_gtk4_plugin_type_get_type (void) -{ - static gsize id = 0; - static const GEnumValue values[] = { - {C_ENUM (GST_CLAPPER_GTK4_PLUGIN_TYPE_GLAREA), "GST_CLAPPER_GTK4_PLUGIN_TYPE_GLAREA", "glarea"}, - {0, NULL, NULL} - }; - - if (g_once_init_enter (&id)) { - GType tmp = g_enum_register_static ("GstClapperGtk4PluginType", values); - g_once_init_leave (&id, tmp); - } - - return (GType) id; -} - /** * gst_clapper_gtk4_plugin_new: - * @plugin_type: (allow-none): Requested GstClapperGtk4PluginType * * Creates a new GTK4 plugin. * * Returns: (transfer full): the new GstClapperGtk4Plugin */ GstClapperGtk4Plugin * -gst_clapper_gtk4_plugin_new (G_GNUC_UNUSED const GstClapperGtk4PluginType plugin_type) +gst_clapper_gtk4_plugin_new (void) { return g_object_new (GST_TYPE_CLAPPER_GTK4_PLUGIN, NULL); } diff --git a/lib/gst/clapper/gstclapper-gtk4-plugin.h b/lib/gst/clapper/gstclapper-gtk4-plugin.h index a729d9f6..448045dc 100644 --- a/lib/gst/clapper/gstclapper-gtk4-plugin.h +++ b/lib/gst/clapper/gstclapper-gtk4-plugin.h @@ -26,20 +26,6 @@ G_BEGIN_DECLS -/* PluginType */ -GST_CLAPPER_API -GType gst_clapper_gtk4_plugin_type_get_type (void); -#define GST_TYPE_CLAPPER_GTK4_PLUGIN_TYPE (gst_clapper_gtk4_plugin_type_get_type ()) - -/** - * GstClapperGtk4PluginType: - * @GST_CLAPPER_GTK4_PLUGIN_TYPE_GLAREA: GTK4 GLArea sink. - */ -typedef enum -{ - GST_CLAPPER_GTK4_PLUGIN_TYPE_GLAREA, -} GstClapperGtk4PluginType; - #define GST_TYPE_CLAPPER_GTK4_PLUGIN (gst_clapper_gtk4_plugin_get_type ()) #define GST_IS_CLAPPER_GTK4_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CLAPPER_GTK4_PLUGIN)) #define GST_IS_CLAPPER_GTK4_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CLAPPER_GTK4_PLUGIN)) @@ -79,7 +65,7 @@ GST_CLAPPER_API GType gst_clapper_gtk4_plugin_get_type (void); GST_CLAPPER_API -GstClapperGtk4Plugin * gst_clapper_gtk4_plugin_new (const GstClapperGtk4PluginType plugin_type); +GstClapperGtk4Plugin * gst_clapper_gtk4_plugin_new (void); G_END_DECLS