From ffe4d09efc1eaa8ea86cfad23503e47a90e2c9b8 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 12 Jun 2020 12:16:49 +1000 Subject: [PATCH] qt/gloverlay: reset current OpenGL context after Qt Qt may replace the drawable with its own which breaks output if Qt is not displaying the resulting video as used with e.g. glimagesink. Part-of: --- ext/qt/qtglrenderer.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/qt/qtglrenderer.cc b/ext/qt/qtglrenderer.cc index ddd8acf37f..9a8d75d3d6 100644 --- a/ext/qt/qtglrenderer.cc +++ b/ext/qt/qtglrenderer.cc @@ -636,6 +636,12 @@ void GstQuickRenderer::initializeGstGL () m_sharedRenderData->m_animationDriver->install(); } g_mutex_unlock (&m_sharedRenderData->lock); + /* XXX: reset the OpenGL context drawable as Qt may have clobbered it. + * Fixes glimagesink output where Qt replaces the Surface to use in its + * own MakeCurrent call. Qt does this on it's OpenGL initialisation + * the the rendering engine. */ + gst_gl_context_activate (gl_context, FALSE); + gst_gl_context_activate (gl_context, TRUE); } void GstQuickRenderer::initializeQml()