Unified · Split
| @@ -60,17 +60,18 @@ typedef struct AudioNLMSContext { · 59 unmodified lines | ||
| 60 | 60 | |
| 61 | 61 | #define OFFSET(x) offsetof(AudioNLMSContext, x) |
| 62 | 62 | #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
| 63 | +#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM | |
| 63 | 64 | |
| 64 | 65 | static const AVOption anlms_options[] = { |
| 65 | 66 | { "order", "set the filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=256}, 1, INT16_MAX, A }, |
| 66 | − { "mu", "set the filter mu", OFFSET(mu), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 2, A }, | |
| 67 | − { "eps", "set the filter eps", OFFSET(eps), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, A }, | |
| 68 | − { "leakage", "set the filter leakage", OFFSET(leakage), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 1, A }, | |
| 69 | − { "out_mode", "set output mode", OFFSET(output_mode), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_OMODES-1, A, "mode" }, | |
| 70 | − { "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, A, "mode" }, | |
| 71 | − { "d", "desired", 0, AV_OPT_TYPE_CONST, {.i64=DESIRED_MODE}, 0, 0, A, "mode" }, | |
| 72 | − { "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, A, "mode" }, | |
| 73 | − { "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE}, 0, 0, A, "mode" }, | |
| 67 | + { "mu", "set the filter mu", OFFSET(mu), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 2, AT }, | |
| 68 | + { "eps", "set the filter eps", OFFSET(eps), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AT }, | |
| 69 | + { "leakage", "set the filter leakage", OFFSET(leakage), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 1, AT }, | |
| 70 | + { "out_mode", "set output mode", OFFSET(output_mode), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_OMODES-1, AT, "mode" }, | |
| 71 | + { "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, AT, "mode" }, | |
| 72 | + { "d", "desired", 0, AV_OPT_TYPE_CONST, {.i64=DESIRED_MODE}, 0, 0, AT, "mode" }, | |
| 73 | + { "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, AT, "mode" }, | |
| 74 | + { "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE}, 0, 0, AT, "mode" }, | |
| 74 | 75 | { NULL } |
| 75 | 76 | }; |
| 76 | 77 | |
| @@ -281,22 +282,6 @@ static av_cold int init(AVFilterContext *ctx) · 204 unmodified lines | ||
| 281 | 282 | return 0; |
| 282 | 283 | } |
| 283 | 284 | |
| 284 | −static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, | |
| 285 | − char *res, int res_len, int flags) | |
| 286 | −{ | |
| 287 | − AudioNLMSContext *s = ctx->priv; | |
| 288 | − int ret; | |
| 289 | − | |
| 290 | − if ( !strcmp(cmd, "mu") || !strcmp(cmd, "eps") | |
| 291 | − || !strcmp(cmd, "leakage") || !strcmp(cmd, "out_mode")) { | |
| 292 | − ret = av_opt_set(s, cmd, args, 0); | |
| 293 | − } else { | |
| 294 | − ret = AVERROR(ENOSYS); | |
| 295 | − } | |
| 296 | − | |
| 297 | − return ret; | |
| 298 | −} | |
| 299 | − | |
| 300 | 285 | static av_cold void uninit(AVFilterContext *ctx) |
| 301 | 286 | { |
| 302 | 287 | AudioNLMSContext *s = ctx->priv; |
| @@ -341,5 +326,5 @@ AVFilter ff_af_anlms = { · 38 unmodified lines | ||
| 341 | 326 | .inputs = inputs, |
| 342 | 327 | .outputs = outputs, |
| 343 | 328 | .flags = AVFILTER_FLAG_SLICE_THREADS, |
| 344 | − .process_command = process_command, | |
| 329 | + .process_command = ff_filter_process_command, | |
| 345 | 330 | }; |