Skip to content

Commit

Permalink
qt/gloverlay: fix using OpenGL after destroying Qml
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ystreet authored and GStreamer Merge Bot committed Jul 10, 2020
1 parent e394e6a commit 88775c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/qt/qtglrenderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 88775c2

Please sign in to comment.