[FFmpeg-devel] [PATCH] lavu: Add av_dict_from_string()

Alexander Strasser eclipse7 at gmx.net
Thu Feb 16 19:16:52 CET 2012


Hi Andrey,

  your patch looks useful to me. I didn't check the implementation yet,
just the interface.

Andrey Utkin wrote:
> ---
>  libavutil/dict.c |   35 +++++++++++++++++++++++++++++++++++
>  libavutil/dict.h |    7 +++++++
>  2 files changed, 42 insertions(+), 0 deletions(-)
[...]
> diff --git a/libavutil/dict.h b/libavutil/dict.h
> index 6e28b61..a563971 100644
> --- a/libavutil/dict.h
> +++ b/libavutil/dict.h
> @@ -115,6 +115,13 @@ void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
>  void av_dict_free(AVDictionary **m);
>  
>  /**
> + * Get AVDictionary from string in format "opt1=val1,opt_i=val_i,..."
> + *
> + * @return 0 on success, otherwise an error code <0
> + */
> +int av_dict_from_string(const char *arg, AVDictionary **dict);

  Would it seem OK for you to use an array of character pointers or similar?
I guess your current interface would not allow passing through arbitrary
character strings.

  Another advantage would be that a more generic interface would serve a wider
audience of applications in a better way (though some would need a little more
code, but maybe we could also provide that in a separate API if you think it
would be useful to have in lavu). 

  Alexander


More information about the ffmpeg-devel mailing list