qt/gloverlay: fix using OpenGL after destroying Qml

Qml somewhat unhelpfully seems to uncurrent our OpenGL context on its
destruction.  Work around that by uncurrenting and recurrenting again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/632>
This commit is contained in:
Matthew Waters 2020-06-18 19:12:46 +10:00 committed by GStreamer Merge Bot
parent e394e6a034
commit 88775c2e18

View file

@ -504,6 +504,11 @@ void GstQuickRenderer::stopGL ()
if (m_sharedRenderData)
shared_render_data_unref (m_sharedRenderData);
m_sharedRenderData = NULL;
/* XXX: reset the OpenGL context and drawable as Qt may have clobbered it.
* Fixes any attempt to access OpenGL after shutting down qmlgloverlay. */
gst_gl_context_activate (gl_context, FALSE);
gst_gl_context_activate (gl_context, TRUE);
}
void GstQuickRenderer::cleanup()