aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-11-19 11:53:10 +0100
committerPaul B Mahol <onemda@gmail.com>2020-11-19 11:55:47 +0100
commit381ab69042cad9f0a16718f7b6824076492030d9 (patch)
tree0ffa2f904f8bb64289be3118a1ff01502758fbab
parent17a0dfebf55f67653c29a607545a799f12bc0c01 (diff)
downloadffmpeg-381ab69042cad9f0a16718f7b6824076492030d9.tar.gz
avfilter/vf_frei0r: add support for commands
-rw-r--r--doc/filters.texi4
-rw-r--r--libavfilter/vf_frei0r.c17
2 files changed, 20 insertions, 1 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index a2d1a3aa9f..092b343c2c 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -11784,6 +11784,10 @@ frei0r=perspective:0.2/0.2|0.8/0.2
For more information, see
@url{http://frei0r.dyne.org}
+@subsection Commands
+
+This filter supports the @option{filter_params} option as @ref{commands}.
+
@section fspp
Apply fast and simple postprocessing. It is a faster version of @ref{spp}.
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)