GNOME Bugzilla – Bug 739661
GL example doesn't work on Raspberry Pi (Embedded)
Last modified: 2018-01-22 17:50:27 UTC
As the RPI needs GLES2 a shader is needed. I've created a working version for RPI which could be included as an example? Based on tests/examples/gl/generic/cube/main.cpp https://gist.github.com/sphaero/eac4d01013bd2b0e2205 Tested on latest Raspbian
Ah you made a new example, I was wondering what happened to the cube :) In any case that's great! Could you include it in gst-plugins-bad/tests/examples/gl/generic/ and provide an applicable patch ? Thx!
Ah yes I completely forgot about the cube... As I'm quite new to gstreamer development what do you mean by 'provide an applicable patch'? A diff file as an attachment, a pull request... ?
git format-patch -1 I noticed that the link in "SubmittingPatches" http://gstreamer.freedesktop.org/dev/ is obsolete (http://gstreamer.freedesktop.org/wiki/SubmittingPatches)
Created attachment 291097 [details] [review] example using glimagesink on a raspberry pi Simple glesv2 example
Review of attachment 291097 [details] [review]: Thx for submitting, see remarks. This example should be renamed (rectangle ? instead of cube), so change directory or something and make it available for both gles2 and big GL ::: tests/examples/gl/generic/gles2/gles2generic.c @@ +4,3 @@ + * Modified for Raspberry Pi/GLES2 by Arnaud Loonstra <arnaud@sphaero.org> + * Orginal by Julien Isorce <julien.isorce@gmail.com> + * Just put names like done here http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstgldisplay.c @@ +30,3 @@ + -L/opt/vc/lib/ -lgstreamer-1.0 -lgobject-2.0 \ + -lglib-2.0 -lGLESv2 -lEGL +*/ Remove this and just modify gl/generic/Makefile.am + add gl/generic/rectangle/Makefile.am and modify here http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/configure.ac#n3314 as well Also modify http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/tests/examples/gl/Makefile.am adding a case for USE_GLES2 somewhere. @@ +33,3 @@ + +#include <GLES/gl.h> +#include <GLES2/gl2.h> to remove @@ +34,3 @@ +#include <GLES/gl.h> +#include <GLES2/gl2.h> +#include <gst/gst.h> just add #include <gst/gl/gl.h> @@ +94,3 @@ + return 0; + } + return shader; I think you should just use GstGLShader api, see http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglshader.h There are various examples gl elements in ext/gl/ @@ +132,3 @@ + return GL_FALSE; + } + return GL_TRUE; Same for all of this @@ +202,3 @@ + + glClear (GL_COLOR_BUFFER_BIT); + glUseProgram (programObject); It would be "gst_gl_shader_use" using GstGLShader api @@ +225,3 @@ + +//gst-launch-1.0 videotestsrc num_buffers=400 ! video/x-raw, width=320, height=240 ! +//glgraphicmaker ! glfiltercube ! video/x-raw, width=800, height=600 ! glimagesink you can drop this @@ +307,3 @@ + gst_object_unref (pipeline); + glDeleteShader (vertexShader); + glDeleteShader (fragmentShader); It will be gst_object_unref (shader) but in any case this is wrong place to call here because no gl context is present in this thread. This is where these to signals client-reshape and client-draw are limited. There is no proper place to init or deinit. Here you could do like init, so just counting 400 frames (ref num-buffers), and call deinit on the 400th ...
Arnaud do you plan to finalize it ? I think you was closed in the end.
Ow yes, I haven't been working with 1.5 lately. Is it OK to leave this open or parked somewhere untill I manage to finish it?
Sure :)
Closing this to reduce clutter in bugzilla. Please re-open if you ever get around to updating the patch, thanks!