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 739661 - GL example doesn't work on Raspberry Pi (Embedded)
GL example doesn't work on Raspberry Pi (Embedded)
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-05 10:50 UTC by Arnaud Loonstra
Modified: 2018-01-22 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example using glimagesink on a raspberry pi (10.44 KB, patch)
2014-11-20 13:10 UTC, Arnaud Loonstra
none Details | Review

Description Arnaud Loonstra 2014-11-05 10:50:44 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
Comment 1 Julien Isorce 2014-11-05 23:37:44 UTC
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!
Comment 2 Arnaud Loonstra 2014-11-06 10:11:07 UTC
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... ?
Comment 3 Julien Isorce 2014-11-06 10:25:11 UTC
git format-patch -1

I noticed that the link in "SubmittingPatches" http://gstreamer.freedesktop.org/dev/ is obsolete (http://gstreamer.freedesktop.org/wiki/SubmittingPatches)
Comment 4 Arnaud Loonstra 2014-11-20 13:10:30 UTC
Created attachment 291097 [details] [review]
example using glimagesink on a raspberry pi

Simple glesv2 example
Comment 5 Julien Isorce 2014-11-21 08:01:49 UTC
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 ...
Comment 6 Julien Isorce 2015-03-24 13:40:31 UTC
Arnaud do you plan to finalize it ? I think you was closed in the end.
Comment 7 Arnaud Loonstra 2015-03-25 08:59:57 UTC
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?
Comment 8 Julien Isorce 2015-06-09 22:47:41 UTC
Sure :)
Comment 9 Tim-Philipp Müller 2018-01-22 17:50:27 UTC
Closing this to reduce clutter in bugzilla.

Please re-open if you ever get around to updating the patch, thanks!