From c6bc18bc121ea66df715123c59f7ef9542c0914a Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Sat, 5 Aug 2017 22:10:46 +0100 Subject: vf_hwupload/hwmap: Support setting a fixed pool size These filters do not directly know whether the API they are using will support dynamic frame pools, so this is somewhat tricky. If the user sets extra_hw_frames, we assume that they are aware of the problem and set a fixed size based on that. If not, most cases use dynamic sizing just like they did previously. The hardware-reverse-mapping case for hwmap previously had a large fixed size (64) here, primarily as a hack for QSV use - this is removed and extra_hw_frames will need to be set for QSV to work since it requires fixed-size pools (as the other cases do, and which didn't work before). --- libavfilter/vf_hwupload.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavfilter/vf_hwupload.c') diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c index 8cca9f42e2..af4ff9b81f 100644 --- a/libavfilter/vf_hwupload.c +++ b/libavfilter/vf_hwupload.c @@ -133,6 +133,9 @@ static int hwupload_config_output(AVFilterLink *outlink) ctx->hwframes->width = inlink->w; ctx->hwframes->height = inlink->h; + if (avctx->extra_hw_frames >= 0) + ctx->hwframes->initial_pool_size = 2 + avctx->extra_hw_frames; + err = av_hwframe_ctx_init(ctx->hwframes_ref); if (err < 0) goto fail; -- cgit v1.2.3