fftools/qsv: add extra_hw_frames support
authorZhong Li <zhong.li@intel.com>
Wed, 25 Jul 2018 08:05:38 +0000 (16:05 +0800)
committerZhong Li <zhong.li@intel.com>
Tue, 7 Aug 2018 03:26:40 +0000 (11:26 +0800)
Currently extra_hw_frames can't be applied to qsv since it
doesn't call function avcodec_get_hw_frames_parameters().

Give an option to fix ticket #7261 though it is not a perfect soultion
(allocate the minimum pool size internally and automatically).

Signed-off-by: Zhong Li <zhong.li@intel.com>
fftools/ffmpeg_qsv.c

index 7442750..9c4285b 100644 (file)
@@ -93,7 +93,7 @@ int qsv_init(AVCodecContext *s)
     frames_ctx->height            = FFALIGN(s->coded_height, 32);
     frames_ctx->format            = AV_PIX_FMT_QSV;
     frames_ctx->sw_format         = s->sw_pix_fmt;
-    frames_ctx->initial_pool_size = 64;
+    frames_ctx->initial_pool_size = 64 + s->extra_hw_frames;
     frames_hwctx->frame_type      = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
 
     ret = av_hwframe_ctx_init(ist->hw_frames_ctx);