QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
gstqt6gl.h
Go to the documentation of this file.
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#include <gst/gl/gstglconfig.h>
26
27/* The glext.h guard was renamed in 2018, but some software which
28 * includes their own copy of the GL headers (such as qt) might have
29 * older version which use the old guard. This would result in the
30 * header being included again (and symbols redefined).
31 *
32 * To avoid this, we define the "old" guard if the "new" guard is
33 * defined.*/
34#if GST_GL_HAVE_OPENGL
35#ifdef __gl_glext_h_
36#ifndef __glext_h_
37#define __glext_h_ 1
38#endif
39#endif
40#endif
41
42/* pulls in GLsync, see below */
43#include <QtGui/qopengl.h>
44
45/* qt uses the same trick as us to typedef GLsync on GLES2 but to a different
46 * type which confuses the preprocessor. Instead of trying to reconcile the
47 * two, we instead use the GLsync definition from Qt from above, and ensure
48 * that we don't typedef GLsync in gstglfuncs.h */
49#undef GST_GL_HAVE_GLSYNC
50#define GST_GL_HAVE_GLSYNC 1
51#include <gst/gl/gstglfuncs.h>
52
53#if defined(QT_OPENGL_ES_2)
54#include <QtGui/QOpenGLContext>
55#include <QtGui/QOpenGLFunctions>
56#endif /* defined(QT_OPENGL_ES_2) */