History

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.

sfan5 committed 2 years ago

Commit 830f6cc1 parent aa75a0e2 files · +7 −6Browse files

Unified · Split

2 files
  1. video/out/vo_drm.c +2 −2
  2. video/out/vo_wlshm.c +5 −4
video/out/vo_drm.c+2−2
@@ -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
423static int query_format(struct vo *vo, int format)422static 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
428static int control(struct vo *vo, uint32_t request, void *arg)428static int control(struct vo *vo, uint32_t request, void *arg)
video/out/vo_wlshm.c+5−4
@@ -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
35struct buffer {35struct 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
165static int query_format(struct vo *vo, int format)165static 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
170static int reconfig(struct vo *vo, struct mp_image_params *params)171static 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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t