qt: don't always activate/deactivate our GstGLContext
Techincally it is enough to activate at the beginning and then forget.
This commit is contained in:
parent
73cd4477af
commit
21acf312f0
@ -99,8 +99,6 @@ GstQSGTexture::bind ()
|
|||||||
if (!this->qt_context_)
|
if (!this->qt_context_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gst_gl_context_activate (this->qt_context_, TRUE);
|
|
||||||
|
|
||||||
if (!this->buffer_)
|
if (!this->buffer_)
|
||||||
goto out;
|
goto out;
|
||||||
if (GST_VIDEO_INFO_FORMAT (&this->v_info) == GST_VIDEO_FORMAT_UNKNOWN)
|
if (GST_VIDEO_INFO_FORMAT (&this->v_info) == GST_VIDEO_FORMAT_UNKNOWN)
|
||||||
@ -174,8 +172,6 @@ out:
|
|||||||
|
|
||||||
funcs->glBindTexture (GL_TEXTURE_2D, this->dummy_tex_id_);
|
funcs->glBindTexture (GL_TEXTURE_2D, this->dummy_tex_id_);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_gl_context_activate (this->qt_context_, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* can be called from any thread */
|
/* can be called from any thread */
|
||||||
|
@ -199,6 +199,8 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode,
|
|||||||
GstQSGTexture *tex;
|
GstQSGTexture *tex;
|
||||||
|
|
||||||
g_mutex_lock (&this->priv->lock);
|
g_mutex_lock (&this->priv->lock);
|
||||||
|
|
||||||
|
if (gst_gl_context_get_current() == NULL)
|
||||||
gst_gl_context_activate (this->priv->other_context, TRUE);
|
gst_gl_context_activate (this->priv->other_context, TRUE);
|
||||||
|
|
||||||
GST_TRACE ("%p updatePaintNode", this);
|
GST_TRACE ("%p updatePaintNode", this);
|
||||||
@ -238,7 +240,6 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode,
|
|||||||
|
|
||||||
texNode->setRect (QRectF (result.x, result.y, result.w, result.h));
|
texNode->setRect (QRectF (result.x, result.y, result.w, result.h));
|
||||||
|
|
||||||
gst_gl_context_activate (this->priv->other_context, FALSE);
|
|
||||||
g_mutex_unlock (&this->priv->lock);
|
g_mutex_unlock (&this->priv->lock);
|
||||||
|
|
||||||
return texNode;
|
return texNode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user