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 | #include <unistd.h> | 24 | #include <unistd.h> |
| 25 | 25 | ||
| 26 | #include <drm_fourcc.h> | 26 | #include <drm_fourcc.h> |
| 27 | #include <libswscale/swscale.h> | ||
| 28 | 27 | ||
| 29 | #include "common/msg.h" | 28 | #include "common/msg.h" |
| 30 | #include "drm_atomic.h" | 29 | #include "drm_atomic.h" |
| @@ -422,7 +421,8 @@ err: · 391 unmodified lines | |||
| 422 | 421 | ||
| 423 | static int query_format(struct vo *vo, int format) | 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 | static int control(struct vo *vo, uint32_t request, void *arg) | 428 | static int control(struct vo *vo, uint32_t request, void *arg) |
| @@ -21,8 +21,6 @@ · 20 unmodified lines | |||
| 21 | #include <time.h> | 21 | #include <time.h> |
| 22 | #include <unistd.h> | 22 | #include <unistd.h> |
| 23 | 23 | ||
| 24 | #include <libswscale/swscale.h> | ||
| 25 | |||
| 26 | #include "osdep/endian.h" | 24 | #include "osdep/endian.h" |
| 27 | #include "present_sync.h" | 25 | #include "present_sync.h" |
| 28 | #include "sub/osd.h" | 26 | #include "sub/osd.h" |
| @@ -32,6 +30,8 @@ · 3 unmodified lines | |||
| 32 | #include "vo.h" | 30 | #include "vo.h" |
| 33 | #include "wayland_common.h" | 31 | #include "wayland_common.h" |
| 34 | 32 | ||
| 33 | #define IMGFMT_WL_RGB MP_SELECT_LE_BE(IMGFMT_BGR0, IMGFMT_0RGB) | ||
| 34 | |||
| 35 | struct buffer { | 35 | struct buffer { |
| 36 | struct vo *vo; | 36 | struct vo *vo; |
| 37 | size_t size; | 37 | size_t size; |
| @@ -164,7 +164,8 @@ err: · 126 unmodified lines | |||
| 164 | 164 | ||
| 165 | static int query_format(struct vo *vo, int format) | 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 | static int reconfig(struct vo *vo, struct mp_image_params *params) | 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 | vo_get_src_dst_rects(vo, &p->src, &p->dst, &p->osd); | 198 | vo_get_src_dst_rects(vo, &p->src, &p->dst, &p->osd); |
| 198 | 199 | ||
| 199 | p->sws->dst = (struct mp_image_params) { | 200 | p->sws->dst = (struct mp_image_params) { |
| 200 | .imgfmt = MP_SELECT_LE_BE(IMGFMT_BGR0, IMGFMT_0RGB), | 201 | .imgfmt = IMGFMT_WL_RGB, |
| 201 | .w = width, | 202 | .w = width, |
| 202 | .h = height, | 203 | .h = height, |
| 203 | .p_w = 1, | 204 | .p_w = 1, |