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 729750 - gl: GL_FRAMEBUFFER_UNSUPPORTED with GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA
gl: GL_FRAMEBUFFER_UNSUPPORTED with GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal minor
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-07 21:25 UTC by Luis de Bethencourt
Modified: 2014-05-23 06:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Luis de Bethencourt 2014-05-07 21:25:00 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?
Comment 1 Luis de Bethencourt 2014-05-07 21:33:22 UTC
I meant line 677 of gst-libs/gst/gl/gstglmemory.c
Comment 2 Luis de Bethencourt 2014-05-07 21:44:49 UTC
Just a small note.

This means we fall into fbo_error in _gl_mem_copy_thread(), which sets copy_params->result to FALSE.
Comment 3 Luis de Bethencourt 2014-05-07 21:48:27 UTC
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 :)
Comment 4 Matthew Waters (ystreet00) 2014-05-08 04:19:07 UTC
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.
Comment 5 Sebastian Dröge (slomo) 2014-05-08 07:14:20 UTC
Yeah but it should be used only conditionally when the relevant extension is available. I thought we had a bug about that already :)
Comment 6 Sebastian Dröge (slomo) 2014-05-08 07:15:37 UTC
Ah, bug #704222 which had the GL_EXT_texture_rg as a fix for a very related problem too.
Comment 7 Matthew Waters (ystreet00) 2014-05-23 01:27:37 UTC
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