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 740530 - gstglapi.h:42:21: fatal error: EGL/egl.h: No such file or directory
gstglapi.h:42:21: fatal error: EGL/egl.h: No such file or directory
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.4
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-22 14:45 UTC by Arnaud Loonstra
Modified: 2014-12-11 08:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config.log from raspbian on a rpi (386.85 KB, text/x-log)
2014-11-24 12:17 UTC, Arnaud Loonstra
Details
config.log from a rpi (387.13 KB, text/x-log)
2014-11-27 11:57 UTC, Arnaud Loonstra
Details

Description Arnaud Loonstra 2014-11-22 14:45:35 UTC
Trying to compile the 1.4 branch on a Raspberry Pi is giving the following errors:

In file included from ../gstgl_fwd.h:26:0,
                 from gstglwindow_dispmanx_egl.c:27:
../../../../gst-libs/gst/gl/gstglapi.h:42:21: fatal error: EGL/egl.h: No such file or directory

I can get around it by doing 

make CPPFLAGS+='-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux'

However I already did

LDFLAGS='-L/opt/vc/lib' CFLAGS='-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' ./autogen.sh --disable-gtk-doc --disable-examples

So I did not expect this for running make as well?

Am I missing something or is this a bug in automake setup?
Comment 1 Arnaud Loonstra 2014-11-22 15:17:02 UTC
After build I'm getting the following error:

(gst-plugin-scanner:1930): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstopengl.so': /opt/vc/lib/libEGL.so: undefined symbol: glPointSizePointerOES

doing :

LD_PRELOAD=/opt/vc/lib/libGLESv2.so gst-inspect-1.0

gives:
(gst-plugin-scanner:1970): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstopengl.so': /usr/local/lib/libgstgl-1.0.so.0: undefined symbol: gst_gl_context_glx_new

** (gst-plugin-scanner:1970): ERROR **: Could not get Gst.Element

** (gst-plugin-scanner:1971): ERROR **: Could not get Gst.Element

Isn't glx the X OpenGL extension?
Comment 2 Matthew Waters (ystreet00) 2014-11-22 23:10:25 UTC
There's a difference between CFLAGS=blah ./autogen.sh and ./autogen.sh CFLAGS=blah.  The second form places the flags inside the automake files where as the first form requires that you pass the flags to make as well.

> '/usr/local/lib/gstreamer-1.0/libgstopengl.so': /opt/vc/lib/libEGL.so:
> undefined symbol: glPointSizePointerOES

This suggests that you need to set LD_LIBRARY_PATH to include /opt/vc/lib so that the libraries can find each other.

> '/usr/local/lib/gstreamer-1.0/libgstopengl.so':
> /usr/local/lib/libgstgl-1.0.so.0: undefined symbol: gst_gl_context_glx_new

Obviously it found some x11/glx files on your system and is trying to use them.  You can disable them by passing --disable-glx --disable-x11 to ./configure.  A config.log would be helpful in determining what it found.
Comment 3 Arnaud Loonstra 2014-11-23 15:50:40 UTC
K, that makes sense however passing these vars like that to autogen.sh results in 
configure: error: unrecognized option: `-I/opt/vc/include/interface/vcos/pthreads'
Try `./configure --help' for more information
  configure failed

It chokes on the spaces...
Comment 4 Matthew Waters (ystreet00) 2014-11-24 00:56:23 UTC
You probably need to surround the flags with an extra pair of quotes or some other shell escaping for autogen.sh or you could pass the flags to configure directly.
Comment 5 Arnaud Loonstra 2014-11-24 08:46:25 UTC
Yeah, I tried many types of escaping haven't found a working one yet. I did get it to compile again passing the vars to make directly. Still seeing linking errors 

Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstopengl.so': /opt/vc/lib/libEGL.so: undefined symbol: glPointSizePointerOES

which are resolved by doing

LD_PRELOAD=/opt/vc/lib/libGLESv2.so gst-inspect-1.0

The env contains
LD_LIBRARY_PATH=/usr/local/lib/:/opt/vc/lib

I don't understand why it does link 
I didn't have this much trouble when building the latest from git?

I'm using a script to build gstreamer completely:
https://gist.github.com/sphaero/02717b0b35501ad94863

Here's troublesome plugins-bad
https://gist.github.com/sphaero/02717b0b35501ad94863#file-gstreamer-build-sh-L112

Here's troublesome omx:
https://gist.github.com/sphaero/02717b0b35501ad94863#file-gstreamer-build-sh-L141
Comment 6 Matthew Waters (ystreet00) 2014-11-24 10:07:41 UTC
Are there any libGLESv2.so/libEGL.so, etc in /usr/local/lib because if there is, that will be used before the ones in /opt/vc/lib
Comment 7 Arnaud Loonstra 2014-11-24 10:17:59 UTC
nope, I also noticed that it didn't build GLES2 support.
I'm adding --enable-egl --enable-gles2
However I expected that to be detected...
Comment 8 Arnaud Loonstra 2014-11-24 11:23:36 UTC
It conflicts with the mesa provided includes in raspbian.

$ make CFLAGS+="-Wno-error -Wno-redundant-decls -I/opt/vc/include -I/opt/vc/include/interface/vc
os/pthreads -I/opt/vc/include/interface/vmcs_host/linux" \
>   CPPFLAGS+="-Wno-error -Wno-redundant-decls -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmc
s_host/linux" \
>   CXXFLAGS+="-Wno-redundant-decls" LDFLAGS+="-L/opt/vc/lib"
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/pi/src/gstreamer/gst-plugins-bad/missing --run autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/bash ./config.status config.h  
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory '/home/pi/src/gstreamer/gst-plugins-bad'
Making all in gst-libs
make[2]: Entering directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs'
Making all in gst
make[3]: Entering directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs/gst'
Making all in interfaces
make[4]: Entering directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs/gst/interfaces'
make  all-am
make[5]: Entering directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs/gst/gl/dispmanx'
  CC     libgstgl_dispmanx_la-gstglwindow_dispmanx_egl.lo
In file included from ../../../../gst-libs/gst/gl/gstglapi.h:61:0,
                 from ../gstgl_fwd.h:26,
                 from gstglwindow_dispmanx_egl.c:27:
/opt/vc/include/GLES2/gl2.h:65:26: error: conflicting types for 'GLintptr'
../../../../gst-libs/gst/gl/glprototypes/gstgl_compat.h:37:19: note: previous declaration of 'GLintptr' was here
/opt/vc/include/GLES2/gl2.h:66:26: error: conflicting types for 'GLsizeiptr'
../../../../gst-libs/gst/gl/glprototypes/gstgl_compat.h:34:19: note: previous declaration of 'GLsizeiptr' was here
In file included from /usr/include/GL/gl.h:2085:0,
                 from ../../../../gst-libs/gst/gl/gstglapi.h:80,
                 from ../gstgl_fwd.h:26,
                 from gstglwindow_dispmanx_egl.c:27:
/usr/include/GL/glext.h:5327:19: error: conflicting types for 'GLintptr'
/opt/vc/include/GLES2/gl2.h:65:26: note: previous declaration of 'GLintptr' was here
/usr/include/GL/glext.h:5328:19: error: conflicting types for 'GLsizeiptr'
/opt/vc/include/GLES2/gl2.h:66:26: note: previous declaration of 'GLsizeiptr' was here
In file included from /usr/include/GL/gl.h:2085:0,
                 from ../../../../gst-libs/gst/gl/gstglapi.h:80,
                 from ../gstgl_fwd.h:26,
                 from gstglwindow_dispmanx_egl.c:27:
/usr/include/GL/glext.h:5728:21: error: conflicting types for 'glBufferData'
/opt/vc/include/GLES2/gl2.h:514:37: note: previous declaration of 'glBufferData' was here
/usr/include/GL/glext.h:5729:21: error: conflicting types for 'glBufferSubData'
/opt/vc/include/GLES2/gl2.h:515:37: note: previous declaration of 'glBufferSubData' was here
Makefile:743: recipe for target 'libgstgl_dispmanx_la-gstglwindow_dispmanx_egl.lo' failed
make[5]: *** [libgstgl_dispmanx_la-gstglwindow_dispmanx_egl.lo] Error 1
make[5]: Leaving directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs/gst/gl/dispmanx'
Makefile:1107: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs/gst/gl'
Makefile:706: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs/gst'
Makefile:695: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/pi/src/gstreamer/gst-plugins-bad/gst-libs'
Makefile:860: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/src/gstreamer/gst-plugins-bad'
Makefile:788: recipe for target 'all' failed
make: *** [all] Error 2
Comment 9 Matthew Waters (ystreet00) 2014-11-24 11:33:33 UTC
Please attach the generated config.log file to this bug.
Comment 10 Arnaud Loonstra 2014-11-24 12:17:36 UTC
Created attachment 291351 [details]
config.log from raspbian on a rpi
Comment 11 Matthew Waters (ystreet00) 2014-11-24 13:29:00 UTC
Heh, it's not disabling desktop GL support fully.  You can workaround that by explicitly passing --disable-opengl to configure which means you don't need the --enable-egl --enable-gles2 flags anymore.
Comment 12 Arnaud Loonstra 2014-11-24 18:22:43 UTC
K, I finally got a successful execution. 

Although I think LDFLAGS+="-L/opt/vc/lib/ -lGLESv2 -lEGL" shouldn't be necessary, right?

Weird that I didn't have so much trouble for git latest.

I'm going to try a full clean build once more.
Comment 13 Sebastian Dröge (slomo) 2014-11-25 09:17:21 UTC
You might need LDFLAGS+="-L/opt/vc/lib" and maybe CPPFLAGS+="-I/opt/vc/include" (and maybe the same for CFLAGS), but the "-lGLESv2 -lEGL" should not be needed.

Can you provide a config.log with setting the above (but not -lGLESv2 -lEGL)?
Comment 14 Arnaud Loonstra 2014-11-27 11:57:20 UTC
Created attachment 291632 [details]
config.log from a rpi

./autogen.sh --disable-gtk-doc --disable-examples --disable-x11 --disable-glx --disable-glx --disable-opengl

see install script: https://gist.github.com/sphaero/02717b0b35501ad94863
Comment 15 Matthew Waters (ystreet00) 2014-11-27 12:14:57 UTC
That looks good, does it work? :)
Comment 16 Arnaud Loonstra 2014-11-27 12:58:52 UTC
gst-launch-1.0 -v filesrc location=test.h264 ! decodebin ! queue ! glimagesink

running smooth, ~35% cpu. That's good :) 
(omxplayer does <19% however)

I still have test more omx pipelines as I'm having trouble with pipelines like:

gst-launch-1.0 -v udpsrc port=5000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! decodebin ! queue ! glimagesink sync=false

and a sender from a desktop: gst-launch-1.0 ximagesrc use-damage=false ! videoconvert ! x264enc ! rtph264pay ! udpsink host=nellie port=5000
Comment 17 Arnaud Loonstra 2014-11-27 12:59:45 UTC
Ow btw that example pipeline just gives a green screen with a tiny square in the top left showing random colors
Comment 18 Matthew Waters (ystreet00) 2014-12-09 02:48:09 UTC
That seems to work here without omx.  If you could open a bug against gst-omx with your results of what works/doesn't that would be great.
Comment 19 Arnaud Loonstra 2014-12-09 19:13:32 UTC
Already fixed, the rpi can't handle h264 levels beyond 4.1. Thnx for assistance!