By explictly including QtGui/qopengl.h we force the code path that
defines GLsync in the Qt-specific way. Without that, some platforms
failed to compile the qmlgl plugin, since neither Qt nor gstreamer
defined GLsync then, leading to e.g.:
```
make[4]: Entering directory '/.../gst-plugins-good-1.16.1/ext/qt'
CXX libgstqmlgl_la-qtitem.lo
In file included from gstqtgl.h:32,
from qtitem.h:27,
from qtitem.cc:28:
/.../usr/include/gstreamer-1.0/
gst/gl/gstglfuncs.h:93:17: error: expected identifier before ‘*’ token
ret (GSTGLAPI *name) args;
^
/.../usr/include/gstreamer-1.0/
gst/gl/glprototypes/sync.h:27:1: note: in expansion of macro
‘GST_GL_EXT_FUNCTION’
GST_GL_EXT_FUNCTION (GLsync, FenceSync,
^~~~~~~~~~~~~~~~~~~
```
This was originally added for fixing conflicting definitions between
Android and Qt, but times have changed and now this breaks the build
on iOS:
[...]/OpenGLES.framework/Headers/ES3/gl.h:1006:48: error: unknown type name 'gst_qt_GLsync'
GL_API void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values) OPENGLES_DEPRECATED(ios(7.0, 12.0), tvos(9.0, 12.0));
^
../ext/qt/gstqtgl.h:49:16: note: expanded from macro 'GLsync'
#define GLsync gst_qt_GLsync
^
6 errors generated.
Instead, we simply avoid defining GLsync ourselves if we're using Qt.
it is perfectly legal to use the <module/class> style of includes with Qt
and it avoids the need for having the module's include dir in the include path
In 2018 khronos changed the gl header guards. If we don't detect
this properly we would end up with plenty of symbol redifinition
(since we would be importing twice the "same" header).
Instead detect if the "newer" header was already included and if
so define the "old" define to avoid this situation
Fixes#523
Otherwise there may be no valid typedef of GLsync.
...
/usr/include/gstreamer-1.0/gst/gl/gstglfuncs.h:93:24: note: in definition of macro 'GST_GL_EXT_FUNCTION'
ret (GSTGLAPI *name) args;
^~~~
/usr/include/gstreamer-1.0/gst/gl/glprototypes/sync.h:33:23: error: 'GLsync' has not been declared
(GLsync sync))
^~~~~~
...
https://bugzilla.gnome.org/show_bug.cgi?id=796879