diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-11-17 21:33:37 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-12-01 10:55:30 +0100 |
commit | 2cfc8b172ce767928a6394e066cb0b2789efd395 (patch) | |
tree | de38a187a2e3596866e40dbabe1ac056cadb9c24 /libavfilter | |
parent | e01d2c00ae070c6486cdbe3a07546fcffb3ce6cb (diff) | |
download | ffmpeg-2cfc8b172ce767928a6394e066cb0b2789efd395.tar.gz |
avfilter/vf_tile: add init_padding option
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_tile.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c index 7717ce12e7..439689a14d 100644 --- a/libavfilter/vf_tile.c +++ b/libavfilter/vf_tile.c @@ -38,6 +38,7 @@ typedef struct TileContext { unsigned margin; unsigned padding; unsigned overlap; + unsigned init_padding; unsigned current; unsigned nb_frames; FFDrawContext draw; @@ -62,6 +63,8 @@ static const AVOption tile_options[] = { { "color", "set the color of the unused area", OFFSET(rgba_color), AV_OPT_TYPE_COLOR, {.str = "black"}, .flags = FLAGS }, { "overlap", "set how many frames to overlap for each render", OFFSET(overlap), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS }, + { "init_padding", " set how many frames to initially pad", OFFSET(init_padding), + AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS }, { NULL } }; @@ -99,6 +102,12 @@ static av_cold int init(AVFilterContext *ctx) tile->overlap = tile->nb_frames - 1; } + if (tile->init_padding >= tile->nb_frames) { + av_log(ctx, AV_LOG_WARNING, "init_padding must be less than %d\n", tile->nb_frames); + } else { + tile->current = tile->init_padding; + } + return 0; } @@ -201,11 +210,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) tile->out_ref->height = outlink->h; /* fill surface once for margin/padding */ - if (tile->margin || tile->padding) + if (tile->margin || tile->padding || tile->init_padding) ff_fill_rectangle(&tile->draw, &tile->blank, tile->out_ref->data, tile->out_ref->linesize, 0, 0, outlink->w, outlink->h); + tile->init_padding = 0; } if (tile->prev_out_ref) { |