From c2cf1fa639339ac8476b8ce17b8ae7a80cafd285 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Tue, 18 Sep 2012 02:32:25 -0300 Subject: [PATCH] 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. --- ext/eglgles/gsteglglessink.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ext/eglgles/gsteglglessink.c b/ext/eglgles/gsteglglessink.c index 2c7dc1c..db16736 100644 --- a/ext/eglgles/gsteglglessink.c +++ b/ext/eglgles/gsteglglessink.c @@ -1494,6 +1494,15 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink, * width and height values when non power of two * 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) { case GST_EGLGLESSINK_IMAGE_RGB888: 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")) 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? * The way it is right now makes this happen only for the first buffer * though so I guess it should work */ -- 2.7.4