mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 10:59:39 +00:00
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:
parent
a96fa541ee
commit
a81b036355
1 changed files with 8 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue