qt/gloverlay: reset OpenGL state after Qt drawing

Reset to the original OpenGL state as required by the GStreamer OpenGL
API contract.  Fixes output with a glimagesink element downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/623>
This commit is contained in:
Matthew Waters 2020-06-12 12:18:11 +10:00 committed by GStreamer Merge Bot
parent ffe4d09efc
commit 6fba2e3dd3

View file

@ -555,6 +555,8 @@ void GstQuickRenderer::ensureFbo()
void
GstQuickRenderer::renderGstGL ()
{
const GstGLFuncs *gl = gl_context->gl_vtable;
GST_TRACE ("%p current QOpenGLContext %p", this,
QOpenGLContext::currentContext());
m_quickWindow->resetOpenGLState();
@ -585,6 +587,11 @@ GstQuickRenderer::renderGstGL ()
gl_mem = (GstGLMemory *) gst_gl_base_memory_alloc (gl_allocator, gl_params);
m_fbo = nullptr;
m_quickWindow->resetOpenGLState ();
/* Qt doesn't seem to reset this, breaking glimagesink */
if (gl->DrawBuffer)
gl->DrawBuffer (GL_BACK);
}
GstGLMemory *GstQuickRenderer::generateOutput(GstClockTime input_ns)