msdk: libva: Don't set the hint if MFX_VERSION is lower than 1025

MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET is defined since MFX_VERSION
1025.
This commit is contained in:
Haihao Xiang 2020-02-12 10:24:55 +08:00
parent 02a6a794ec
commit acc14225c9

View file

@ -106,6 +106,7 @@ gst_msdk_frame_alloc (mfxHDL pthis, mfxFrameAllocRequest * req,
num_attribs = 1;
/* set VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER flag for encoding */
#if (MFX_VERSION >= 1025)
if ((req->Type & MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET) &&
(req->Type & MFX_MEMTYPE_FROM_ENCODE)) {
attribs[1].type = VASurfaceAttribUsageHint;
@ -114,6 +115,7 @@ gst_msdk_frame_alloc (mfxHDL pthis, mfxFrameAllocRequest * req,
attribs[1].value.value.i = VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER;
num_attribs = 2;
}
#endif
format =
gst_msdk_get_va_rt_format_from_mfx_rt_format (req->Info.ChromaFormat);