eglglessink: Avoid repeatedly setting 2D resizing params

Moved to initial texture setup so it hapens
just once while on the same context.
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-18 14:58:43 -03:00 committed by Sebastian Dröge
parent a96fa541ee
commit a81b036355

View file

@ -1301,6 +1301,14 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink)
texlocation = glGetUniformLocation (prog, "tex");
glUniform1i (texlocation, 0);
/* Set 2D 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_LOCKED;
eglglessink->have_texture = TRUE;
g_mutex_unlock (eglglessink->flow_lock);
}
@ -1489,14 +1497,6 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
* 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,