gldownload of RGB buffers broken on GLES 2.0 contexts
On GLES 2.0 contexts the only way to get the Pixel data is via glReadPixels. As per the spec this function supports only two valid format values:
GL_RGBA and the format returned by
GL_IMPLEMENTATION_COLOR_READ_FORMAT. Most GLES implementations allow the user to create GL_RGB textures, but will use an internal format of
GL_RGBA, as that is what the hardware supports. As
GL_IMPLEMENTATION_COLOR_READ_FORMAT is defined to return the preferred read format for the framebuffer object, those implementations will return
GL_RGBA when asked for the read format, as this is the format that allows them to implement the glReadPixels with the least amount of data transformations.
This causes the format check in gst_gl_memory_read_pixels() to fail. So while the pipeline happily negotiated
format=RGB, the gldownload is unable to download the pixel data.