libs/glheaders: move object creation to the gl thread where necessary

Some GL platforms (EGL, WGL) require deactivating the OpenGL context in
one thread before it can be used in another thread which this test
currently violates and would e.g. result in EGL_BAD_ACCESS errors from
gst_gl_context_activate().

Fix by moving the object creation into the GL thread instead and not
requiring additional gst_gl_context_activate() calls.

https://bugzilla.gnome.org/show_bug.cgi?id=792158
This commit is contained in:
Matthew Waters 2018-01-03 23:11:54 +11:00
parent 9e563a20c2
commit 7cc1431a56

View file

@ -137,20 +137,19 @@ GST_START_TEST (test_constructors)
GST_END_TEST;
GST_START_TEST (test_constructors_require_activated_context)
static void
_construct_with_activated_context (GstGLContext * context, gpointer unused)
{
gboolean ret = FALSE;
GstGLFramebuffer *framebuffer = NULL;
ret = gst_gl_context_activate (context, TRUE);
fail_if (!ret);
framebuffer = gst_gl_framebuffer_new (context);
fail_if (framebuffer == NULL);
gst_object_unref (framebuffer);
}
ret = gst_gl_context_activate (context, FALSE);
fail_if (!ret);
GST_START_TEST (test_constructors_require_activated_context)
{
gst_gl_context_thread_add (context, _construct_with_activated_context, NULL);
}
GST_END_TEST;