@ -128,6 +128,20 @@ static const struct {
// the SDK only delares support for Y410
// the SDK only delares support for Y410
{ AV_PIX_FMT_XV30 ,
{ AV_PIX_FMT_XV30 ,
MFX_FOURCC_Y410 , 0 } ,
MFX_FOURCC_Y410 , 0 } ,
# if QSV_VERSION_ATLEAST(1, 31)
// P012 is used for VAAPI child device,
// the SDK only delares support for P016
{ AV_PIX_FMT_P012 ,
MFX_FOURCC_P016 , 1 } ,
// Y212 is used for VAAPI child device,
// the SDK only delares support for Y216
{ AV_PIX_FMT_Y212 ,
MFX_FOURCC_Y216 , 1 } ,
// XV36 is used for VAAPI child device,
// the SDK only delares support for Y416
{ AV_PIX_FMT_XV36 ,
MFX_FOURCC_Y416 , 1 } ,
# endif
# endif
# endif
} ;
} ;
@ -1493,6 +1507,7 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
switch ( frame - > format ) {
switch ( frame - > format ) {
case AV_PIX_FMT_NV12 :
case AV_PIX_FMT_NV12 :
case AV_PIX_FMT_P010 :
case AV_PIX_FMT_P010 :
case AV_PIX_FMT_P012 :
surface - > Data . Y = frame - > data [ 0 ] ;
surface - > Data . Y = frame - > data [ 0 ] ;
surface - > Data . UV = frame - > data [ 1 ] ;
surface - > Data . UV = frame - > data [ 1 ] ;
break ;
break ;
@ -1517,6 +1532,7 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
break ;
break ;
case AV_PIX_FMT_Y210 :
case AV_PIX_FMT_Y210 :
case AV_PIX_FMT_Y212 :
surface - > Data . Y16 = ( mfxU16 * ) frame - > data [ 0 ] ;
surface - > Data . Y16 = ( mfxU16 * ) frame - > data [ 0 ] ;
surface - > Data . U16 = ( mfxU16 * ) frame - > data [ 0 ] + 1 ;
surface - > Data . U16 = ( mfxU16 * ) frame - > data [ 0 ] + 1 ;
surface - > Data . V16 = ( mfxU16 * ) frame - > data [ 0 ] + 3 ;
surface - > Data . V16 = ( mfxU16 * ) frame - > data [ 0 ] + 3 ;
@ -1532,6 +1548,14 @@ static int map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
case AV_PIX_FMT_XV30 :
case AV_PIX_FMT_XV30 :
surface - > Data . U = frame - > data [ 0 ] ;
surface - > Data . U = frame - > data [ 0 ] ;
break ;
break ;
case AV_PIX_FMT_XV36 :
surface - > Data . U = frame - > data [ 0 ] ;
surface - > Data . Y = frame - > data [ 0 ] + 2 ;
surface - > Data . V = frame - > data [ 0 ] + 4 ;
// Only set Data.A to a valid address, the SDK doesn't
// use the value from the frame.
surface - > Data . A = frame - > data [ 0 ] + 6 ;
break ;
# endif
# endif
default :
default :
return MFX_ERR_UNSUPPORTED ;
return MFX_ERR_UNSUPPORTED ;