We're using mp_sws here, so we should ask it for format support and not the underlying library (usually swscale) directly.
Unified · Split
| @@ -24,7 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | #include <unistd.h> |
| 25 | 25 | |
| 26 | 26 | #include <drm_fourcc.h> |
| 27 | −#include <libswscale/swscale.h> | |
| 28 | 27 | |
| 29 | 28 | #include "common/msg.h" |
| 30 | 29 | #include "drm_atomic.h" |
| @@ -422,7 +421,8 @@ err: · 391 unmodified lines | ||
| 422 | 421 | |
| 423 | 422 | static int query_format(struct vo *vo, int format) |
| 424 | 423 | { |
| 425 | − return sws_isSupportedInput(imgfmt2pixfmt(format)); | |
| 424 | + struct priv *p = vo->priv; | |
| 425 | + return mp_sws_supports_formats(p->sws, p->imgfmt, format) ? 1 : 0; | |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | static int control(struct vo *vo, uint32_t request, void *arg) |
| @@ -21,8 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <time.h> |
| 22 | 22 | #include <unistd.h> |
| 23 | 23 | |
| 24 | −#include <libswscale/swscale.h> | |
| 25 | − | |
| 26 | 24 | #include "osdep/endian.h" |
| 27 | 25 | #include "present_sync.h" |
| 28 | 26 | #include "sub/osd.h" |
| @@ -32,6 +30,8 @@ · 3 unmodified lines | ||
| 32 | 30 | #include "vo.h" |
| 33 | 31 | #include "wayland_common.h" |
| 34 | 32 | |
| 33 | +#define IMGFMT_WL_RGB MP_SELECT_LE_BE(IMGFMT_BGR0, IMGFMT_0RGB) | |
| 34 | + | |
| 35 | 35 | struct buffer { |
| 36 | 36 | struct vo *vo; |
| 37 | 37 | size_t size; |
| @@ -164,7 +164,8 @@ err: · 126 unmodified lines | ||
| 164 | 164 | |
| 165 | 165 | static int query_format(struct vo *vo, int format) |
| 166 | 166 | { |
| 167 | − return sws_isSupportedInput(imgfmt2pixfmt(format)); | |
| 167 | + struct priv *p = vo->priv; | |
| 168 | + return mp_sws_supports_formats(p->sws, IMGFMT_WL_RGB, format) ? 1 : 0; | |
| 168 | 169 | } |
| 169 | 170 | |
| 170 | 171 | static int reconfig(struct vo *vo, struct mp_image_params *params) |
| @@ -197,7 +198,7 @@ static int resize(struct vo *vo) · 26 unmodified lines | ||
| 197 | 198 | vo_get_src_dst_rects(vo, &p->src, &p->dst, &p->osd); |
| 198 | 199 | |
| 199 | 200 | p->sws->dst = (struct mp_image_params) { |
| 200 | − .imgfmt = MP_SELECT_LE_BE(IMGFMT_BGR0, IMGFMT_0RGB), | |
| 201 | + .imgfmt = IMGFMT_WL_RGB, | |
| 201 | 202 | .w = width, |
| 202 | 203 | .h = height, |
| 203 | 204 | .p_w = 1, |