mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
glcontext: Make gst_gl_context_egl_activate fail if the surface could not be created
Also add some error logging.
This commit is contained in:
parent
659477c7c7
commit
87a336350d
1 changed files with 14 additions and 0 deletions
|
@ -530,6 +530,13 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate)
|
||||||
eglCreateWindowSurface (egl->egl_display, egl->egl_config, handle,
|
eglCreateWindowSurface (egl->egl_display, egl->egl_config, handle,
|
||||||
NULL);
|
NULL);
|
||||||
egl->window_handle = handle;
|
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,
|
result = eglMakeCurrent (egl->egl_display, egl->egl_surface,
|
||||||
egl->egl_surface, egl->egl_context);
|
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,
|
result = eglMakeCurrent (egl->egl_display, EGL_NO_SURFACE,
|
||||||
EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue