summaryrefslogtreecommitdiffstats
path: root/filters/f_autoconvert.c
diff options
context:
space:
mode:
authorAaron Boxer <boxerab@protonmail.com>2022-09-27 12:12:54 -0400
committerDudemanguy <random342@airmail.cc>2022-10-26 18:41:47 +0000
commit7358b9d37126e824cbc3a226d832e9cc1d7b01ea (patch)
treec477ad6f03145563f31e9877e583a9a50c4c6946 /filters/f_autoconvert.c
parent964692ad4cec90888bb437064c53d8844db9f590 (diff)
downloadmpv-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 'filters/f_autoconvert.c')
-rw-r--r--filters/f_autoconvert.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/filters/f_autoconvert.c b/filters/f_autoconvert.c
index b55673b448..fd0bb557b4 100644
--- a/filters/f_autoconvert.c
+++ b/filters/f_autoconvert.c
@@ -195,12 +195,13 @@ static bool build_image_converter(struct mp_autoconvert *c, struct mp_log *log,
bool hw_to_sw = !imgfmt_is_sw && dst_have_sw;
if (dst_all_hw && num_fmts > 0) {
+ bool upload_created = false;
+ int sw_fmt = imgfmt_is_sw ? img->imgfmt : img->params.hw_subfmt;
+
for (int i = 0; i < num_fmts; i++) {
// We can probably use this! Very lazy and very approximate.
struct mp_hwupload *upload = mp_hwupload_create(conv, fmts[i]);
if (upload) {
- int sw_fmt = imgfmt_is_sw ? img->imgfmt : img->params.hw_subfmt;
-
mp_info(log, "HW-uploading to %s\n", mp_imgfmt_to_name(fmts[i]));
filters[2] = upload->f;
hwupload_fmt = mp_hwupload_find_upload_format(upload, sw_fmt);
@@ -215,9 +216,16 @@ static bool build_image_converter(struct mp_autoconvert *c, struct mp_log *log,
mp_err(log, "Format %s is not supported by %s\n",
mp_imgfmt_to_name(sw_fmt),
mp_imgfmt_to_name(p->imgfmts[i]));
+ continue;
}
+ upload_created = true;
+ break;
}
}
+ if (!upload_created) {
+ mp_err(log, "Failed to create HW uploader for format %s\n",
+ mp_imgfmt_to_name(sw_fmt));
+ }
}
int src_fmt = img->imgfmt;