Commit 2391a63e authored by Jean-Yves Avenard's avatar Jean-Yves Avenard Committed by Jean-Baptiste Kempf

vaapi: use proper official fourcc constants

libva will never return I420 fourcc code, instead it uses IYUV. The first image format returned by vaQueryImageFormat with Intel VA backend is YV12, so using I420 wasn't an issue.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4f3f133a
......@@ -354,9 +354,9 @@ static int CreateSurfaces( vlc_va_sys_t *sys, void **pp_hw_ctx, vlc_fourcc_t *pi
vlc_fourcc_t i_chroma = 0;
for( int i = 0; i < i_fmt_count; i++ )
{
if( p_fmt[i].fourcc == VA_FOURCC( 'Y', 'V', '1', '2' ) ||
p_fmt[i].fourcc == VA_FOURCC( 'I', '4', '2', '0' ) ||
p_fmt[i].fourcc == VA_FOURCC( 'N', 'V', '1', '2' ) )
if( p_fmt[i].fourcc == VA_FOURCC_YV12 ||
p_fmt[i].fourcc == VA_FOURCC_IYUV ||
p_fmt[i].fourcc == VA_FOURCC_NV12 )
{
if( vaCreateImage( sys->p_display, &p_fmt[i], i_width, i_height, &sys->image ) )
{
......@@ -465,10 +465,10 @@ static int Extract( vlc_va_t *va, picture_t *p_picture, void *opaque,
return VLC_EGENERIC;
const uint32_t i_fourcc = sys->image.format.fourcc;
if( i_fourcc == VA_FOURCC('Y','V','1','2') ||
i_fourcc == VA_FOURCC('I','4','2','0') )
if( i_fourcc == VA_FOURCC_YV12 ||
i_fourcc == VA_FOURCC_IYUV )
{
bool b_swap_uv = i_fourcc == VA_FOURCC('I','4','2','0');
bool b_swap_uv = i_fourcc == VA_FOURCC_IYUV;
uint8_t *pp_plane[3];
size_t pi_pitch[3];
......@@ -485,7 +485,7 @@ static int Extract( vlc_va_t *va, picture_t *p_picture, void *opaque,
}
else
{
assert( i_fourcc == VA_FOURCC('N','V','1','2') );
assert( i_fourcc == VA_FOURCC_NV12 );
uint8_t *pp_plane[2];
size_t pi_pitch[2];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment