mirror of
https://github.com/mpv-player/mpv.git
synced 2026-06-06 20:10:30 +00:00
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.
This commit is contained in:
+2
-2
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user