mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
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
2 changed files with 3 additions and 6 deletions
|
@ -99,8 +99,6 @@ GstQSGTexture::bind ()
|
|||
if (!this->qt_context_)
|
||||
return;
|
||||
|
||||
gst_gl_context_activate (this->qt_context_, TRUE);
|
||||
|
||||
if (!this->buffer_)
|
||||
goto out;
|
||||
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_);
|
||||
}
|
||||
|
||||
gst_gl_context_activate (this->qt_context_, FALSE);
|
||||
}
|
||||
|
||||
/* can be called from any thread */
|
||||
|
|
|
@ -199,7 +199,9 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode,
|
|||
GstQSGTexture *tex;
|
||||
|
||||
g_mutex_lock (&this->priv->lock);
|
||||
gst_gl_context_activate (this->priv->other_context, TRUE);
|
||||
|
||||
if (gst_gl_context_get_current() == NULL)
|
||||
gst_gl_context_activate (this->priv->other_context, TRUE);
|
||||
|
||||
GST_TRACE ("%p updatePaintNode", this);
|
||||
|
||||
|
@ -238,7 +240,6 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode,
|
|||
|
||||
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);
|
||||
|
||||
return texNode;
|
||||
|
|
Loading…
Reference in a new issue