diff options
author | Matthew Waters <matthew@centricular.com> | 2015-11-20 11:08:37 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2015-11-20 11:10:35 +1100 |
commit | a65fa45c2e58cb9d269dc63c1c3cf4c3ef3ebe85 (patch) | |
tree | 8077c8224e1b1060464895ee069afcd19725e6c5 /ext/qt | |
parent | 462f38f735c43fd446d881d805e67ca3a44c724c (diff) | |
download | gstreamer-plugins-bad-a65fa45c2e58cb9d269dc63c1c3cf4c3ef3ebe85.tar.gz |
qml: activate the wrapped context when binding
Mitigates the following critical
gst_gl_context_thread_add: assertion 'context->priv->active_thread == g_thread_self ()' failed
Diffstat (limited to 'ext/qt')
-rw-r--r-- | ext/qt/gstqsgtexture.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/qt/gstqsgtexture.cc b/ext/qt/gstqsgtexture.cc index 12810fafb..0986a82bb 100644 --- a/ext/qt/gstqsgtexture.cc +++ b/ext/qt/gstqsgtexture.cc @@ -87,14 +87,16 @@ GstQSGTexture::bind () GstMemory *mem; guint tex_id; + gst_gl_context_activate (this->qt_context_, TRUE); + if (!this->buffer_) - return; + goto out; if (GST_VIDEO_INFO_FORMAT (&this->v_info) == GST_VIDEO_FORMAT_UNKNOWN) - return; + goto out; this->mem_ = gst_buffer_peek_memory (this->buffer_, 0); if (!this->mem_) - return; + goto out; g_assert (this->qt_context_); gl = this->qt_context_->gl_vtable; @@ -103,7 +105,7 @@ GstQSGTexture::bind () if (!gst_video_frame_map (&this->v_frame, &this->v_info, this->buffer_, (GstMapFlags) (GST_MAP_READ | GST_MAP_GL))) { g_assert_not_reached (); - return; + goto out; } mem = gst_buffer_peek_memory (this->buffer_, 0); @@ -125,6 +127,9 @@ GstQSGTexture::bind () gl->BindTexture (GL_TEXTURE_2D, tex_id); gst_video_frame_unmap (&this->v_frame); + +out: + gst_gl_context_activate (this->qt_context_, FALSE); } /* can be called from any thread */ |