From 7ab50a8e8f0e6c29b186e8c6b715418fdfdea27b Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 29 Sep 2016 11:45:57 +1000 Subject: [PATCH] tests/gl: make sure all GL commands are executed on the GL thread e.g. the final glGetError() must also be completed on the GL thread --- tests/check/libs/gstglcolorconvert.c | 9 ++++++++- tests/check/libs/gstglupload.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/check/libs/gstglcolorconvert.c b/tests/check/libs/gstglcolorconvert.c index d891c8bb0b..98ec48ff9d 100644 --- a/tests/check/libs/gstglcolorconvert.c +++ b/tests/check/libs/gstglcolorconvert.c @@ -85,14 +85,21 @@ setup (void) } static void -teardown (void) +_check_gl_error (GstGLContext * context, gpointer data) { GLuint error = context->gl_vtable->GetError (); fail_if (error != GL_NONE, "GL error 0x%x encountered during processing\n", error); +} +static void +teardown (void) +{ gst_object_unref (convert); gst_object_unref (window); + + gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _check_gl_error, + NULL); gst_object_unref (context); gst_object_unref (display); } diff --git a/tests/check/libs/gstglupload.c b/tests/check/libs/gstglupload.c index 7c52a858a8..707adb62cb 100644 --- a/tests/check/libs/gstglupload.c +++ b/tests/check/libs/gstglupload.c @@ -86,14 +86,21 @@ setup (void) } static void -teardown (void) +_check_gl_error (GstGLContext * context, gpointer data) { GLuint error = context->gl_vtable->GetError (); fail_if (error != GL_NONE, "GL error 0x%x encountered during processing\n", error); +} +static void +teardown (void) +{ gst_object_unref (upload); gst_object_unref (window); + + gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _check_gl_error, + NULL); gst_object_unref (context); gst_object_unref (display); if (shader)