3 * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
4 * Copyright (C) 2005,2006,2007 David A. Schleef <ds@schleef.org>
5 * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
6 * Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
25 * SECTION:plugin-opengl
27 * Cross-platform OpenGL plugin.
29 * <title>Debugging</title>
32 * <title>Examples</title>
34 * gst-launch-1.0 --gst-debug=gldisplay:3 videotestsrc ! glimagesink
35 * ]| A debugging pipeline.
37 * GST_DEBUG=gl*:6 gst-launch-1.0 videotestsrc ! glimagesink
38 * ]| A debugging pipelines related to shaders.
46 #include "gstglimagesink.h"
47 #include "gstgluploadelement.h"
48 #include "gstgldownloadelement.h"
49 #include "gstglcolorconvertelement.h"
50 #include "gstglfilterbin.h"
51 #include "gstglsinkbin.h"
52 #include "gstglsrcbin.h"
53 #include "gstglmixerbin.h"
55 #include "gstglfiltercube.h"
56 #include "gstgleffects.h"
57 #include "gstglcolorscale.h"
58 #include "gstglvideomixer.h"
59 #include "gstglfiltershader.h"
60 #include "gstglfilterapp.h"
62 #include "gstgltransformation.h"
66 #include "gstgloverlay.h"
68 #endif /* HAVE_JPEG */
70 #if GST_GL_HAVE_OPENGL
71 #include "gstgltestsrc.h"
72 #include "gstglfilterglass.h"
73 /* #include "gstglfilterreflectedscreen.h" */
74 #include "gstgldeinterlace.h"
75 #include "gstglmosaic.h"
77 #include "gstgldifferencematte.h"
78 /* #include "gstglbumper.h" */
80 #endif /* GST_GL_HAVE_OPENGL */
82 #if GST_GL_HAVE_WINDOW_COCOA
83 /* avoid including Cocoa/CoreFoundation from a C file... */
84 extern GType gst_ca_opengl_layer_sink_bin_get_type (void);
91 #if GST_GL_HAVE_WINDOW_X11
95 #define GST_CAT_DEFAULT gst_gl_gstgl_debug
96 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
98 /* Register filters that make up the gstgl plugin */
100 plugin_init (GstPlugin * plugin)
102 GST_DEBUG_CATEGORY_INIT (gst_gl_gstgl_debug, "gstopengl", 0, "gstopengl");
105 GST_DEBUG ("Initialize BCM host");
109 #if GST_GL_HAVE_WINDOW_X11
110 if (g_getenv ("GST_GL_XINITTHREADS"))
114 if (!gst_element_register (plugin, "glimagesink",
115 GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type ())) {
119 if (!gst_element_register (plugin, "glupload",
120 GST_RANK_SECONDARY, GST_TYPE_GL_UPLOAD_ELEMENT)) {
124 if (!gst_element_register (plugin, "gldownload",
125 GST_RANK_SECONDARY, GST_TYPE_GL_DOWNLOAD_ELEMENT)) {
129 if (!gst_element_register (plugin, "glcolorconvert",
130 GST_RANK_SECONDARY, GST_TYPE_GL_COLOR_CONVERT_ELEMENT)) {
134 if (!gst_element_register (plugin, "glfilterbin",
135 GST_RANK_NONE, GST_TYPE_GL_FILTER_BIN)) {
139 if (!gst_element_register (plugin, "glsinkbin",
140 GST_RANK_NONE, GST_TYPE_GL_SINK_BIN)) {
144 if (!gst_element_register (plugin, "glsrcbin",
145 GST_RANK_NONE, GST_TYPE_GL_SRC_BIN)) {
149 if (!gst_element_register (plugin, "glmixerbin",
150 GST_RANK_NONE, GST_TYPE_GL_MIXER_BIN)) {
154 if (!gst_element_register (plugin, "glfiltercube",
155 GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
159 if (!gst_element_register (plugin, "gltransformation",
160 GST_RANK_NONE, GST_TYPE_GL_TRANSFORMATION)) {
164 if (!gst_element_register (plugin, "gleffects",
165 GST_RANK_NONE, gst_gl_effects_get_type ())) {
169 if (!gst_element_register (plugin, "glcolorscale",
170 GST_RANK_NONE, GST_TYPE_GL_COLORSCALE)) {
174 if (!gst_element_register (plugin, "glvideomixer",
175 GST_RANK_NONE, gst_gl_video_mixer_bin_get_type ())) {
179 if (!gst_element_register (plugin, "glshader",
180 GST_RANK_NONE, gst_gl_filtershader_get_type ())) {
184 if (!gst_element_register (plugin, "glfilterapp",
185 GST_RANK_NONE, GST_TYPE_GL_FILTER_APP)) {
190 if (!gst_element_register (plugin, "gloverlay",
191 GST_RANK_NONE, gst_gl_overlay_get_type ())) {
194 #endif /* HAVE_PNG */
195 #endif /* HAVE_JPEG */
196 #if GST_GL_HAVE_OPENGL
197 if (!gst_element_register (plugin, "gltestsrc",
198 GST_RANK_NONE, GST_TYPE_GL_TEST_SRC)) {
202 if (!gst_element_register (plugin, "glfilterglass",
203 GST_RANK_NONE, GST_TYPE_GL_FILTER_GLASS)) {
207 if (!gst_element_register (plugin, "glfilterreflectedscreen",
208 GST_RANK_NONE, GST_TYPE_GL_FILTER_REFLECTED_SCREEN)) {
212 if (!gst_element_register (plugin, "gldeinterlace",
213 GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
217 if (!gst_element_register (plugin, "glmosaic",
218 GST_RANK_NONE, GST_TYPE_GL_MOSAIC)) {
222 if (!gst_element_register (plugin, "gldifferencematte",
223 GST_RANK_NONE, gst_gl_differencematte_get_type ())) {
227 if (!gst_element_register (plugin, "glbumper",
228 GST_RANK_NONE, gst_gl_bumper_get_type ())) {
232 #endif /* HAVE_PNG */
233 #endif /* GST_GL_HAVE_OPENGL */
234 #if GST_GL_HAVE_WINDOW_COCOA
235 if (!gst_element_register (plugin, "caopengllayersink",
236 GST_RANK_NONE, gst_ca_opengl_layer_sink_bin_get_type ())) {
244 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
248 plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)