mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 03:23:16 +00:00
glviewconvert: fix reset context for GL context change
We need to remove GL resources from the old context instead of the new GL context. The two GL context may not even be shared.
This commit is contained in:
parent
af1986352b
commit
1abd05dbff
1 changed files with 11 additions and 2 deletions
|
@ -358,11 +358,20 @@ void
|
|||
gst_gl_view_convert_set_context (GstGLViewConvert * viewconvert,
|
||||
GstGLContext * context)
|
||||
{
|
||||
GstGLContext *old_context = NULL;
|
||||
|
||||
g_return_if_fail (GST_IS_GL_VIEW_CONVERT (viewconvert));
|
||||
|
||||
if (gst_object_replace ((GstObject **) & viewconvert->context,
|
||||
GST_OBJECT (context)))
|
||||
GST_OBJECT_LOCK (viewconvert);
|
||||
if (context != viewconvert->context) {
|
||||
gst_gl_view_convert_reset (viewconvert);
|
||||
if (viewconvert->context)
|
||||
old_context = viewconvert->context;
|
||||
viewconvert->context = context ? gst_object_ref (context) : NULL;
|
||||
}
|
||||
GST_OBJECT_UNLOCK (viewconvert);
|
||||
|
||||
gst_clear_object (&old_context);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue