qtgl plugins: GLsync missing from gstgl_gles2compat.h?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

qtgl plugins: GLsync missing from gstgl_gles2compat.h?

Milian Wolff
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 | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: qtgl plugins: GLsync missing from gstgl_gles2compat.h?

Matthew Waters
Hi,

This is a common build error for building the qmlgl plugins and while the hack in ext/qt/gstqtgl.h is meant to help, obviously it does not for you.  If you can find a set up of #include's and defined that works on both the RPi and on a normal desktop linux without performing rpi specific hacks, then I'd be happy to review that patch.

Cheers
-Matt

On 22/11/19 3:19 am, Milian Wolff wrote:
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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: qtgl plugins: GLsync missing from gstgl_gles2compat.h?

Milian Wolff
On Friday, November 22, 2019 5:16:27 AM CET Matthew Waters wrote:
> Hi,
>
> This is a common build error for building the qmlgl plugins and while
> the hack in ext/qt/gstqtgl.h is meant to help, obviously it does not for
> you.  If you can find a set up of #include's and defined that works on
> both the RPi and on a normal desktop linux without performing rpi
> specific hacks, then I'd be happy to review that patch.

The fix seems to be simple:

You are missing an explicit include of

#include <QtGui/qopengl.h>

in gstqtgl.h

Apparently on the other platforms, this is pulled in from elsewhere
automatically. But on my configuration at least, it isn't, and thus
qopengles2ext.h is never included and thereby GLsync never gets defined.

Could you include that fix please, or do I need to submit a patch for this?

Cheers
--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: qtgl plugins: GLsync missing from gstgl_gles2compat.h?

Matthew Waters
Can you submit a MR to
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good please.

On 25/11/19 8:58 pm, Milian Wolff wrote:

> On Friday, November 22, 2019 5:16:27 AM CET Matthew Waters wrote:
>> Hi,
>>
>> This is a common build error for building the qmlgl plugins and while
>> the hack in ext/qt/gstqtgl.h is meant to help, obviously it does not for
>> you.  If you can find a set up of #include's and defined that works on
>> both the RPi and on a normal desktop linux without performing rpi
>> specific hacks, then I'd be happy to review that patch.
> The fix seems to be simple:
>
> You are missing an explicit include of
>
> #include <QtGui/qopengl.h>
>
> in gstqtgl.h
>
> Apparently on the other platforms, this is pulled in from elsewhere
> automatically. But on my configuration at least, it isn't, and thus
> qopengles2ext.h is never included and thereby GLsync never gets defined.
>
> Could you include that fix please, or do I need to submit a patch for this?
>
> Cheers



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: qtgl plugins: GLsync missing from gstgl_gles2compat.h?

Milian Wolff
On Montag, 25. November 2019 11:21:06 CET Matthew Waters wrote:
> Can you submit a MR to
> https://gitlab.freedesktop.org/gstreamer/gst-plugins-good please.

Done at https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/
merge_requests/402

But I'm new to contributing to gstreamer - what branch should this target? For
now I left it at master, but ideally this would get backported to 1.6 and
above.

Thanks

--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment