gl/memory: RGBA/UNSIGNED_BYTE only format supported by ReadPixels GLES2

Error out in case we attempt to read with any other invalid format.
This commit is contained in:
Matthew Waters 2014-05-23 10:59:05 +10:00
parent 0c8ccd8c5f
commit 9a0129a0e4

View file

@ -758,6 +758,14 @@ _gl_mem_copy_thread (GstGLContext * context, gpointer data)
goto fbo_error;
}
if (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2
&& (in_gl_format != GL_RGBA || in_gl_type != GL_UNSIGNED_BYTE)) {
gst_gl_context_set_error (context, "Cannot copy non RGBA/UNSIGNED_BYTE "
"textures on GLES2");
gl->BindTexture (GL_TEXTURE_2D, 0);
goto fbo_error;
}
if (!src->pbo)
gl->GenBuffers (1, &src->pbo);