mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 18:51:11 +00:00
glbasesrc: avoid deadlock when querying for OpenGL context
Continuation of:
a4e49ba8c9
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/642
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/643>
This commit is contained in:
parent
5d47b8e232
commit
6a1e575345
1 changed files with 17 additions and 2 deletions
|
@ -261,11 +261,26 @@ gst_gl_base_src_query (GstBaseSrc * bsrc, GstQuery * query)
|
|||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_CONTEXT:
|
||||
{
|
||||
GstGLDisplay *display = NULL;
|
||||
GstGLContext *other = NULL, *local = NULL;
|
||||
gboolean ret;
|
||||
|
||||
g_rec_mutex_lock (&src->priv->context_lock);
|
||||
ret = gst_gl_handle_context_query ((GstElement *) src, query,
|
||||
src->display, src->context, src->priv->other_context);
|
||||
if (src->display)
|
||||
display = gst_object_ref (src->display);
|
||||
if (src->context)
|
||||
local = gst_object_ref (src->context);
|
||||
if (src->priv->other_context)
|
||||
other = gst_object_ref (src->priv->other_context);
|
||||
g_rec_mutex_unlock (&src->priv->context_lock);
|
||||
|
||||
ret = gst_gl_handle_context_query ((GstElement *) src, query,
|
||||
display, local, other);
|
||||
|
||||
gst_clear_object (&display);
|
||||
gst_clear_object (&other);
|
||||
gst_clear_object (&local);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue