diff options
-rw-r--r-- | video/out/vo_dmabuf_wayland.c | 25 | ||||
-rw-r--r-- | video/out/vo_wlshm.c | 5 | ||||
-rw-r--r-- | video/out/wayland_common.c | 6 |
3 files changed, 36 insertions, 0 deletions
diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c index a1a845bd9c..ad3202db63 100644 --- a/video/out/vo_dmabuf_wayland.c +++ b/video/out/vo_dmabuf_wayland.c @@ -329,6 +329,31 @@ static int preinit(struct vo *vo) if (!p->ctx) goto err_out; assert(p->ctx->ra); + + if (!vo->wl->dmabuf) { + MP_FATAL(vo->wl, "Compositor doesn't support the %s protocol!\n", + zwp_linux_dmabuf_v1_interface.name); + return VO_ERROR; + } + + if (!vo->wl->shm) { + MP_FATAL(vo->wl, "Compositor doesn't support the %s protocol!\n", + wl_shm_interface.name); + return VO_ERROR; + } + + if (!vo->wl->video_subsurface) { + MP_FATAL(vo->wl, "Compositor doesn't support the %s protocol!\n", + wl_subcompositor_interface.name); + return VO_ERROR; + } + + if (!vo->wl->viewport) { + MP_FATAL(vo->wl, "Compositor doesn't support the %s protocol!\n", + wp_viewporter_interface.name); + return VO_ERROR; + } + vo->hwdec_devs = hwdec_devices_create(); hwdec_devices_set_loader(vo->hwdec_devs, call_request_hwdec_api, vo); assert(!p->hwdec_ctx.ra); diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index 6064c2acc1..fc9fc705fc 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -134,6 +134,11 @@ static int preinit(struct vo *vo) if (!vo_wayland_init(vo)) return -1; + if (!vo->wl->shm) { + MP_FATAL(vo->wl, "Compositor doesn't support the %s protocol!\n", + wl_shm_interface.name); + return -1; + } p->sws = mp_sws_alloc(vo); p->sws->log = vo->log; mp_sws_enable_cmdline_opts(p->sws, vo->global); diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 7dfaff2459..18d9bba450 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1931,6 +1931,12 @@ int vo_wayland_init(struct vo *vo) /* Do a roundtrip to run the registry */ wl_display_roundtrip(wl->display); + if (!wl->surface) { + MP_FATAL(wl, "Compositor doesn't support %s (ver. 4)\n", + wl_compositor_interface.name); + return false; + } + if (!wl->wm_base) { MP_FATAL(wl, "Compositor doesn't support the required %s protocol!\n", xdg_wm_base_interface.name); |