GNOME Bugzilla – Bug 705514
wayland: Implement YUV surfaces
Last modified: 2020-09-07 09:29:03 UTC
YUV surfaces are optional in the Wayland protocol, but it would be good to have support for them anyway.
First requires us firing Cogl into the sun, since that's basically hardcoded to not let us do anything related to YUV.
I stumbled into this while trying to run a gstreamer vaapsink pipeline in wayland/mutter: "Failed to create a texture for surface 7: Unsupported buffer format 12760", which is EGL_TEXTURE_Y_UV_WL
I 'd like to implement this by adding COGL_PIXEL_FORMAT_YUV support in cogl/mutter. Do you still think it's not recommended to add support for this in COGL?
Could a YUV->RGBA conversion shader be implemented in the cogl-gl driver for this format? Would a different solution be needed for different cogl backends (fixed, arbfp, glsl?). Alternatively could the conversion already be handled entirely in mesa?
I am not yet familiar with cogl internals, so any suggestions on implementing this are welcome.
I think cogl using a shader is the place where this needs to be handled, yes. Just make sure its not advertised if the cogl backend doesn't advertise it as supported. Doing anything in mesa doesn't help when we're not using mesa.
For reference, Rob Clark pointed out these:
plus something like:
Note: it is a gles-only extension atm
Heh, I didn't realize mutter still had open bugs on bugzilla so I missed this, but in any case: I'm working on this on my branch wip/nielsdg/add-yuv-support. There's still quite a lot do still, but at the very least, I managed to get it to work completely when buffers passed in are EGLImages.
Just so you know it exists :)
Superseeded by https://gitlab.gnome.org/GNOME/mutter/-/issues/1366.