diff options
author | sfan5 <sfan5@live.de> | 2024-03-11 21:13:39 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2024-03-16 13:27:34 +0100 |
commit | 830f6ccd6bcd8bdffc4e2c8d8f1a3e1be25f0a1d (patch) | |
tree | 822850558da2fe8736339a30f0098e9d8ceead01 | |
parent | aa75a0e9d29e401dd048f6ec077b8c3c4129efee (diff) | |
download | mpv-830f6ccd6bcd8bdffc4e2c8d8f1a3e1be25f0a1d.tar.bz2 mpv-830f6ccd6bcd8bdffc4e2c8d8f1a3e1be25f0a1d.tar.xz |
vo_{drm,wlshm}: make query_format checks more correct
We're using mp_sws here, so we should ask it for format support
and not the underlying library (usually swscale) directly.
-rw-r--r-- | video/out/vo_drm.c | 4 | ||||
-rw-r--r-- | video/out/vo_wlshm.c | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c index 7fc75193c7..34726a3c02 100644 --- a/video/out/vo_drm.c +++ b/video/out/vo_drm.c @@ -24,7 +24,6 @@ #include <unistd.h> #include <drm_fourcc.h> -#include <libswscale/swscale.h> #include "common/msg.h" #include "drm_atomic.h" @@ -422,7 +421,8 @@ err: static int query_format(struct vo *vo, int format) { - return sws_isSupportedInput(imgfmt2pixfmt(format)); + struct priv *p = vo->priv; + return mp_sws_supports_formats(p->sws, p->imgfmt, format) ? 1 : 0; } static int control(struct vo *vo, uint32_t request, void *arg) diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index d2aa11d0ad..0b63426a23 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -21,8 +21,6 @@ #include <time.h> #include <unistd.h> -#include <libswscale/swscale.h> - #include "osdep/endian.h" #include "present_sync.h" #include "sub/osd.h" @@ -32,6 +30,8 @@ #include "vo.h" #include "wayland_common.h" +#define IMGFMT_WL_RGB MP_SELECT_LE_BE(IMGFMT_BGR0, IMGFMT_0RGB) + struct buffer { struct vo *vo; size_t size; @@ -164,7 +164,8 @@ err: static int query_format(struct vo *vo, int format) { - return sws_isSupportedInput(imgfmt2pixfmt(format)); + struct priv *p = vo->priv; + return mp_sws_supports_formats(p->sws, IMGFMT_WL_RGB, format) ? 1 : 0; } static int reconfig(struct vo *vo, struct mp_image_params *params) @@ -197,7 +198,7 @@ static int resize(struct vo *vo) vo_get_src_dst_rects(vo, &p->src, &p->dst, &p->osd); p->sws->dst = (struct mp_image_params) { - .imgfmt = MP_SELECT_LE_BE(IMGFMT_BGR0, IMGFMT_0RGB), + .imgfmt = IMGFMT_WL_RGB, .w = width, .h = height, .p_w = 1, |