aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-12-03 18:22:01 +0100
committerPaul B Mahol <onemda@gmail.com>2023-12-03 18:30:06 +0100
commit8888574d10766b7d5ced5ab076496b3664a023a4 (patch)
tree4843b42c755d537e3f5cb3cfa2ab225caab6c96a
parentddecc39c393bb101b9620c061f073aa852c9a3ac (diff)
downloadffmpeg-8888574d10766b7d5ced5ab076496b3664a023a4.tar.gz
avfilter/vsrc_gradients: add commands support
-rw-r--r--doc/filters.texi4
-rw-r--r--libavfilter/vsrc_gradients.c18
2 files changed, 14 insertions, 8 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index de19d130cc..6d00ba2c3f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -28367,6 +28367,10 @@ Available values are:
Default type is @var{linear}.
@end table
+@subsection Commands
+
+This source supports the some above options as @ref{commands}.
+
@section mandelbrot
Generate a Mandelbrot set fractal, and progressively zoom towards the
diff --git a/libavfilter/vsrc_gradients.c b/libavfilter/vsrc_gradients.c
index e879f0b158..d3264b96c8 100644
--- a/libavfilter/vsrc_gradients.c
+++ b/libavfilter/vsrc_gradients.c
@@ -52,6 +52,7 @@ typedef struct GradientsContext {
#define OFFSET(x) offsetof(GradientsContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define VFT AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
static const AVOption gradients_options[] = {
{"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, 0, 0, FLAGS },
@@ -75,14 +76,14 @@ static const AVOption gradients_options[] = {
{"seed", "set the seed", OFFSET(seed), AV_OPT_TYPE_INT64, {.i64=-1}, -1, UINT32_MAX, FLAGS },
{"duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=-1}, -1, INT64_MAX, FLAGS },
{"d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=-1}, -1, INT64_MAX, FLAGS },
- {"speed", "set gradients rotation speed", OFFSET(speed), AV_OPT_TYPE_FLOAT,{.dbl=0.01}, 0, 1, FLAGS },
- {"type", "set gradient type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, 4, FLAGS, "type" },
- {"t", "set gradient type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, 4, FLAGS, "type" },
- { "linear", "set linear gradient", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "type" },
- { "radial", "set radial gradient", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "type" },
- { "circular", "set circular gradient", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "type" },
- { "spiral", "set spiral gradient", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "type" },
- { "square", "set square gradient", 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, FLAGS, "type" },
+ {"speed", "set gradients rotation speed", OFFSET(speed), AV_OPT_TYPE_FLOAT,{.dbl=0.01}, 0, 1, VFT },
+ {"type", "set gradient type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, 4, VFT, "type" },
+ {"t", "set gradient type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, 4, VFT, "type" },
+ { "linear", "set linear gradient", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, VFT, "type" },
+ { "radial", "set radial gradient", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, VFT, "type" },
+ { "circular", "set circular gradient", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, VFT, "type" },
+ { "spiral", "set spiral gradient", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, VFT, "type" },
+ { "square", "set square gradient", 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, VFT, "type" },
{NULL},
};
@@ -449,4 +450,5 @@ const AVFilter ff_vsrc_gradients = {
FILTER_PIXFMTS(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGBA64, AV_PIX_FMT_GBRAPF32),
.activate = activate,
.flags = AVFILTER_FLAG_SLICE_THREADS,
+ .process_command = ff_filter_process_command,
};