GNOME Bugzilla – Bug 693665
eglglessink: add support for Raspberry Pi
Last modified: 2013-02-13 14:32:11 UTC
Created attachment 235800 [details] [review] video platform wrapper for eglglessink Attached is a patch that adds a video platform wrapper for the Raspberry Pis/Broadcoms dispmanx display manager. Due to the ugly broadcom headers one has to build with -Werr disabled. Depending on the distribution one has to set CFLAGS to include interface/vcos/, interface/vcos/pthreads and interface/vmcs_host/linux/ within the raspberry base include paths (might be /opt/vc).
Review of attachment 235800 [details] [review]: ::: configure.ac @@ +1720,3 @@ + AC_CHECK_HEADER(bcm_host.h, [ + HAVE_EGLGLES="yes" + EGLGLES_LIBS="-lGLESv2 -lEGL -lbcm_host" You should add checks for the libraries too, similar to what is done for Mali ::: ext/eglgles/gsteglglessink.c @@ +1544,3 @@ + GST_DEBUG_OBJECT (eglglessink, "Initialize BCM host"); + bcm_host_init (); +#endif I think this should just be in plugin_init() @@ +1553,3 @@ + } +#else + if (!eglMakeCurrent (1, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) { Why is this necessary? Please add a comment
(In reply to comment #1) > Review of attachment 235800 [details] [review]: > @@ +1553,3 @@ > + } > +#else > + if (!eglMakeCurrent (1, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) { > > Why is this necessary? Please add a comment Also does it hurt to just always do it instead? And hardcoding 1 as display seems wrong, eglGetCurrentDisplay() might help here? Or maybe EGL_NO_DISPLAY?
(In reply to comment #1) > Review of attachment 235800 [details] [review]: > > ::: configure.ac > @@ +1720,3 @@ > + AC_CHECK_HEADER(bcm_host.h, [ > + HAVE_EGLGLES="yes" > + EGLGLES_LIBS="-lGLESv2 -lEGL -lbcm_host" > > You should add checks for the libraries too, similar to what is done for Mali Will try to add some. > ::: ext/eglgles/gsteglglessink.c > @@ +1544,3 @@ > + GST_DEBUG_OBJECT (eglglessink, "Initialize BCM host"); > + bcm_host_init (); > +#endif > > I think this should just be in plugin_init() Agreed, I will move it there. > @@ +1553,3 @@ > + } > +#else > + if (!eglMakeCurrent (1, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) { > > Why is this necessary? Please add a comment Yes, actually when eglMakeCurrent is not called the eglGetDisplay call causes heap corruption. See this bug in rpi firmware https://github.com/raspberrypi/firmware/issues/99. I think hardcoding to 1 was the only way I could get this to work, but I will double check.
commit d8758581671fb8289c5836b8b58424815ed493b6 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Feb 13 15:20:39 2013 +0100 eglglessink: Close the dispman display on RPi after usage commit 3876a7f9e6ab2c04f6c67a4efaa8b4ee92b372bb Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Feb 13 15:09:35 2013 +0100 eglglessink: For RPi, initialize bcm_host in plugin_init() commit b206464599c4fab706e6a6b543f675d3d3fb465b Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Feb 13 15:06:48 2013 +0100 eglglessink: Also check for all the required libraries and headers for RPi commit f337777eb50de860f5467b63a462eb9ed91fed2f Author: Julian Scheel <julian@jusst.de> Date: Tue Feb 12 18:36:10 2013 +0100 eglglessink: Add bcm/Raspberry Pi support. This adds a video platform backend for the dispmanx display manager used by broadcom and the Raspberry Pi. Signed-off-by: Julian Scheel <julian@jusst.de>