From 87a336350d1f68f73e50aafdd64d08fa36083429 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Thu, 16 Apr 2015 10:42:45 +0200 Subject: [PATCH] glcontext: Make gst_gl_context_egl_activate fail if the surface could not be created Also add some error logging. --- gst-libs/gst/gl/egl/gstglcontext_egl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index 97fcb40..4779d32 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -530,6 +530,13 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate) eglCreateWindowSurface (egl->egl_display, egl->egl_config, handle, NULL); egl->window_handle = handle; + + if (egl->egl_surface == EGL_NO_SURFACE) { + GST_ERROR_OBJECT (context, "Failed to create window surface: %s", + gst_gl_context_egl_get_error_string ()); + result = FALSE; + goto done; + } } result = eglMakeCurrent (egl->egl_display, egl->egl_surface, egl->egl_surface, egl->egl_context); @@ -537,6 +544,13 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate) result = eglMakeCurrent (egl->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + if (!result) { + GST_ERROR_OBJECT (context, + "Failed to bind context to the current rendering thread: %s", + gst_gl_context_egl_get_error_string ()); + } + +done: return result; } -- 2.7.4