GNOME Bugzilla – Bug 728890
GstGLUpload: wrong colors for YUY2 and UYVY on GLES
Last modified: 2014-05-23 06:39:46 UTC
On RPI NV12, NV21, YU2, UYVY looks correct but videotestsrc ! YUY2/UYVY ! glimagesink not. On my laptop they all look ok when using egl but I have not investigated to much.
Same here, on lib mali, YUY2, UYVY and I420 are broken.
*** Bug 730015 has been marked as a duplicate of this bug. ***
Depending on the stack and the state of ram, we see different weirdness. But generally speeking, it fails everywhere. To reproduce, that give weird result with mesa GLES2: GST_GL_API=gles2 gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2 ! glimagesink On MALI GLES2, I started seeing this error with git master: 0:00:00.704512522 6945 0xb5b01e00 ERROR default gstglutils.c:83:gst_gl_context_check_framebuffer_status: GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
However it still needs EXT_texture_rg to support it properly. bug #704222 and bug #729750. commit 2da979831ec3b1a8d993eb6f2d3999c5810c4d67 Author: Matthew Waters <ystreet00@gmail.com> Date: Wed May 21 10:26:21 2014 +1000 gl/upload: switch the 'master' texture for YUY2, UYVY From d4bcef3204709159713ff1630978ecac0bd91dc9 on, using a RGBA texture to hold the data causes the glmemory to have half width and a scaling of [2, 1]. Using a LA texture solves this problem however cannot be attached to the framebuffer for copying into a RGBA texture. Which will be solved by moving to EXT_texture_rg. https://bugzilla.gnome.org/show_bug.cgi?id=728890
Let's close this one then?
I'll update and test on my target today, sorry for the delay. Julien, would you have time to check the current state the Pi, as this was the original report ?
Created attachment 276990 [details] [review] gl/memory: implement GL_EXT_texture_rg support Ok, so to test, you'll need current master plus this patch which works with mesa's big GL but not its GLES2 implementation. According to the GLES spec, we need to provide sized internal formats (like GL_R8) instead of the unsized formats (GL_RED) to both glTexImage*, glReadPixels, etc. I am working on that.
Did a quick sanity on PC, YUY2 still seems broken, greenish image before this last patch, an solid green with it: GST_GL_API=gles2 gst-launch-1.0 videotestsrc ! video/x-raw,format=YUY2 ! glimagesink
But I confirm the patch fixes YUY2 on big GL. Are you working on a patch to re-enabled support for GLES2 ?
commit f165ece022b22cb3bd4a373edfd90741636213a8 Author: Matthew Waters <ystreet00@gmail.com> Date: Fri May 23 11:01:06 2014 +1000 gl/colorconvert: remove scratch texture for YUY2/UYVY We can get all our data from the one RG/LA texture with some shader magic. https://bugzilla.gnome.org/show_bug.cgi?id=728890
Had to rebase: commit 001b92ba129a3d263dd43eabece172b365a3f075 Author: Matthew Waters <ystreet00@gmail.com> Date: Wed May 21 21:47:45 2014 +1000 gl/memory: implement GL_EXT_texture_rg support Which is used by default over the Luminance formats due to it being color renderable with fbos (and deprecation/removal with GL 3.x). https://bugzilla.gnome.org/show_bug.cgi?id=729750 https://bugzilla.gnome.org/show_bug.cgi?id=704222 https://bugzilla.gnome.org/show_bug.cgi?id=728890 commit 26e951735508567894818160204c24dbbd76abd9 Author: Matthew Waters <ystreet00@gmail.com> Date: Fri May 23 11:01:06 2014 +1000 gl/colorconvert: remove scratch texture for YUY2/UYVY We can get all our data from the one RG/LA texture with some shader magic. https://bugzilla.gnome.org/show_bug.cgi?id=728890