[FFmpeg-cvslog] avfilter/avfilter: add ff_filter_process_command()
Paul B Mahol
git at videolan.org
Mon Oct 14 12:41:57 EEST 2019
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Oct 8 12:42:40 2019 +0200| [a918b833a5ea640b6c8fa1125ae420999055b753] | committer: Paul B Mahol
avfilter/avfilter: add ff_filter_process_command()
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a918b833a5ea640b6c8fa1125ae420999055b753
---
libavfilter/avfilter.c | 13 +++++++++++++
libavfilter/internal.h | 7 +++++++
2 files changed, 20 insertions(+)
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 93e866b79c..09f33e0e7c 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -884,6 +884,19 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
return count;
}
+int ff_filter_process_command(AVFilterContext *ctx, const char *cmd,
+ const char *arg, char *res, int res_len, int flags)
+{
+ const AVOption *o;
+
+ if (!ctx->filter->priv_class)
+ return 0;
+ o = av_opt_find2(ctx->priv, cmd, NULL, AV_OPT_FLAG_RUNTIME_PARAM | AV_OPT_FLAG_FILTERING_PARAM, AV_OPT_SEARCH_CHILDREN, NULL);
+ if (!o)
+ return AVERROR(ENOSYS);
+ return av_opt_set(ctx->priv, cmd, arg, 0);
+}
+
int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
{
int ret = 0;
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 498bd3328d..1d77808082 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -411,6 +411,13 @@ static inline int ff_norm_qscale(int qscale, int type)
*/
int ff_filter_get_nb_threads(AVFilterContext *ctx);
+/**
+ * Generic processing of user supplied commands that are set
+ * in the same way as the filter options.
+ */
+int ff_filter_process_command(AVFilterContext *ctx, const char *cmd,
+ const char *arg, char *res, int res_len, int flags);
+
/**
* Perform any additional setup required for hardware frames.
*
More information about the ffmpeg-cvslog
mailing list