Intel-FFmpeg-Plugin / Intel_FFmpeg_plugins

mirror of git://source.ffmpeg.org/ffmpeg.git
http://ffmpeg.org
Other
35 stars 19 forks source link

localize input mfxFrameSurface1* for scale_qsv #38

Open YaboWei opened 6 years ago

YaboWei commented 6 years ago

If scale_qsv + enc and ONLY enc called by different thread, ONLY enc may got a Locked mfxFrameSurface1(https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/blob/bd1a484e986b95052f9a15d444ee747746d706aa/libavcodec/qsvenc.c#L1120) which is Locked by scale_qsv + enc's scale_qsv, and this surf would never be Unlocked, and this surf in qsv_pool(https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/blob/bd1a484e986b95052f9a15d444ee747746d706aa/libavutil/hwcontext_qsv.c#L379) is "leak".

If scale_qsv also localize input surf like enc, ONLY enc would never got a Locked mfxFrameSurface1, it's OK.

lizhong1008 commented 6 years ago

Patch looks good expect need a better commit message.