GNOME Bugzilla – Bug 729750
gl: GL_FRAMEBUFFER_UNSUPPORTED with GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA
Last modified: 2014-05-23 06:40:08 UTC
When I run make check in gst-plugins-bad. I get: ERROR default gstglutils.c:72:gst_gl_context_check_framebuffer_status: GL_FRAMEBUFFER_UNSUPPORTED In test_basic for the two following types: GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA, GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE Some research indicates that: It fails in tests/check/libs/gstglmemory.c line 85: mem2 = gst_memory_copy (mem, 0, -1); because gstglutils.c:72:gst_gl_context_check_framebuffer_status() returns GL_FRAMEBUFFER_UNSUPPORTED which is called from _gl_mem_copy_thread(), gst-libs/gst/gl/gstglmemory.c line 667 So why does trying to copy the memory of gl_mem with these types fails with unsupported bufer?
I meant line 677 of gst-libs/gst/gl/gstglmemory.c
Just a small note. This means we fall into fbo_error in _gl_mem_copy_thread(), which sets copy_params->result to FALSE.
If we remove the check for gst_gl_context_check_framebuffer_status (src->context)). The rest of checks in the test case succeed! Memory is copied fine and parameter testing goes fine. So the main question now is, why is the status GL_FRAMEBUFFER_UNSUPPORTED and why doesn't this seem to be correct? Once I understand that I can write a patch to fix it :)
GL_FRAMEBUFFER_UNSUPPORTED is returned because LUMINANCE formats are not color renderable and so cannot be used as color attachments for fbos. The fix is to move to GL_EXT_texture_rg which in the current state should be reasonably simple.
Yeah but it should be used only conditionally when the relevant extension is available. I thought we had a bug about that already :)
Ah, bug #704222 which had the GL_EXT_texture_rg as a fix for a very related problem too.
This avoids the problem when supported :) 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