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 693665 - eglglessink: add support for Raspberry Pi
eglglessink: add support for Raspberry Pi
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-12 17:59 UTC by Julian Scheel
Modified: 2013-02-13 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
video platform wrapper for eglglessink (6.63 KB, patch)
2013-02-12 17:59 UTC, Julian Scheel
committed Details | Review

Description Julian Scheel 2013-02-12 17:59:16 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).
Comment 1 Sebastian Dröge (slomo) 2013-02-12 18:09:23 UTC
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
Comment 2 Sebastian Dröge (slomo) 2013-02-12 18:15:20 UTC
(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?
Comment 3 Julian Scheel 2013-02-12 19:55:24 UTC
(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.
Comment 4 Sebastian Dröge (slomo) 2013-02-13 14:31:38 UTC
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>