diff mbox

[FFmpeg-devel,05/14] avfilter/vf_gblur: switch to ff_filter_process_command()

Message ID 20191009101705.7072-5-onemda@gmail.com
State Superseded
Headers show

Commit Message

Paul B Mahol Oct. 9, 2019, 10:16 a.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/vf_gblur.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

Comments

Michael Niedermayer Oct. 9, 2019, 5:12 p.m. UTC | #1
On Wed, Oct 09, 2019 at 12:16:56PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavfilter/vf_gblur.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)

LGTM if tested

thx

[...]
diff mbox

Patch

diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 6ef261478f..6a4e7d6936 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -35,7 +35,7 @@ 
 #include "video.h"
 
 #define OFFSET(x) offsetof(GBlurContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_COMMAND_PARAM
 
 static const AVOption gblur_options[] = {
     { "sigma",  "set sigma",            OFFSET(sigma),  AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0.0, 1024, FLAGS },
@@ -344,22 +344,6 @@  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)
-{
-    GBlurContext *s = ctx->priv;
-    int ret = 0;
-
-    if (   !strcmp(cmd, "sigma") || !strcmp(cmd, "sigmaV")
-        || !strcmp(cmd, "steps") || !strcmp(cmd, "planes")) {
-        av_opt_set(s, cmd, args, 0);
-    } else {
-        ret = AVERROR(ENOSYS);
-    }
-
-    return ret;
-}
-
 static av_cold void uninit(AVFilterContext *ctx)
 {
     GBlurContext *s = ctx->priv;
@@ -395,5 +379,5 @@  AVFilter ff_vf_gblur = {
     .inputs        = gblur_inputs,
     .outputs       = gblur_outputs,
     .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
-    .process_command = process_command,
+    .process_command = ff_filter_process_command,
 };