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
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;