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 728940 - gst-omx: port testegl example to new libgstgl
gst-omx: port testegl example to new libgstgl
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-omx
git master
Other All
: Normal normal
: 1.2.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-25 09:30 UTC by Julien Isorce
Modified: 2015-11-13 18:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glfilter: refactor template caps to make it more readable (2.38 KB, patch)
2014-04-29 18:10 UTC, Julien Isorce
accepted-commit_now Details | Review
glfilter: can output caps with memory:EGLImage feature only if it wants to preserve it (4.22 KB, patch)
2014-04-29 18:10 UTC, Julien Isorce
rejected Details | Review
glcolorscale: wants to preserve EGLImage (1015 bytes, patch)
2014-04-29 18:11 UTC, Julien Isorce
reviewed Details | Review

Description Julien Isorce 2014-04-25 09:30:28 UTC
libgstegl has been removed and libgstgl contains both egl and gl stuffs.

I have started to port http://cgit.freedesktop.org/gstreamer/gst-omx/tree/examples/egl/testegl.c from libgstegl to libgstgl here:
https://bug703343.bugzilla-attachments.gnome.org/attachment.cgi?id=272777

The remaining changed are to use GLESv2 instead of GLESv1 as there is no GLESv1 support in libgstgl.

This test will also serve as an example about how to use libgstgl with an external sink/app, see https://bugzilla.gnome.org/show_bug.cgi?id=723674
Comment 1 Julien Isorce 2014-04-29 18:10:39 UTC
Created attachment 275435 [details] [review]
glfilter: refactor template caps to make it more readable
Comment 2 Julien Isorce 2014-04-29 18:10:56 UTC
Created attachment 275436 [details] [review]
glfilter: can output caps with memory:EGLImage feature only if it wants to preserve it
Comment 3 Julien Isorce 2014-04-29 18:11:19 UTC
Created attachment 275437 [details] [review]
glcolorscale: wants to preserve EGLImage
Comment 4 Julien Isorce 2014-04-29 18:12:27 UTC
So those 3 attached patches are required to make the new gst-omx:testegl.c work which is here: http://cgit.collabora.com/git/user/julien/gst-omx.git/log/?h=port_testegl
Comment 5 Matthew Waters (ystreet00) 2014-05-01 01:19:44 UTC
Review of attachment 275435 [details] [review]:

Looks fine
Comment 6 Matthew Waters (ystreet00) 2014-05-01 01:23:40 UTC
Review of attachment 275436 [details] [review]:

I feel this could be implemented more generically rather than relying on the presence of eglimage.
Comment 7 Matthew Waters (ystreet00) 2014-05-01 01:24:35 UTC
Review of attachment 275437 [details] [review]:

Looks fine
Comment 8 Julien Isorce 2014-05-01 08:13:43 UTC
(In reply to comment #6)
> Review of attachment 275436 [details] [review]:
> 
> I feel this could be implemented more generically rather than relying on the
> presence of eglimage.

Right, also maybe later we could imagine having a glfiter that first upload the EGLImage and then apply some shaders, render the result to a gltexture and create another EGLImage from it. Don't know in which scenario it could be useful but it's possible.

1- Also maybe here for my need it should be enough to set glcolorscale to passthrough if input and ouput caps are equals.

2- We still need to do some work in glfilter because right now, on egl platform, videotestsrc ! gleffects ! glimagesink -v prints: "video/x-raw(memory:EGLImage)" between gleffects and glimagesink, whereas it should be "video/x-raw(meta:GstVideoGLTextureUploadMeta)"  :)

Speaking about that, now that EGLIMage memory has its meta upload (http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/egl/gsteglimagememory.c#n555), should it be "video/x-raw(meta:GstVideoGLTextureUploadMeta)" too ? So that we could remove "video/x-raw(memory:EGLImage)", after all there is also memory:GLMemory but we still set "video/x-raw(meta:GstVideoGLTextureUploadMeta)".
Comment 9 Sebastian Dröge (slomo) 2014-06-24 08:16:37 UTC
What's the status here?
Comment 10 Julien Isorce 2014-06-24 08:35:14 UTC
It's here http://cgit.collabora.com/git/user/julien/gst-omx.git/log/?h=port_testegl (the last 3 commits).

I remember it depends on some gstgl patches being upstream. I hope I can find time to finalize it this week.
Comment 11 Julien Isorce 2014-06-25 09:30:33 UTC
Comment on attachment 275437 [details] [review]
glcolorscale: wants to preserve EGLImage

See https://bugzilla.gnome.org/show_bug.cgi?id=732178
Comment 12 Julien Isorce 2014-06-25 09:30:54 UTC
Comment on attachment 275436 [details] [review]
glfilter: can output caps with memory:EGLImage feature only if it wants to preserve it

See https://bugzilla.gnome.org/show_bug.cgi?id=732178
Comment 13 Julien Isorce 2014-06-25 09:31:18 UTC
Comment on attachment 275435 [details] [review]
glfilter: refactor template caps to make it more readable

See https://bugzilla.gnome.org/show_bug.cgi?id=732178
Comment 14 Julien Isorce 2014-06-25 09:58:20 UTC
commit e1a1e5f3351b9eb926c4c9c9d999412bb5000ded
Author: Julien Isorce <julien.isorce@collabora.co.uk>
Date:   Fri Apr 25 13:25:05 2014 +0100

    example: enable testegl
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=728940

commit 3d0b891e42b67c108bd6604bb3e2ff9ed6faaf4a
Author: Julien Isorce <julien.isorce@collabora.co.uk>
Date:   Wed Jun 25 10:19:54 2014 +0100

    testegl: do matrix mutlplication in the shader
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=728940

commit 91c6e34217a5badfd49a76b1b333b49f69cb278f
Author: Julien Isorce <julien.isorce@collabora.co.uk>
Date:   Wed Jun 25 09:36:38 2014 +0100

    testegl: add a comment for the parse command
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=728940

commit 31cd1fd77b893c6273c447e972f1fe975d188605
Author: Julien Isorce <julien.isorce@collabora.co.uk>
Date:   Fri Apr 25 17:32:16 2014 +0100

    testegl: convert code from GLESv1 to GLESv2
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=728940

commit f1c76ef92112acc7855d5715ac149a3620559f6a
Author: Julien Isorce <julien.isorce@collabora.co.uk>
Date:   Fri Apr 25 13:21:59 2014 +0100

    testegl: port to gstgl API
    
    - append a glfilter just before fakesink
      So that we get gltexture or eglimages
    
    - propagate our EGLDisplay to the pipeline
      see GST_QUERY_CONTEXT
    
    - share our EGLContext with the iternal gl context
      of the pipeline, see GST_QUERY_ALLOCATION
    
    - use GstVideoGLTextureUploadMeta to upload
      the incoming gltexture or eglimage to our gl texture
    
    TODO: convert from GLESv1 to GLESv2
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=728940
Comment 16 minfrin 2015-10-12 00:41:24 UTC
This patch seems to have caused a regression on the Raspberry Pi:

Making all in examples
make[2]: Entering directory '/home/pi/packages/gstreamer-1.5/gst-omx/examples'
Making all in egl
make[3]: Entering directory '/home/pi/packages/gstreamer-1.5/gst-omx/examples/egl'
  CC       testegl-testegl.o
testegl.c: In function 'init_textures':
testegl.c:734:37: error: 'GL_RGBA8' undeclared (first use in this function)
     glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, meta->width, meta->height, 0,
                                     ^
testegl.c:734:37: note: each undeclared identifier is reported only once for each function it appears in
testegl.c: In function 'query_cb':
testegl.c:1081:14: error: too few arguments to function 'gst_gl_handle_context_query'
       return gst_gl_handle_context_query (state->pipeline, query,
              ^
In file included from /usr/local/include/gstreamer-1.0/gst/gl/gl.h:36:0,
                 from testegl.c:61:
/usr/local/include/gstreamer-1.0/gst/gl/gstglutils.h:102:10: note: declared here
 gboolean gst_gl_handle_context_query (GstElement * element, GstQuery * query, 
          ^
Makefile:509: recipe for target 'testegl-testegl.o' failed
make[3]: *** [testegl-testegl.o] Error 1
make[3]: Leaving directory '/home/pi/packages/gstreamer-1.5/gst-omx/examples/egl'
Makefile:463: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/pi/packages/gstreamer-1.5/gst-omx/examples'
Makefile:513: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/packages/gstreamer-1.5/gst-omx'
Makefile:444: recipe for target 'all' failed
make: *** [all] Error 2

Looks like another report of breakage here:

http://lists.freedesktop.org/archives/gstreamer-devel/2015-September/054479.html
Comment 17 minfrin 2015-11-13 18:08:03 UTC
The following patch works around this breakage:

diff --git a/examples/egl/Makefile.am b/examples/egl/Makefile.am
index 2646cba..e81945e 100644
--- a/examples/egl/Makefile.am
+++ b/examples/egl/Makefile.am
@@ -1,9 +1,5 @@
 noinst_PROGRAMS = 
 
-if USE_OMX_TARGET_RPI
-noinst_PROGRAMS += testegl
-endif
-
 testegl_SOURCES = testegl.c
 
 noinst_HEADERS = cube_texture_and_coords.h