From fe64e68cc47d6ea7437e38963fb482edb9d1be80 Mon Sep 17 00:00:00 2001 From: Damian Hobson-Garcia Date: Tue, 19 Dec 2023 12:01:30 -0500 Subject: [PATCH] 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: --- subprojects/gst-plugins-base/ext/gl/gstgloverlay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/ext/gl/gstgloverlay.c b/subprojects/gst-plugins-base/ext/gl/gstgloverlay.c index 7fcd8e739b..9336791de2 100644 --- a/subprojects/gst-plugins-base/ext/gl/gstgloverlay.c +++ b/subprojects/gst-plugins-base/ext/gl/gstgloverlay.c @@ -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);