qtgl plugins: GLsync missing from gstgl_gles2compat.h?

Milian Wolff milian.wolff at kdab.com
Thu Nov 21 16:19:39 UTC 2019


Hey there,

when trying to cross compile gst-plugins-good-1.16.1 for a raspberry pi 3b+ I 
see the following compile errors:

```
make[4]: Entering directory '/path/to/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:
/path/to/sdk/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/path/to/sdk/
sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/usr/include/gstreamer-1.0/
gst/gl/gstglfuncs.h:93:17: error: expected identifier before ‘*’ token
   ret (GSTGLAPI *name) args;
                 ^
/path/to/sdk/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/path/to/sdk/
sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/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,
 ^~~~~~~~~~~~~~~~~~~
/path/to/sdk/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/path/to/sdk/
sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/usr/include/gstreamer-1.0/
gst/gl/glprototypes/sync.h:29:39: error: ISO C++ forbids declaration of 
‘GLsync’ with no type [-fpermissive]
                       GLbitfield flags))
                                       ^
/path/to/sdk/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/path/to/sdk/
sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/usr/include/gstreamer-1.0/
gst/gl/gstglfuncs.h:93:24: note: in definition of macro ‘GST_GL_EXT_FUNCTION’
   ret (GSTGLAPI *name) args;
                        ^~~~
/path/to/sdk/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/path/to/sdk/
sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/usr/include/gstreamer-1.0/
gst/gl/glprototypes/sync.h:29:39: error: ‘GLsync’ declared as function 
returning a function
                       GLbitfield flags))
...
```

Note that this is using `include/gstreamer-1.0/gst/gl/glprototypes/
gstgl_gles2compat.h` which has no GLsync in it.

In the non-gles2 version of this header I see

```
#if !GST_GL_HAVE_GLSYNC
typedef gpointer GLsync;
#endif
```

Copying that over to the gles2 header doesn't fix it, and indeed that's 
probably due to the following hack in ext/qt/gstqtgl.h:

```
/* qt uses the same trick as us to typedef GLsync on GLES2 but to a different
 * type which confuses the preprocessor. Instead of trying to reconcile the
 * two, we instead use the GLsync definition from Qt from above, and ensure
 * that we don't typedef GLsync in gstglfuncs.h */
#include <gst/gl/gstglconfig.h>
#undef GST_GL_HAVE_GLSYNC
#define GST_GL_HAVE_GLSYNC 1
#include <gst/gl/gstglfuncs.h>
```

If I instead add the `typedef gpointer GLsync` forward without the macro check 
for GST_GL_HAVE_GLSYNC, then compilation succeeds.

So it seems my Qt 5.13.0 headers don't define GLsync anymore? Has anyone run 
into this and knows how to handle this issue correctly?

Thanks
-- 
Milian Wolff | milian.wolff at kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3826 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191121/fe0d5e60/attachment.bin>


More information about the gstreamer-devel mailing list