[FFmpeg-devel] [PATCH 02/14] avfilter/avfilter: add ff_filter_process_command()

Michael Niedermayer michael at niedermayer.cc
Wed Oct 9 20:03:14 EEST 2019


On Wed, Oct 09, 2019 at 12:16:53PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  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..4d462d4e0a 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_COMMAND_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);
> +}

I am just puzzled why we did not do this before already. I do remember disliking
all the command code ...

patch LGTM but please give others time to comment before applying

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191009/6cea72c9/attachment.sig>


More information about the ffmpeg-devel mailing list