diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-11-19 11:53:10 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-11-19 11:55:47 +0100 |
commit | 381ab69042cad9f0a16718f7b6824076492030d9 (patch) | |
tree | 0ffa2f904f8bb64289be3118a1ff01502758fbab /libavfilter | |
parent | 17a0dfebf55f67653c29a607545a799f12bc0c01 (diff) | |
download | ffmpeg-381ab69042cad9f0a16718f7b6824076492030d9.tar.gz |
avfilter/vf_frei0r: add support for commands
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_frei0r.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index dd94452d10..c084d5b13b 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -371,11 +371,25 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return ff_filter_frame(outlink, out); } +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, + char *res, int res_len, int flags) +{ + Frei0rContext *s = ctx->priv; + int ret; + + ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags); + if (ret < 0) + return ret; + + return set_params(ctx, s->params); +} + #define OFFSET(x) offsetof(Frei0rContext, x) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM +#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM static const AVOption frei0r_options[] = { { "filter_name", NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS }, - { "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = FLAGS }, + { "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = TFLAGS }, { NULL } }; @@ -409,6 +423,7 @@ AVFilter ff_vf_frei0r = { .priv_class = &frei0r_class, .inputs = avfilter_vf_frei0r_inputs, .outputs = avfilter_vf_frei0r_outputs, + .process_command = process_command, }; static av_cold int source_init(AVFilterContext *ctx) |