gst/gl/glprototypes/gstgl_compat.h definition of GLsync conflicts with others
The gst/gl/glprototypes/gstgl_compat.h file has this logic:
#if !GST_GL_HAVE_GLSYNC typedef gpointer GLsync; #endif
Unfortunately, the real definition of GLsync in the Khronos headers is different. You might think that this is not a problem because when the Khronos headers define GLsync, GST_GL_HAVE_GLSYNC
is defined, and therefore the definition of GLsync by Gstreamer isn't used.
But when the Khronos headers do not define GLsync, and you build the Qt plugin in gst-plugins-good, what happens is that:
- GStreamer provides its replacement definition of GLsync:
typedef gpointer GLsync;
- Qt provides its replacement definition of GLsync:
typedef struct __GLsync *GLsync;
and beng, you get a build failure due to conflicting types:
.../host/arm-linucleus-linux-gnueabihf/sysroot/usr/include/gstreamer-1.0/gst/gl/glprototypes/gstgl_compat.h:40:18: error: conflicting declaration ‘typedef void* GLsync’
40 | typedef gpointer GLsync;
| ^~~~~~
.../host/arm-linucleus-linux-gnueabihf/sysroot/usr/include/qt5/QtGui/qopengles2ext.h:24:26: note: previous declaration as ‘typedef struct __GLsync* GLsync’
24 | typedef struct __GLsync *GLsync;
| ^~~~~~
The definition from Qt is the correct one, as it's the same in the Khronos headers. The definition in GStreamer however doesn't match, and therefore is probably the incorrect one.
In practice, this issue happens when building gst-plugins-good Qt's plugin, using the OpenGL implementation for RaspberryPi provided by https://github.com/raspberrypi/userland/.
Webkit has also been hit by a similar issue, due to GStreamer defining GLsync "incorrectly": https://bugs.webkit.org/show_bug.cgi?id=185639