Browse Source

Merge commit 'c6bc18bc121ea66df715123c59f7ef9542c0914a'

* commit 'c6bc18bc121ea66df715123c59f7ef9542c0914a':
  vf_hwupload/hwmap: Support setting a fixed pool size

Merged-by: Mark Thompson <sw@jkqxz.net>
tags/n4.0
Mark Thompson 7 years ago
parent
commit
b668a1c8b3
2 changed files with 9 additions and 1 deletions
  1. +6
    -1
      libavfilter/vf_hwmap.c
  2. +3
    -0
      libavfilter/vf_hwupload.c

+ 6
- 1
libavfilter/vf_hwmap.c View File

@@ -143,7 +143,9 @@ static int hwmap_config_output(AVFilterLink *outlink)
frames->sw_format = hwfc->sw_format; frames->sw_format = hwfc->sw_format;
frames->width = hwfc->width; frames->width = hwfc->width;
frames->height = hwfc->height; 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); err = av_hwframe_ctx_init(ctx->hwframes_ref);
if (err < 0) { if (err < 0) {
@@ -223,6 +225,9 @@ static int hwmap_config_output(AVFilterLink *outlink)
hwfc->width = inlink->w; hwfc->width = inlink->w;
hwfc->height = inlink->h; 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); err = av_hwframe_ctx_init(ctx->hwframes_ref);
if (err < 0) { if (err < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed to create frame " av_log(avctx, AV_LOG_ERROR, "Failed to create frame "


+ 3
- 0
libavfilter/vf_hwupload.c View File

@@ -131,6 +131,9 @@ static int hwupload_config_output(AVFilterLink *outlink)
ctx->hwframes->width = inlink->w; ctx->hwframes->width = inlink->w;
ctx->hwframes->height = inlink->h; 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); err = av_hwframe_ctx_init(ctx->hwframes_ref);
if (err < 0) if (err < 0)
goto fail; goto fail;


Loading…
Cancel
Save