After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704498 - Doesn't compile on W32 against OpenGL
Doesn't compile on W32 against OpenGL
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other Windows
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-18 19:23 UTC by LRN
Modified: 2013-07-19 07:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description LRN 2013-07-18 19:23:44 UTC
(this probably affects other systems, not just W32, but i only have W32, so here you go...)

In file included from ../../../../gst-libs/gst/gl/gstgl_fwd.h:26:0,
                 from ../../../../gst-libs/gst/gl/gl.h:24,
                 from gstglwindow_win32.h:24,
                 from gstglwindow_win32.c:26:
../../../../gst-libs/gst/gl/glprototypes/gles1gles2.h:59:23: error: unknown type name 'GLeglImageOES'
                       GLeglImageOES    image))
                       ^
../../../../gst-libs/gst/gl/gstglapi.h:84:24: note: in definition of macro 'GST_GL_EXT_FUNCTION'
   ret GSTGLAPI (*name) args;
                        ^
../../../../gst-libs/gst/gl/glprototypes/gles1gles2.h:62:23: error: unknown type name 'GLeglImageOES'
                       GLeglImageOES    image))
                       ^
../../../../gst-libs/gst/gl/gstglapi.h:84:24: note: in definition of macro 'GST_GL_EXT_FUNCTION'
   ret GSTGLAPI (*name) args;
                        ^
make[5]: *** [libgstgl_win32_la-gstglwindow_win32.lo] Error 1

The type GLeglImageOES is from GLES/glext.h and is not present in any of the GL/*.h headers. In GLES/glext.h it is defined like this:

/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
...
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
...


A quick-and-dirty way to fix this is to add

#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
to gstglapi.h (after all GL and/or GLES headers are included)

The type is used in the prototypes of EGLImageTargetTexture2D and EGLImageTargetRenderbufferStorage.

Considering the fact that they come from gles1gles2.h (that is, functions that are only available in GLES, not in GL), it's clearly wrong to even consider them when GLES is not available. Why the contents of gles1.h, gles1gles2.h and gles2.h aren't under appropriate #ifdef?
Comment 1 Matthew Waters (ystreet00) 2013-07-19 04:49:04 UTC
(In reply to comment #0)
> make[5]: *** [libgstgl_win32_la-gstglwindow_win32.lo] Error 1
> 
> The type GLeglImageOES is from GLES/glext.h and is not present in any of the
> GL/*.h headers. In GLES/glext.h it is defined like this:
> 
> /* GL_OES_EGL_image */
> #ifndef GL_OES_EGL_image
> typedef void* GLeglImageOES;
> #endif
> ...
> /* GL_OES_EGL_image */
> #ifndef GL_OES_EGL_image
> #define GL_OES_EGL_image 1
> ...

This was taken out by 8e92f43e48cdb979c1d9581459552fa8f4723be2.  Should be replaced.

> 
> A quick-and-dirty way to fix this is to add
> 
> #ifndef GL_OES_EGL_image
> typedef void* GLeglImageOES;
> #endif
> to gstglapi.h (after all GL and/or GLES headers are included)
> 
> The type is used in the prototypes of EGLImageTargetTexture2D and
> EGLImageTargetRenderbufferStorage.
> 
> Considering the fact that they come from gles1gles2.h (that is, functions that
> are only available in GLES, not in GL), it's clearly wrong to even consider
> them when GLES is not available. Why the contents of gles1.h, gles1gles2.h and
> gles2.h aren't under appropriate #ifdef?

Because if we did that, then we would have different struct placement and sizes for the GstGLFuncs vtable (ABI). And things could blow up big time if we mix and match libgstgl with libgstopengl with different GL apis enabled.
Comment 2 Sebastian Dröge (slomo) 2013-07-19 07:21:00 UTC
commit bc09d770240030f2dc3162258a76d9b2281a6100
Author: Sebastian Dröge <slomo@circular-chaos.org>
Date:   Fri Jul 19 09:20:09 2013 +0200

    configure: Check for GLeglImageOES and others again
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704498