[FFmpeg-devel] [PATCH] avfilter/vf_bilateral: process command to set the parameter at runtime

leozhang leozhang at qiyi.com
Wed Oct 23 15:34:25 EEST 2019


---
 libavfilter/vf_bilateral.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 3c9d800..a06f434 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -54,7 +54,7 @@ typedef struct BilateralContext {
 } BilateralContext;
 
 #define OFFSET(x) offsetof(BilateralContext, 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_RUNTIME_PARAM
 
 static const AVOption bilateral_options[] = {
     { "sigmaS", "set spatial sigma",    OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.0,  10, FLAGS },
@@ -358,13 +358,14 @@ static const AVFilterPad bilateral_outputs[] = {
 };
 
 AVFilter ff_vf_bilateral = {
-    .name          = "bilateral",
-    .description   = NULL_IF_CONFIG_SMALL("Apply Bilateral filter."),
-    .priv_size     = sizeof(BilateralContext),
-    .priv_class    = &bilateral_class,
-    .uninit        = uninit,
-    .query_formats = query_formats,
-    .inputs        = bilateral_inputs,
-    .outputs       = bilateral_outputs,
-    .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+    .name            = "bilateral",
+    .description     = NULL_IF_CONFIG_SMALL("Apply Bilateral filter."),
+    .priv_size       = sizeof(BilateralContext),
+    .priv_class      = &bilateral_class,
+    .uninit          = uninit,
+    .query_formats   = query_formats,
+    .inputs          = bilateral_inputs,
+    .outputs         = bilateral_outputs,
+    .flags           = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+    .process_command = ff_filter_process_command,
 };
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list