Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-08 14:12:52 +0300
committerPaul B Mahol <onemda@gmail.com>2019-10-14 12:40:17 +0300
commit877e2e92a377249625f5a2fcba53f64525705560 (patch)
treef874bc5127b6f9f2340c983d4954ad9647511bfe /libavfilter/af_anlmdn.c
parent4954a17ec7286c00cc971deb442ec438b78568f8 (diff)
avfilter/af_anlmdn: switch to ff_filter_process_command()
Diffstat (limited to 'libavfilter/af_anlmdn.c')
-rw-r--r--libavfilter/af_anlmdn.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index b5bc94b4eb..6e37452963 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -73,15 +73,16 @@ enum OutModes {
#define OFFSET(x) offsetof(AudioNLMeansContext, x)
#define AF AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define AFT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
static const AVOption anlmdn_options[] = {
- { "s", "set denoising strength", OFFSET(a), AV_OPT_TYPE_FLOAT, {.dbl=0.00001},0.00001, 10, AF },
+ { "s", "set denoising strength", OFFSET(a), AV_OPT_TYPE_FLOAT, {.dbl=0.00001},0.00001, 10, AFT },
{ "p", "set patch duration", OFFSET(pd), AV_OPT_TYPE_DURATION, {.i64=2000}, 1000, 100000, AF },
{ "r", "set research duration", OFFSET(rd), AV_OPT_TYPE_DURATION, {.i64=6000}, 2000, 300000, AF },
- { "o", "set output mode", OFFSET(om), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_MODES-1, AF, "mode" },
- { "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, AF, "mode" },
- { "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, AF, "mode" },
- { "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE},0, 0, AF, "mode" },
+ { "o", "set output mode", OFFSET(om), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_MODES-1, AFT, "mode" },
+ { "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, AFT, "mode" },
+ { "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, AFT, "mode" },
+ { "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE},0, 0, AFT, "mode" },
{ "m", "set smooth factor", OFFSET(m), AV_OPT_TYPE_FLOAT, {.dbl=11.}, 1, 15, AF },
{ NULL }
};
@@ -339,29 +340,6 @@ static av_cold void uninit(AVFilterContext *ctx)
av_frame_free(&s->cache);
}
-static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
- char *res, int res_len, int flags)
-{
- AudioNLMeansContext *s = ctx->priv;
-
- if (!strcmp(cmd, "s")) {
- float a;
-
- if (av_sscanf(args, "%f", &a) == 1)
- s->a = av_clipf(a, 0.00001, 10);
- } else if (!strcmp(cmd, "o")) {
- if (!strcmp(args, "i")) {
- s->om = IN_MODE;
- } else if (!strcmp(args, "o")) {
- s->om = OUT_MODE;
- } else if (!strcmp(args, "n")) {
- s->om = NOISE_MODE;
- }
- }
-
- return 0;
-}
-
static const AVFilterPad inputs[] = {
{
.name = "default",
@@ -390,7 +368,7 @@ AVFilter ff_af_anlmdn = {
.uninit = uninit,
.inputs = inputs,
.outputs = outputs,
- .process_command = process_command,
+ .process_command = ff_filter_process_command,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
AVFILTER_FLAG_SLICE_THREADS,
};