eglglessink: Fix slow path rendering on Android

Specify missing and mandatory params for npot
Before calling glTexImage2D.

In particular, _WRAP_T and _WRAP_S need to be
set to GL_CLAMP_TO_EDGE to avoid all-black
rendering with npot sized frames.
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-18 02:32:25 -03:00 committed by Sebastian Dröge
parent f33167f95b
commit c2cf1fa639

View file

@ -1494,6 +1494,15 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
* width and height values when non power of two * width and height values when non power of two
* and no npot extension available. * and no npot extension available.
*/ */
/* resizing params */
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
if (got_gl_error ("glTexParameteri"))
goto HANDLE_ERROR;
switch (eglglessink->selected_fmt->fmt) { switch (eglglessink->selected_fmt->fmt) {
case GST_EGLGLESSINK_IMAGE_RGB888: case GST_EGLGLESSINK_IMAGE_RGB888:
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB,
@ -1511,12 +1520,6 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
if (got_gl_error ("glTexImage2D")) if (got_gl_error ("glTexImage2D"))
goto HANDLE_ERROR; goto HANDLE_ERROR;
/* resizing params */
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if (got_gl_error ("glTexParameteri"))
goto HANDLE_ERROR;
/* XXX: VBO stuff this actually makes more sense on the setcaps stub? /* XXX: VBO stuff this actually makes more sense on the setcaps stub?
* The way it is right now makes this happen only for the first buffer * The way it is right now makes this happen only for the first buffer
* though so I guess it should work */ * though so I guess it should work */