gloverlay: Apply updated overlay coordinates correctly

When overlay coordinates are updated, after the initial coordinates
are set, the shader indices are applied to the wrong buffer, resulting
in the background image appearing where the overlay should.

Bind the array buffer before applying subsequent coordinate
updates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5909>
This commit is contained in:
Damian Hobson-Garcia 2023-12-19 12:01:30 -05:00 committed by Tim-Philipp Müller
parent daa60e39f9
commit e3ff113370

View file

@ -497,6 +497,8 @@ gst_gl_overlay_callback (GstGLFilter * filter, GstGLMemory * in_tex,
gl->BindVertexArray (overlay->overlay_vao);
}
_bind_buffer (overlay, overlay->overlay_vbo);
if (overlay->geometry_change) {
gint render_width, render_height;
gfloat x, y, image_width, image_height;
@ -536,8 +538,6 @@ gst_gl_overlay_callback (GstGLFilter * filter, GstGLMemory * in_tex,
GL_STATIC_DRAW);
}
_bind_buffer (overlay, overlay->overlay_vbo);
gl->BindTexture (GL_TEXTURE_2D, image_tex);
gst_gl_shader_set_uniform_1f (overlay->shader, "alpha", overlay->alpha);