mirror of https://github.com/mpv-player/mpv
vo_vdpau: check VDP_RGBA_FORMAT_A8 support
Apparently not all vdpau drivers in the wild support this format (VDPAU SUNXI can't). Revert to RGB in these cases.
This commit is contained in:
parent
179d7317e7
commit
66ed50aa00
|
@ -104,6 +104,7 @@ struct vdpctx {
|
||||||
VdpRect src_rect_vid;
|
VdpRect src_rect_vid;
|
||||||
VdpRect out_rect_vid;
|
VdpRect out_rect_vid;
|
||||||
struct mp_osd_res osd_rect;
|
struct mp_osd_res osd_rect;
|
||||||
|
VdpBool supports_a8;
|
||||||
|
|
||||||
int surface_num; // indexes output_surfaces
|
int surface_num; // indexes output_surfaces
|
||||||
int query_surface_num;
|
int query_surface_num;
|
||||||
|
@ -711,8 +712,8 @@ static void draw_osd(struct vo *vo)
|
||||||
if (!status_ok(vo))
|
if (!status_ok(vo))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static const bool formats[SUBBITMAP_COUNT] = {
|
bool formats[SUBBITMAP_COUNT] = {
|
||||||
[SUBBITMAP_LIBASS] = true,
|
[SUBBITMAP_LIBASS] = vc->supports_a8,
|
||||||
[SUBBITMAP_RGBA] = true,
|
[SUBBITMAP_RGBA] = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1069,6 +1070,9 @@ static int preinit(struct vo *vo)
|
||||||
vc->vdp_device = vc->mpvdp->vdp_device;
|
vc->vdp_device = vc->mpvdp->vdp_device;
|
||||||
vc->vdp = &vc->mpvdp->vdp;
|
vc->vdp = &vc->mpvdp->vdp;
|
||||||
|
|
||||||
|
vc->vdp->bitmap_surface_query_capabilities(vc->vdp_device, VDP_RGBA_FORMAT_A8,
|
||||||
|
&vc->supports_a8, &(uint32_t){0}, &(uint32_t){0});
|
||||||
|
|
||||||
vc->video_eq.capabilities = MP_CSP_EQ_CAPS_COLORMATRIX;
|
vc->video_eq.capabilities = MP_CSP_EQ_CAPS_COLORMATRIX;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue