From cd5d4b025d63297d0f47082b25d66a00e397bfc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Fri, 11 Dec 2020 15:42:32 +0100 Subject: [PATCH] gl: 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/gl/caopengllayersink.m | 6 + ext/gl/gstglalpha.c | 3 + ext/gl/gstglbumper.c | 4 + ext/gl/gstglcolorbalance.c | 3 + ext/gl/gstglcolorconvertelement.c | 4 + ext/gl/gstglcolorscale.c | 3 + ext/gl/gstgldeinterlace.c | 3 + ext/gl/gstgldifferencematte.c | 3 + ext/gl/gstgldownloadelement.c | 3 + ext/gl/gstgleffects.c | 10 + ext/gl/gstglelement.c | 70 +++++++ ext/gl/gstglelements.h | 69 +++++++ ext/gl/gstglfilterapp.c | 3 + ext/gl/gstglfilterbin.c | 3 + ext/gl/gstglfiltercube.c | 4 + ext/gl/gstglfilterglass.c | 3 + ext/gl/gstglfilterreflectedscreen.c | 5 + ext/gl/gstglfiltershader.c | 3 + ext/gl/gstglimagesink.c | 6 + ext/gl/gstglmixerbin.c | 3 + ext/gl/gstglmosaic.c | 3 + ext/gl/gstgloverlay.c | 3 + ext/gl/gstgloverlaycompositorelement.c | 4 + ext/gl/gstglsinkbin.c | 3 + ext/gl/gstglsrcbin.c | 3 + ext/gl/gstglstereomix.c | 3 + ext/gl/gstglstereosplit.c | 3 + ext/gl/gstgltestsrc.c | 3 + ext/gl/gstgltransformation.c | 3 + ext/gl/gstgluploadelement.c | 4 + ext/gl/gstglvideoflip.c | 3 + ext/gl/gstglvideomixer.c | 7 + ext/gl/gstglviewconvert.c | 5 +- ext/gl/gstopengl.c | 266 ++++--------------------- ext/gl/meson.build | 1 + 35 files changed, 294 insertions(+), 231 deletions(-) create mode 100644 ext/gl/gstglelement.c create mode 100644 ext/gl/gstglelements.h diff --git a/ext/gl/caopengllayersink.m b/ext/gl/caopengllayersink.m index 5c7b47624f..864dd1a6dd 100644 --- a/ext/gl/caopengllayersink.m +++ b/ext/gl/caopengllayersink.m @@ -30,6 +30,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "caopengllayersink.h" #include "gstglsinkbin.h" #include @@ -43,6 +44,11 @@ typedef GstGLSinkBinClass GstCAOpenGLLayerSinkBinClass; G_DEFINE_TYPE (GstCAOpenGLLayerSinkBin, gst_ca_opengl_layer_sink_bin, GST_TYPE_GL_SINK_BIN); +#define _do_init \ + gl_element_init (plugin); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (caopengllayersink, "caopengllayersink", + GST_RANK_NONE, GST_TYPE_CA_OPENGL_LAYER_SINK, _do_init); + enum { PROP_BIN_0, diff --git a/ext/gl/gstglalpha.c b/ext/gl/gstglalpha.c index ad1e0a8e86..c8f5a870bc 100644 --- a/ext/gl/gstglalpha.c +++ b/ext/gl/gstglalpha.c @@ -45,6 +45,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglalpha.h" #include #include @@ -222,6 +223,8 @@ static void gst_gl_alpha_get_property (GObject * object, guint prop_id, #define gst_gl_alpha_parent_class parent_class G_DEFINE_TYPE (GstGLAlpha, gst_gl_alpha, GST_TYPE_GL_FILTER); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glalpha, "glalpha", + GST_RANK_NONE, GST_TYPE_GL_ALPHA, gl_element_init (plugin)); static gboolean gst_gl_alpha_is_passthrough (GstGLAlpha * glalpha) diff --git a/ext/gl/gstglbumper.c b/ext/gl/gstglbumper.c index dbf01bacda..56152a6937 100644 --- a/ext/gl/gstglbumper.c +++ b/ext/gl/gstglbumper.c @@ -39,6 +39,8 @@ #include #include + +#include "gstglelements.h" #include "gstglbumper.h" #if PNG_LIBPNG_VER >= 10400 @@ -60,6 +62,8 @@ enum G_DEFINE_TYPE_WITH_CODE (GstGLBumper, gst_gl_bumper, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glbumper, "glbumper", + GST_RANK_NONE, GST_TYPE_GL_BUMPER, gl_element_init (plugin)); static void gst_gl_bumper_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstglcolorbalance.c b/ext/gl/gstglcolorbalance.c index acee623ab5..f543a4c07c 100644 --- a/ext/gl/gstglcolorbalance.c +++ b/ext/gl/gstglcolorbalance.c @@ -43,6 +43,7 @@ #include #include +#include "gstglelements.h" #include "gstglcolorbalance.h" GST_DEBUG_CATEGORY_STATIC (glcolorbalance_debug); @@ -131,6 +132,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLColorBalance, gst_gl_color_balance, GST_TYPE_GL_FILTER, G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE, gst_gl_color_balance_colorbalance_init)); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glcolorbalance, "glcolorbalance", + GST_RANK_NONE, GST_TYPE_GL_COLOR_BALANCE, gl_element_init (plugin)); static GstCaps * gcb_transform_internal_caps (GstGLFilter * filter, diff --git a/ext/gl/gstglcolorconvertelement.c b/ext/gl/gstglcolorconvertelement.c index f9f0ad77d1..f4b3176448 100644 --- a/ext/gl/gstglcolorconvertelement.c +++ b/ext/gl/gstglcolorconvertelement.c @@ -24,6 +24,8 @@ #endif #include + +#include "gstglelements.h" #include "gstglcolorconvertelement.h" GST_DEBUG_CATEGORY_STATIC (gst_gl_color_convert_element_debug); @@ -35,6 +37,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLColorConvertElement, gst_gl_color_convert_element, GST_DEBUG_CATEGORY_INIT (gst_gl_color_convert_element_debug, "glconvertelement", 0, "convert"); ); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glcolorconvert, "glcolorconvert", + GST_RANK_NONE, GST_TYPE_GL_COLOR_CONVERT_ELEMENT, gl_element_init (plugin)); static gboolean gst_gl_color_convert_element_gl_set_caps (GstGLBaseFilter * base_filter, GstCaps * in_caps, GstCaps * out_caps); diff --git a/ext/gl/gstglcolorscale.c b/ext/gl/gstglcolorscale.c index 26fff8e605..93284bb0ba 100644 --- a/ext/gl/gstglcolorscale.c +++ b/ext/gl/gstglcolorscale.c @@ -44,6 +44,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglcolorscale.h" #define GST_CAT_DEFAULT gst_gl_colorscale_debug @@ -60,6 +61,8 @@ enum #define gst_gl_colorscale_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLColorscale, gst_gl_colorscale, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glcolorscale, "glcolorscale", + GST_RANK_NONE, GST_TYPE_GL_COLORSCALE, gl_element_init (plugin)); static void gst_gl_colorscale_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstgldeinterlace.c b/ext/gl/gstgldeinterlace.c index d98b7c9997..e65496fa16 100644 --- a/ext/gl/gstgldeinterlace.c +++ b/ext/gl/gstgldeinterlace.c @@ -38,6 +38,7 @@ #include +#include "gstglelements.h" #include "gstgldeinterlace.h" #define GST_CAT_DEFAULT gst_gl_deinterlace_debug @@ -54,6 +55,8 @@ enum #define gst_gl_deinterlace_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLDeinterlace, gst_gl_deinterlace, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gldeinterlace, "gldeinterlace", + GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE, gl_element_init (plugin)); static void gst_gl_deinterlace_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstgldifferencematte.c b/ext/gl/gstgldifferencematte.c index 69ac291ece..ff376ec109 100644 --- a/ext/gl/gstgldifferencematte.c +++ b/ext/gl/gstgldifferencematte.c @@ -41,6 +41,7 @@ #include +#include "gstglelements.h" #include "gstgldifferencematte.h" #include "effects/gstgleffectssources.h" @@ -58,6 +59,8 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); #define gst_gl_differencematte_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLDifferenceMatte, gst_gl_differencematte, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gldifferencematte, "gldifferencematte", + GST_RANK_NONE, GST_TYPE_GL_DIFFERENCEMATTE, gl_element_init (plugin)); static void gst_gl_differencematte_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstgldownloadelement.c b/ext/gl/gstgldownloadelement.c index dd8840e8c2..2b65088982 100644 --- a/ext/gl/gstgldownloadelement.c +++ b/ext/gl/gstgldownloadelement.c @@ -28,6 +28,7 @@ #include #endif +#include "gstglelements.h" #include "gstgldownloadelement.h" GST_DEBUG_CATEGORY_STATIC (gst_gl_download_element_debug); @@ -38,6 +39,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLDownloadElement, gst_gl_download_element, GST_TYPE_GL_BASE_FILTER, GST_DEBUG_CATEGORY_INIT (gst_gl_download_element_debug, "gldownloadelement", 0, "download element");); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gldownload, "gldownload", + GST_RANK_NONE, GST_TYPE_GL_DOWNLOAD_ELEMENT, gl_element_init (plugin)); static gboolean gst_gl_download_element_start (GstBaseTransform * bt); static gboolean gst_gl_download_element_stop (GstBaseTransform * bt); diff --git a/ext/gl/gstgleffects.c b/ext/gl/gstgleffects.c index 70f727a0f9..1c2c821c86 100644 --- a/ext/gl/gstgleffects.c +++ b/ext/gl/gstgleffects.c @@ -36,6 +36,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstgleffects.h" #define GST_CAT_DEFAULT gst_gl_effects_debug @@ -56,6 +57,15 @@ enum G_DEFINE_TYPE_WITH_CODE (GstGLEffects, gst_gl_effects, GST_TYPE_GL_FILTER, DEBUG_INIT); +static gboolean +gst_element_init_gleffects (GstPlugin * plugin) +{ + gl_element_init (plugin); + return gst_gl_effects_register_filters (plugin, GST_RANK_NONE); +} + +GST_ELEMENT_REGISTER_DEFINE_CUSTOM (gleffects, gst_element_init_gleffects); + static void gst_gl_effects_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_gl_effects_get_property (GObject * object, guint prop_id, diff --git a/ext/gl/gstglelement.c b/ext/gl/gstglelement.c new file mode 100644 index 0000000000..1662b7355c --- /dev/null +++ b/ext/gl/gstglelement.c @@ -0,0 +1,70 @@ +/* + * GStreamer + * Copyright (C) 2003 Julien Moutte + * Copyright (C) 2005,2006,2007 David A. Schleef + * Copyright (C) 2008 Julien Isorce + * Copyright (C) 2008 Filippo Argiolas + * Copyright (C) 2020 Huawei Technologies Co., Ltd. + * @Author: Stéphane Cerveau + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "gstglelements.h" + +#include "gstglmixerbin.h" +#include "gstglvideomixer.h" +#include "gstglstereomix.h" + +#if GST_GL_HAVE_WINDOW_COCOA +/* avoid including Cocoa/CoreFoundation from a C file... */ +extern GType gst_ca_opengl_layer_sink_bin_get_type (void); +#endif + +#if GST_GL_HAVE_WINDOW_DISPMANX +extern void bcm_host_init (void); +#endif + +#if GST_GL_HAVE_WINDOW_X11 +#include +#endif + +#define GST_CAT_DEFAULT gst_gl_gstgl_debug +GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); + +void +gl_element_init (GstPlugin * plugin) +{ + static gsize res = FALSE; + if (g_once_init_enter (&res)) { + GST_DEBUG_CATEGORY_INIT (gst_gl_gstgl_debug, "gstopengl", 0, "gstopengl"); + +#if GST_GL_HAVE_WINDOW_DISPMANX + GST_DEBUG ("Initialize BCM host"); + bcm_host_init (); +#endif + +#if GST_GL_HAVE_WINDOW_X11 + if (g_getenv ("GST_GL_XINITTHREADS")) + XInitThreads (); +#endif + g_once_init_leave (&res, TRUE); + } +} diff --git a/ext/gl/gstglelements.h b/ext/gl/gstglelements.h new file mode 100644 index 0000000000..7f560e47cf --- /dev/null +++ b/ext/gl/gstglelements.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2003 Julien Moutte + * Copyright (C) 2005,2006,2007 David A. Schleef + * Copyright (C) 2008 Julien Isorce + * Copyright (C) 2008 Filippo Argiolas + * Copyright (C) 2020 Huawei Technologies Co., Ltd. + * @Author: Julian Bouzas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_GL_ELEMENTS_H__ +#define __GST_GL_ELEMENTS_H__ + +#include + +G_BEGIN_DECLS + +G_GNUC_INTERNAL void gl_element_init (GstPlugin * plugin); + +GST_ELEMENT_REGISTER_DECLARE (glimagesink); +GST_ELEMENT_REGISTER_DECLARE (glimagesinkelement); +GST_ELEMENT_REGISTER_DECLARE (glupload); +GST_ELEMENT_REGISTER_DECLARE (gldownload); +GST_ELEMENT_REGISTER_DECLARE (glcolorconvert); +GST_ELEMENT_REGISTER_DECLARE (glcolorbalance); +GST_ELEMENT_REGISTER_DECLARE (glfilterbin); +GST_ELEMENT_REGISTER_DECLARE (glsinkbin); +GST_ELEMENT_REGISTER_DECLARE (glsrcbin); +GST_ELEMENT_REGISTER_DECLARE (glmixerbin); +GST_ELEMENT_REGISTER_DECLARE (glfiltercube); +GST_ELEMENT_REGISTER_DECLARE (gltransformation); +GST_ELEMENT_REGISTER_DECLARE (glvideoflip); +GST_ELEMENT_REGISTER_DECLARE (gleffects); +GST_ELEMENT_REGISTER_DECLARE (glcolorscale); +GST_ELEMENT_REGISTER_DECLARE (glvideomixer); +GST_ELEMENT_REGISTER_DECLARE (glvideomixerelement); +GST_ELEMENT_REGISTER_DECLARE (glshader); +GST_ELEMENT_REGISTER_DECLARE (glfilterapp); +GST_ELEMENT_REGISTER_DECLARE (glviewconvert); +GST_ELEMENT_REGISTER_DECLARE (glstereosplit); +GST_ELEMENT_REGISTER_DECLARE (glstereomix); +GST_ELEMENT_REGISTER_DECLARE (gltestsrc); +GST_ELEMENT_REGISTER_DECLARE (gldeinterlace); +GST_ELEMENT_REGISTER_DECLARE (glalpha); +GST_ELEMENT_REGISTER_DECLARE (gloverlaycompositor); +GST_ELEMENT_REGISTER_DECLARE (gloverlay); +GST_ELEMENT_REGISTER_DECLARE (glfilterglass); +GST_ELEMENT_REGISTER_DECLARE (glfilterreflectedscreen); +GST_ELEMENT_REGISTER_DECLARE (glmosaic); +GST_ELEMENT_REGISTER_DECLARE (gldifferencematte); +GST_ELEMENT_REGISTER_DECLARE (glbumper); +GST_ELEMENT_REGISTER_DECLARE (caopengllayersink); + +G_END_DECLS + +#endif /* __GST_GL_ELEMENTS_H__ */ diff --git a/ext/gl/gstglfilterapp.c b/ext/gl/gstglfilterapp.c index 042645bc49..8150810e9e 100644 --- a/ext/gl/gstglfilterapp.c +++ b/ext/gl/gstglfilterapp.c @@ -38,6 +38,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglfilterapp.h" #define GST_CAT_DEFAULT gst_gl_filter_app_debug @@ -58,6 +59,8 @@ static guint gst_gl_filter_app_signals[LAST_SIGNAL] = { 0 }; #define gst_gl_filter_app_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterApp, gst_gl_filter_app, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glfilterapp, "glfilterapp", + GST_RANK_NONE, GST_TYPE_GL_FILTER_APP, gl_element_init (plugin)); static void gst_gl_filter_app_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstglfilterbin.c b/ext/gl/gstglfilterbin.c index 46b61874f9..0c2607e5f7 100644 --- a/ext/gl/gstglfilterbin.c +++ b/ext/gl/gstglfilterbin.c @@ -22,6 +22,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglfilterbin.h" #define GST_CAT_DEFAULT gst_gl_filter_bin_debug @@ -47,6 +48,8 @@ static guint gst_gl_filter_bin_signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE_WITH_CODE (GstGLFilterBin, gst_gl_filter_bin, GST_TYPE_BIN, GST_DEBUG_CATEGORY_INIT (gst_gl_filter_bin_debug, "glfilterbin", 0, "glfilterbin element");); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glfilterbin, "glfilterbin", + GST_RANK_NONE, GST_TYPE_GL_FILTER_BIN, gl_element_init (plugin)); static void gst_gl_filter_bin_finalize (GObject * object); static void gst_gl_filter_bin_get_property (GObject * object, guint prop_id, diff --git a/ext/gl/gstglfiltercube.c b/ext/gl/gstglfiltercube.c index d82c37d4a7..1729a0619b 100644 --- a/ext/gl/gstglfiltercube.c +++ b/ext/gl/gstglfiltercube.c @@ -45,6 +45,8 @@ #endif #include + +#include "gstglelements.h" #include "gstglfiltercube.h" #include "gstglutils.h" @@ -68,6 +70,8 @@ enum #define gst_gl_filter_cube_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterCube, gst_gl_filter_cube, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glfiltercube, "glfiltercube", + GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE, gl_element_init (plugin)); static void gst_gl_filter_cube_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstglfilterglass.c b/ext/gl/gstglfilterglass.c index fef81fc4b0..7cb1b96957 100644 --- a/ext/gl/gstglfilterglass.c +++ b/ext/gl/gstglfilterglass.c @@ -43,6 +43,7 @@ #include #include +#include "gstglelements.h" #include "gstglfilterglass.h" #include "gstglutils.h" @@ -60,6 +61,8 @@ enum #define gst_gl_filter_glass_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterGlass, gst_gl_filter_glass, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glfilterglass, "glfilterglass", + GST_RANK_NONE, GST_TYPE_GL_FILTER_GLASS, gl_element_init (plugin)); static void gst_gl_filter_glass_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstglfilterreflectedscreen.c b/ext/gl/gstglfilterreflectedscreen.c index 566b28cbf2..961b6e7428 100644 --- a/ext/gl/gstglfilterreflectedscreen.c +++ b/ext/gl/gstglfilterreflectedscreen.c @@ -36,6 +36,8 @@ #endif #include + +#include "gstglelements.h" #include "gstglfilterreflectedscreen.h" #define GST_CAT_DEFAULT gst_gl_filter_reflected_screen_debug @@ -58,6 +60,9 @@ enum G_DEFINE_TYPE_WITH_CODE (GstGLFilterReflectedScreen, gst_gl_filter_reflected_screen, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glfilterreflectedscreen, + "glfilterreflectedscreen", GST_RANK_NONE, + GST_TYPE_GL_FILTER_REFLECTED_SCREEN, gl_element_init (plugin)); static void gst_gl_filter_reflected_screen_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstglfiltershader.c b/ext/gl/gstglfiltershader.c index 71a1a02318..543a27f975 100644 --- a/ext/gl/gstglfiltershader.c +++ b/ext/gl/gstglfiltershader.c @@ -58,6 +58,7 @@ #include +#include "gstglelements.h" #include "gstglfiltershader.h" #ifdef HAVE_GRAPHENE #include @@ -91,6 +92,8 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); #define gst_gl_filtershader_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterShader, gst_gl_filtershader, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glshader, "glshader", + GST_RANK_NONE, GST_TYPE_GL_FILTERSHADER, gl_element_init (plugin)); static void gst_gl_filtershader_finalize (GObject * object); static void gst_gl_filtershader_set_property (GObject * object, guint prop_id, diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 72d8ac643e..aca393252e 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -87,6 +87,7 @@ #include #include +#include "gstglelements.h" #include "gstglimagesink.h" #include "gstglsinkbin.h" #include "gstglutils.h" @@ -109,6 +110,9 @@ typedef GstGLSinkBin GstGLImageSinkBin; typedef GstGLSinkBinClass GstGLImageSinkBinClass; G_DEFINE_TYPE (GstGLImageSinkBin, gst_gl_image_sink_bin, GST_TYPE_GL_SINK_BIN); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glimagesink, "glimagesink", + GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type (), + gl_element_init (plugin)); enum { @@ -665,6 +669,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLImageSink, gst_glimage_sink, gst_glimage_sink_navigation_interface_init); GST_DEBUG_CATEGORY_INIT (gst_debug_glimage_sink, "glimagesink", 0, "OpenGL Video Sink")); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glimagesinkelement, "glimagesinkelement", + GST_RANK_NONE, gst_glimage_sink_get_type (), gl_element_init (plugin)); static void gst_glimage_sink_class_init (GstGLImageSinkClass * klass) diff --git a/ext/gl/gstglmixerbin.c b/ext/gl/gstglmixerbin.c index 4314a60134..e5c4d23cbf 100644 --- a/ext/gl/gstglmixerbin.c +++ b/ext/gl/gstglmixerbin.c @@ -25,6 +25,7 @@ #include +#include "gstglelements.h" #include "gstglmixerbin.h" #define GST_CAT_DEFAULT gst_gl_mixer_bin_debug @@ -139,6 +140,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLMixerBin, gst_gl_mixer_bin, GST_TYPE_BIN, G_ADD_PRIVATE (GstGLMixerBin) G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY, gst_gl_mixer_bin_child_proxy_init)); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glmixerbin, "glmixerbin", + GST_RANK_NONE, GST_TYPE_GL_MIXER_BIN, gl_element_init (plugin)); static guint gst_gl_mixer_bin_signals[LAST_SIGNAL] = { 0 }; diff --git a/ext/gl/gstglmosaic.c b/ext/gl/gstglmosaic.c index baf5cfc666..505782922f 100644 --- a/ext/gl/gstglmosaic.c +++ b/ext/gl/gstglmosaic.c @@ -42,6 +42,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglmosaic.h" #include "gstglutils.h" @@ -63,6 +64,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLMosaic, gst_gl_mosaic, GST_TYPE_GL_MIXER, G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY, gst_gl_mosaic_child_proxy_init); DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glmosaic, "glmosaic", + GST_RANK_NONE, GST_TYPE_GL_MOSAIC, gl_element_init (plugin)); static GstPad *gst_gl_mosaic_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * req_name, const GstCaps * caps); diff --git a/ext/gl/gstgloverlay.c b/ext/gl/gstgloverlay.c index 55ce4bca5d..7fcd8e739b 100644 --- a/ext/gl/gstgloverlay.c +++ b/ext/gl/gstgloverlay.c @@ -39,6 +39,7 @@ #include #include +#include "gstglelements.h" #include "gstgloverlay.h" #include "effects/gstgleffectssources.h" #include "gstglutils.h" @@ -65,6 +66,8 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); #define gst_gl_overlay_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLOverlay, gst_gl_overlay, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gloverlay, "gloverlay", + GST_RANK_NONE, GST_TYPE_GL_OVERLAY, gl_element_init (plugin)); static gboolean gst_gl_overlay_set_caps (GstGLFilter * filter, GstCaps * incaps, GstCaps * outcaps); diff --git a/ext/gl/gstgloverlaycompositorelement.c b/ext/gl/gstgloverlaycompositorelement.c index 946cf98926..80ba9f386a 100644 --- a/ext/gl/gstgloverlaycompositorelement.c +++ b/ext/gl/gstgloverlaycompositorelement.c @@ -30,6 +30,7 @@ #include #include +#include "gstglelements.h" #include "gstgloverlaycompositorelement.h" enum @@ -46,6 +47,9 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); #define gst_gl_overlay_compositor_element_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLOverlayCompositorElement, gst_gl_overlay_compositor_element, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gloverlaycompositor, + "gloverlaycompositor", GST_RANK_NONE, + GST_TYPE_GL_OVERLAY_COMPOSITOR_ELEMENT, gl_element_init (plugin)); static GstStaticPadTemplate overlay_sink_pad_template = GST_STATIC_PAD_TEMPLATE ("sink", diff --git a/ext/gl/gstglsinkbin.c b/ext/gl/gstglsinkbin.c index a4d3bfdf8f..70a2570db9 100644 --- a/ext/gl/gstglsinkbin.c +++ b/ext/gl/gstglsinkbin.c @@ -26,6 +26,7 @@ #include #include +#include "gstglelements.h" #include "gstglsinkbin.h" GST_DEBUG_CATEGORY (gst_debug_gl_sink_bin); @@ -105,6 +106,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLSinkBin, gst_gl_sink_bin, gst_gl_sink_bin_color_balance_init) GST_DEBUG_CATEGORY_INIT (gst_debug_gl_sink_bin, "glimagesink", 0, "OpenGL Video Sink Bin")); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glsinkbin, "glsinkbin", + GST_RANK_NONE, GST_TYPE_GL_SINK_BIN, gl_element_init (plugin)); static void gst_gl_sink_bin_class_init (GstGLSinkBinClass * klass) diff --git a/ext/gl/gstglsrcbin.c b/ext/gl/gstglsrcbin.c index fe9a0409d6..58722703e4 100644 --- a/ext/gl/gstglsrcbin.c +++ b/ext/gl/gstglsrcbin.c @@ -22,6 +22,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglsrcbin.h" GST_DEBUG_CATEGORY (gst_debug_gl_src_bin); @@ -62,6 +63,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLSrcBin, gst_gl_src_bin, GST_TYPE_BIN, GST_DEBUG_CATEGORY_INIT (gst_debug_gl_src_bin, "glsrcbin", 0, "OpenGL Video Src Bin")); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glsrcbin, "glsrcbin", + GST_RANK_NONE, GST_TYPE_GL_SRC_BIN, gl_element_init (plugin)); static void gst_gl_src_bin_class_init (GstGLSrcBinClass * klass) diff --git a/ext/gl/gstglstereomix.c b/ext/gl/gstglstereomix.c index fd9b5c39b8..bb71a2cc43 100644 --- a/ext/gl/gstglstereomix.c +++ b/ext/gl/gstglstereomix.c @@ -61,6 +61,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglstereomix.h" #define GST_CAT_DEFAULT gst_gl_stereo_mix_debug @@ -85,6 +86,8 @@ static void gst_gl_stereo_mix_child_proxy_init (gpointer g_iface, G_DEFINE_TYPE_WITH_CODE (GstGLStereoMix, gst_gl_stereo_mix, GST_TYPE_GL_MIXER, G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY, gst_gl_stereo_mix_child_proxy_init)); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glstereomix, "glstereomix", + GST_RANK_NONE, GST_TYPE_GL_STEREO_MIX, gl_element_init (plugin)); static GstCaps *_update_caps (GstVideoAggregator * vagg, GstCaps * caps); static gboolean _negotiated_caps (GstAggregator * aggregator, GstCaps * caps); diff --git a/ext/gl/gstglstereosplit.c b/ext/gl/gstglstereosplit.c index d7d0ef9bf3..283e4501c4 100644 --- a/ext/gl/gstglstereosplit.c +++ b/ext/gl/gstglstereosplit.c @@ -36,6 +36,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglstereosplit.h" #define GST_CAT_DEFAULT gst_gl_stereosplit_debug @@ -47,6 +48,8 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); G_DEFINE_TYPE_WITH_CODE (GstGLStereoSplit, gst_gl_stereosplit, GST_TYPE_ELEMENT, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glstereosplit, "glstereosplit", + GST_RANK_NONE, GST_TYPE_GL_STEREOSPLIT, gl_element_init (plugin)); static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, diff --git a/ext/gl/gstgltestsrc.c b/ext/gl/gstgltestsrc.c index a959b7da9a..b3cc83f5ea 100644 --- a/ext/gl/gstgltestsrc.c +++ b/ext/gl/gstgltestsrc.c @@ -45,6 +45,7 @@ #include #include +#include "gstglelements.h" #include "gstgltestsrc.h" #include "gltestsrc.h" @@ -74,6 +75,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", #define gst_gl_test_src_parent_class parent_class G_DEFINE_TYPE (GstGLTestSrc, gst_gl_test_src, GST_TYPE_GL_BASE_SRC); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gltestsrc, "gltestsrc", + GST_RANK_NONE, GST_TYPE_GL_TEST_SRC, gl_element_init (plugin)); static void gst_gl_test_src_set_pattern (GstGLTestSrc * gltestsrc, int pattern_type); diff --git a/ext/gl/gstgltransformation.c b/ext/gl/gstgltransformation.c index 66858a6953..a5ca2005b7 100644 --- a/ext/gl/gstgltransformation.c +++ b/ext/gl/gstgltransformation.c @@ -45,6 +45,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstgltransformation.h" #include @@ -89,6 +90,8 @@ enum G_DEFINE_TYPE_WITH_CODE (GstGLTransformation, gst_gl_transformation, GST_TYPE_GL_FILTER, DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gltransformation, "gltransformation", + GST_RANK_NONE, GST_TYPE_GL_TRANSFORMATION, gl_element_init (plugin)); static void gst_gl_transformation_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c index 1cda4c25e9..2a28ed724f 100644 --- a/ext/gl/gstgluploadelement.c +++ b/ext/gl/gstgluploadelement.c @@ -25,6 +25,8 @@ #include #include + +#include "gstglelements.h" #include "gstgluploadelement.h" GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_element_debug); @@ -35,6 +37,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLUploadElement, gst_gl_upload_element, GST_TYPE_GL_BASE_FILTER, GST_DEBUG_CATEGORY_INIT (gst_gl_upload_element_debug, "gluploadelement", 0, "glupload Element");); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glupload, "glupload", + GST_RANK_NONE, GST_TYPE_GL_UPLOAD_ELEMENT, gl_element_init (plugin)); static gboolean gst_gl_upload_element_get_unit_size (GstBaseTransform * trans, GstCaps * caps, gsize * size); diff --git a/ext/gl/gstglvideoflip.c b/ext/gl/gstglvideoflip.c index ab4b2cda82..5ace518d55 100644 --- a/ext/gl/gstglvideoflip.c +++ b/ext/gl/gstglvideoflip.c @@ -35,6 +35,7 @@ #include "config.h" #endif +#include "gstglelements.h" #include "gstglvideoflip.h" #define GST_CAT_DEFAULT gst_gl_video_flip_debug @@ -120,6 +121,8 @@ G_DEFINE_TYPE_WITH_CODE (GstGLVideoFlip, gst_gl_video_flip, "glvideoflip", 0, "glvideoflip element"); G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_DIRECTION, gst_gl_video_flip_video_direction_interface_init);); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glvideoflip, "glvideoflip", + GST_RANK_NONE, GST_TYPE_GL_VIDEO_FLIP, gl_element_init (plugin)); static void gst_gl_video_flip_video_direction_interface_init (GstVideoDirectionInterface diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c index 580598c17e..8516286117 100644 --- a/ext/gl/gstglvideomixer.c +++ b/ext/gl/gstglvideomixer.c @@ -48,6 +48,7 @@ #include #include +#include "gstglelements.h" #include "gstglvideomixer.h" #include "gstglmixerbin.h" @@ -390,6 +391,9 @@ typedef GstGLMixerBinClass GstGLVideoMixerBinClass; G_DEFINE_TYPE (GstGLVideoMixerBin, gst_gl_video_mixer_bin, GST_TYPE_GL_MIXER_BIN); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glvideomixer, "glvideomixer", + GST_RANK_NONE, gst_gl_video_mixer_bin_get_type (), + gl_element_init (plugin)); static void gst_gl_video_mixer_bin_init (GstGLVideoMixerBin * self) @@ -458,6 +462,9 @@ static void gst_gl_video_mixer_child_proxy_init (gpointer g_iface, G_DEFINE_TYPE_WITH_CODE (GstGLVideoMixer, gst_gl_video_mixer, GST_TYPE_GL_MIXER, G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY, gst_gl_video_mixer_child_proxy_init); DEBUG_INIT); +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glvideomixerelement, + "glvideomixerelement", GST_RANK_NONE, gst_gl_video_mixer_get_type (), + gl_element_init (plugin)); static void gst_gl_video_mixer_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gl/gstglviewconvert.c b/ext/gl/gstglviewconvert.c index 86cacd651d..ad89c99975 100644 --- a/ext/gl/gstglviewconvert.c +++ b/ext/gl/gstglviewconvert.c @@ -48,6 +48,7 @@ #include +#include "gstglelements.h" #include "gstglviewconvert.h" #define GST_CAT_DEFAULT gst_gl_view_convert_element_debug @@ -68,9 +69,11 @@ enum #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_view_convert_element_debug, "glview_convertelement", 0, "glview_convert element"); +#define parent_class gst_gl_view_convert_element_parent_class G_DEFINE_TYPE_WITH_CODE (GstGLViewConvertElement, gst_gl_view_convert_element, GST_TYPE_GL_FILTER, DEBUG_INIT); -#define parent_class gst_gl_view_convert_element_parent_class +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glviewconvert, "glviewconvert", + GST_RANK_NONE, GST_TYPE_GL_VIEW_CONVERT_ELEMENT, gl_element_init (plugin)); static void gst_gl_view_convert_dispose (GObject * object); static void gst_gl_view_convert_element_set_property (GObject * object, diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c index 302e8452ce..e3a8275c55 100644 --- a/ext/gl/gstopengl.c +++ b/ext/gl/gstopengl.c @@ -43,261 +43,67 @@ #include "config.h" #endif -#include "gstglimagesink.h" -#include "gstgluploadelement.h" -#include "gstgldownloadelement.h" -#include "gstglcolorconvertelement.h" -#include "gstglcolorbalance.h" -#include "gstglfilterbin.h" -#include "gstglsinkbin.h" -#include "gstglsrcbin.h" - -#include "gstglfiltercube.h" -#include "gstgleffects.h" -#include "gstglcolorscale.h" +#include "gstglelements.h" #include "gstglmixerbin.h" #include "gstglvideomixer.h" #include "gstglstereomix.h" -#include "gstglfiltershader.h" -#include "gstglfilterapp.h" -#include "gstglstereosplit.h" -#include "gstglviewconvert.h" -#include "gstgltestsrc.h" -#include "gstgldeinterlace.h" -#include "gstglalpha.h" -#include "gstgloverlaycompositorelement.h" - -#ifdef HAVE_GRAPHENE -#include "gstgltransformation.h" -#include "gstglvideoflip.h" -#endif -#if defined(HAVE_JPEG) && defined(HAVE_PNG) -#include "gstgloverlay.h" -#endif - -#include "gstglmixerbin.h" -#include "gstglvideomixer.h" -#include "gstglstereomix.h" - -#if GST_GL_HAVE_OPENGL -#endif /* GST_GL_HAVE_OPENGL */ - -#if GST_GL_HAVE_OPENGL -#include "gstglfilterglass.h" -/* #include "gstglfilterreflectedscreen.h" */ -#include "gstglmosaic.h" -#ifdef HAVE_PNG -#include "gstgldifferencematte.h" -/* #include "gstglbumper.h" */ -#endif /* HAVE_PNG */ -#endif /* GST_GL_HAVE_OPENGL */ - -#if GST_GL_HAVE_WINDOW_COCOA -/* avoid including Cocoa/CoreFoundation from a C file... */ -extern GType gst_ca_opengl_layer_sink_bin_get_type (void); -#endif - -#if GST_GL_HAVE_WINDOW_DISPMANX -extern void bcm_host_init (void); -#endif - -#if GST_GL_HAVE_WINDOW_X11 -#include -#endif - -#define GST_CAT_DEFAULT gst_gl_gstgl_debug -GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); - /* Register filters that make up the gstgl plugin */ static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (gst_gl_gstgl_debug, "gstopengl", 0, "gstopengl"); + gboolean ret = FALSE; -#if GST_GL_HAVE_WINDOW_DISPMANX - GST_DEBUG ("Initialize BCM host"); - bcm_host_init (); -#endif - -#if GST_GL_HAVE_WINDOW_X11 - if (g_getenv ("GST_GL_XINITTHREADS")) - XInitThreads (); -#endif - - if (!gst_element_register (plugin, "glimagesink", - GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type ())) { - return FALSE; - } - - if (!gst_element_register (plugin, "glimagesinkelement", - GST_RANK_NONE, gst_glimage_sink_get_type ())) { - return FALSE; - } - - if (!gst_element_register (plugin, "glupload", - GST_RANK_NONE, GST_TYPE_GL_UPLOAD_ELEMENT)) { - return FALSE; - } - - if (!gst_element_register (plugin, "gldownload", - GST_RANK_NONE, GST_TYPE_GL_DOWNLOAD_ELEMENT)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glcolorconvert", - GST_RANK_NONE, GST_TYPE_GL_COLOR_CONVERT_ELEMENT)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glcolorbalance", - GST_RANK_NONE, GST_TYPE_GL_COLOR_BALANCE)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glfilterbin", - GST_RANK_NONE, GST_TYPE_GL_FILTER_BIN)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glsinkbin", - GST_RANK_NONE, GST_TYPE_GL_SINK_BIN)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glsrcbin", - GST_RANK_NONE, GST_TYPE_GL_SRC_BIN)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glmixerbin", - GST_RANK_NONE, GST_TYPE_GL_MIXER_BIN)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glfiltercube", - GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (glimagesink, plugin); + ret |= GST_ELEMENT_REGISTER (glimagesinkelement, plugin); + ret |= GST_ELEMENT_REGISTER (glupload, plugin); + ret |= GST_ELEMENT_REGISTER (gldownload, plugin); + ret |= GST_ELEMENT_REGISTER (glcolorconvert, plugin); + ret |= GST_ELEMENT_REGISTER (glcolorbalance, plugin); + ret |= GST_ELEMENT_REGISTER (glfilterbin, plugin); + ret |= GST_ELEMENT_REGISTER (glsinkbin, plugin); + ret |= GST_ELEMENT_REGISTER (glsrcbin, plugin); + ret |= GST_ELEMENT_REGISTER (glmixerbin, plugin); + ret |= GST_ELEMENT_REGISTER (glfiltercube, plugin); #ifdef HAVE_GRAPHENE - if (!gst_element_register (plugin, "gltransformation", - GST_RANK_NONE, GST_TYPE_GL_TRANSFORMATION)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glvideoflip", - GST_RANK_NONE, GST_TYPE_GL_VIDEO_FLIP)) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (gltransformation, plugin); + ret |= GST_ELEMENT_REGISTER (glvideoflip, plugin); #endif - - if (!gst_gl_effects_register_filters (plugin, GST_RANK_NONE)) { - return FALSE; - }; - - if (!gst_element_register (plugin, "glcolorscale", - GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glvideomixer", - GST_RANK_NONE, gst_gl_video_mixer_bin_get_type ())) { - return FALSE; - } - - if (!gst_element_register (plugin, "glvideomixerelement", - GST_RANK_NONE, gst_gl_video_mixer_get_type ())) { - return FALSE; - } - - if (!gst_element_register (plugin, "glshader", - GST_RANK_NONE, gst_gl_filtershader_get_type ())) { - return FALSE; - } - - if (!gst_element_register (plugin, "glfilterapp", - GST_RANK_NONE, GST_TYPE_GL_FILTER_APP)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glviewconvert", - GST_RANK_NONE, GST_TYPE_GL_VIEW_CONVERT_ELEMENT)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glstereosplit", - GST_RANK_NONE, GST_TYPE_GL_STEREOSPLIT)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glstereomix", - GST_RANK_NONE, GST_TYPE_GL_STEREO_MIX)) { - return FALSE; - } - - if (!gst_element_register (plugin, "gltestsrc", - GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) { - return FALSE; - } - - if (!gst_element_register (plugin, "gldeinterlace", - GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) { - return FALSE; - } - - if (!gst_element_register (plugin, "glalpha", - GST_RANK_NONE, GST_TYPE_GL_ALPHA)) { - return FALSE; - } - - if (!gst_element_register (plugin, "gloverlaycompositor", - GST_RANK_NONE, GST_TYPE_GL_OVERLAY_COMPOSITOR_ELEMENT)) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (gleffects, plugin); + ret |= GST_ELEMENT_REGISTER (glcolorscale, plugin); + ret |= GST_ELEMENT_REGISTER (glvideomixer, plugin); + ret |= GST_ELEMENT_REGISTER (glvideomixerelement, plugin); + ret |= GST_ELEMENT_REGISTER (glshader, plugin); + ret |= GST_ELEMENT_REGISTER (glfilterapp, plugin); + ret |= GST_ELEMENT_REGISTER (glviewconvert, plugin); + ret |= GST_ELEMENT_REGISTER (glstereosplit, plugin); + ret |= GST_ELEMENT_REGISTER (glstereomix, plugin); + ret |= GST_ELEMENT_REGISTER (gltestsrc, plugin); + ret |= GST_ELEMENT_REGISTER (gldeinterlace, plugin); + ret |= GST_ELEMENT_REGISTER (glalpha, plugin); + ret |= GST_ELEMENT_REGISTER (gloverlaycompositor, plugin); #if defined(HAVE_JPEG) && defined(HAVE_PNG) - if (!gst_element_register (plugin, "gloverlay", - GST_RANK_NONE, gst_gl_overlay_get_type ())) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (gloverlay, plugin); #endif #if GST_GL_HAVE_OPENGL - if (!gst_element_register (plugin, "glfilterglass", - GST_RANK_NONE, GST_TYPE_GL_FILTER_GLASS)) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (glfilterglass, plugin); #if 0 - if (!gst_element_register (plugin, "glfilterreflectedscreen", - GST_RANK_NONE, GST_TYPE_GL_FILTER_REFLECTED_SCREEN)) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (glfilterreflectedscreen, plugin); #endif - - if (!gst_element_register (plugin, "glmosaic", - GST_RANK_NONE, GST_TYPE_GL_MOSAIC)) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (glmosaic, plugin); #ifdef HAVE_PNG - if (!gst_element_register (plugin, "gldifferencematte", - GST_RANK_NONE, gst_gl_differencematte_get_type ())) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (gldifferencematte, plugin); #if 0 - if (!gst_element_register (plugin, "glbumper", - GST_RANK_NONE, gst_gl_bumper_get_type ())) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (glbumper, plugin); #endif #endif /* HAVE_PNG */ #endif /* GST_GL_HAVE_OPENGL */ #if GST_GL_HAVE_WINDOW_COCOA - if (!gst_element_register (plugin, "caopengllayersink", - GST_RANK_NONE, gst_ca_opengl_layer_sink_bin_get_type ())) { - return FALSE; - } + ret |= GST_ELEMENT_REGISTER (caopengllayersink, plugin); #endif - return TRUE; + return ret; } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/gl/meson.build b/ext/gl/meson.build index 7a064261da..a0012147b6 100644 --- a/ext/gl/meson.build +++ b/ext/gl/meson.build @@ -1,5 +1,6 @@ opengl_sources = [ 'gstopengl.c', + 'gstglelement.c', 'gstglalpha.c', 'gstgluploadelement.c', 'gstgldownloadelement.c',