diff options
author | Aaron Boxer <boxerab@protonmail.com> | 2022-09-27 12:12:54 -0400 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-10-26 18:41:47 +0000 |
commit | 7358b9d37126e824cbc3a226d832e9cc1d7b01ea (patch) | |
tree | c477ad6f03145563f31e9877e583a9a50c4c6946 /video/out/hwdec/hwdec_vaapi.c | |
parent | 964692ad4cec90888bb437064c53d8844db9f590 (diff) | |
download | mpv-7358b9d37126e824cbc3a226d832e9cc1d7b01ea.tar.bz2 mpv-7358b9d37126e824cbc3a226d832e9cc1d7b01ea.tar.xz |
vo_dmabuf_wayland: wayland VO displaying dmabuf buffers
Wayland VO that can display images from either vaapi or drm hwdec
The PR adds the following changes:
1. a context_wldmabuf context with no gl dependencies
2. no-op ra_wldmabuf and dmabuf_interop_wldmabuf objects
no-op because there is no need to map/unmap the drmprime buffer,
and there is no need to manage any textures.
Tested on both x86_64 and rk3399 AArch64
Diffstat (limited to 'video/out/hwdec/hwdec_vaapi.c')
-rw-r--r-- | video/out/hwdec/hwdec_vaapi.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/video/out/hwdec/hwdec_vaapi.c b/video/out/hwdec/hwdec_vaapi.c index 2161544a07..9b1d191fb4 100644 --- a/video/out/hwdec/hwdec_vaapi.c +++ b/video/out/hwdec/hwdec_vaapi.c @@ -52,7 +52,11 @@ static VADisplay *create_x11_va_display(struct ra *ra) static VADisplay *create_wayland_va_display(struct ra *ra) { struct wl_display *wl = ra_get_native_resource(ra, "wl"); - return wl ? vaGetDisplayWl(wl) : NULL; + VADisplay rc = wl ? vaGetDisplayWl(wl) : NULL; + if (rc) + ra_add_native_resource(ra, "VADisplay", rc); + + return rc; } #endif @@ -124,6 +128,9 @@ const static dmabuf_interop_init interop_inits[] = { #if HAVE_DMABUF_INTEROP_PL dmabuf_interop_pl_init, #endif +#if HAVE_DMABUF_WAYLAND + dmabuf_interop_wl_init, +#endif NULL }; @@ -217,8 +224,9 @@ static int mapper_init(struct ra_hwdec_mapper *mapper) struct ra_imgfmt_desc desc = {0}; - if (!ra_get_imgfmt_desc(mapper->ra, mapper->dst_params.imgfmt, &desc)) - return -1; + if (mapper->ra->num_formats && + !ra_get_imgfmt_desc(mapper->ra, mapper->dst_params.imgfmt, &desc)) + return -1; p->num_planes = desc.num_planes; mp_image_set_params(&p->layout, &mapper->dst_params); |