[vlc-commits] vaapi: use proper official fourcc constants
Jean-Yves Avenard
git at videolan.org
Sat Jun 14 13:03:12 CEST 2014
vlc | branch: master | Jean-Yves Avenard <jyavenard at mythtv.org> | Fri Jun 13 11:02:37 2014 +0000| [2391a63ea9719f76b8142ba5f2f5114d32c9a4cc] | committer: 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 <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2391a63ea9719f76b8142ba5f2f5114d32c9a4cc
---
modules/codec/avcodec/vaapi.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 017c995..1d8f7fa 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -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];
More information about the vlc-commits
mailing list