wayland: fail window open if the display is the correct type
Errors out cleanly if a wayland compositor is not running
This commit is contained in:
parent
3b89d8a23c
commit
4d9ae8ebba
@ -382,9 +382,17 @@ gst_gl_window_wayland_egl_close (GstGLWindow * window)
|
|||||||
static gboolean
|
static gboolean
|
||||||
gst_gl_window_wayland_egl_open (GstGLWindow * window, GError ** error)
|
gst_gl_window_wayland_egl_open (GstGLWindow * window, GError ** error)
|
||||||
{
|
{
|
||||||
GstGLDisplayWayland *display = GST_GL_DISPLAY_WAYLAND (window->display);
|
GstGLDisplayWayland *display;
|
||||||
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
||||||
|
|
||||||
|
if (!GST_IS_GL_DISPLAY_WAYLAND (window->display)) {
|
||||||
|
g_set_error (error, GST_GL_WINDOW_ERROR,
|
||||||
|
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
||||||
|
"Failed to retrieve Wayland display (wrong type?)");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
display = GST_GL_DISPLAY_WAYLAND (window->display);
|
||||||
|
|
||||||
if (!display->display) {
|
if (!display->display) {
|
||||||
g_set_error (error, GST_GL_WINDOW_ERROR,
|
g_set_error (error, GST_GL_WINDOW_ERROR,
|
||||||
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user