1 /*
2  * GStreamer
3  * Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 #include <QtCore/qglobal.h>
21 #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
22 #include <QtGui/qtgui-config.h>
23 #endif
24 
25 /* qt uses the same trick as us to typedef GLsync on GLES2 but to a different
26  * type which confuses the preprocessor. Instead of trying to reconcile the
27  * two, we instead use the GLsync definition from Qt from above, and ensure
28  * that we don't typedef GLsync in gstglfuncs.h */
29 #include <gst/gl/gstglconfig.h>
30 #undef GST_GL_HAVE_GLSYNC
31 #define GST_GL_HAVE_GLSYNC 1
32 #include <gst/gl/gstglfuncs.h>
33 
34 /* The glext.h guard was renamed in 2018, but some software which
35  * includes their own copy of the GL headers (such as qt) might have
36  * older version which use the old guard. This would result in the
37  * header being included again (and symbols redefined).
38  *
39  * To avoid this, we define the "old" guard if the "new" guard is
40  * defined.*/
41 #if GST_GL_HAVE_OPENGL
42 #ifdef __gl_glext_h_
43 #ifndef __glext_h_
44 #define __glext_h_ 1
45 #endif
46 #endif
47 #endif
48 
49 #if defined(QT_OPENGL_ES_2)
50 #include <QtGui/QOpenGLContext>
51 #include <QtGui/QOpenGLFunctions>
52 #endif /* defined(QT_OPENGL_ES_2) */
53