Browse Source

vdpau/display: test B8G8R8A8 SPU format

This also fixes a corner-case bug where whe format exposed on big
endian was not the one being tested.
pull/136/head
Rémi Denis-Courmont 4 years ago
committed by Jean-Baptiste Kempf
parent
commit
69d2e555a9
  1. 15
      modules/hw/vdpau/display.c

15
modules/hw/vdpau/display.c

@ -63,7 +63,7 @@ typedef struct vout_display_sys_t
unsigned width;
unsigned height;
vlc_fourcc_t spu_formats[2];
vlc_fourcc_t spu_formats[3];
} vout_display_sys_t;
static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
@ -448,14 +448,25 @@ static int Open(vout_display_t *vd,
VdpBool ok;
unsigned int n = 0;
#ifdef WORDS_BIGENDIAN
err = vdp_bitmap_surface_query_capabilities(sys->vdp, sys->device,
VDP_RGBA_FORMAT_R8G8B8A8,
&ok, &w, &h);
if (err == VDP_STATUS_OK && ok == VDP_TRUE)
sys->spu_formats[n++] = VLC_CODEC_RGBA;
if (n > 0) {
sys->spu_formats[n] = 0;
vd->info.subpicture_chromas = sys->spu_formats;
}
#endif
err = vdp_bitmap_surface_query_capabilities(sys->vdp, sys->device,
VDP_RGBA_FORMAT_B8G8R8A8,
&ok, &w, &h);
if (err == VDP_STATUS_OK && ok == VDP_TRUE)
#ifdef WORDS_BIGENDIAN
sys->spu_formats[n++] = VLC_CODEC_ARGB;
#else
sys->spu_formats[n++] = VLC_CODEC_RGBA;
sys->spu_formats[n++] = VLC_CODEC_BGRA;
#endif
if (n > 0) {
sys->spu_formats[n] = 0;

Loading…
Cancel
Save