int ret;
if ((ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO),
- &avctx->inputs[0]->out_formats)) < 0 ||
+ &avctx->inputs[0]->outcfg.formats)) < 0 ||
(ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO),
- &avctx->outputs[0]->in_formats)) < 0)
+ &avctx->outputs[0]->incfg.formats)) < 0)
return ret;
return 0;
frames->sw_format = hwfc->sw_format;
frames->width = hwfc->width;
frames->height = hwfc->height;
- frames->initial_pool_size = 64;
+
+ if (avctx->extra_hw_frames >= 0)
+ frames->initial_pool_size = 2 + avctx->extra_hw_frames;
err = av_hwframe_ctx_init(ctx->hwframes_ref);
if (err < 0) {
hwfc->width = inlink->w;
hwfc->height = inlink->h;
+ if (avctx->extra_hw_frames >= 0)
+ hwfc->initial_pool_size = 2 + avctx->extra_hw_frames;
+
err = av_hwframe_ctx_init(ctx->hwframes_ref);
if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed to create frame "
{ NULL }
};
-AVFilter ff_vf_hwmap = {
+const AVFilter ff_vf_hwmap = {
.name = "hwmap",
.description = NULL_IF_CONFIG_SMALL("Map hardware frames"),
.uninit = hwmap_uninit,