[FFmpeg-devel] [PATCH 4/8] lavu/opt: extend AVOptionRange by second value

Nicolas George george at nsup.org
Sat Mar 8 22:00:38 CET 2014


Le tridi 13 ventôse, an CCXXII, Lukasz Marek a écrit :
> OK, I tried to make it different, we have following function:
> 
> int av_opt_query_ranges(AVOptionRanges **, void *obj, const char
> *key, int flags);
> 
> AVOptionRanges is **. We can return more than one struct without any
> changes to API.
> 
> So querying option size will return 2 x AVOptionRanges, querying
> color may return 3/4 x AVOptionRanges.

I believe this is a very good idea.

> AVOptionRanges may be extended by one filed "option_name" for example
> 
> typedef struct AVOptionRanges {
>     AVOptionRange **range;
>     int nb_ranges;
>     char *option_name
> } AVOptionRanges;
> 
> So, when querying for example "window_size" it would return one
> struct with option_name set to "window_size.width" and struct with
> option_name set to "window_size.height".
> 
> in general option_name param would return option name with suffix
> that would be defined per option type. all AVoptionRanges will
> require to return the same number of AVOptionRange structs.

I do not think it is necessary: the name of the option is known by the
caller, and the order of the components is determined by the option type.
Parsing a string is not very convenient anyway.

> av_opt_query_ranges so far returns >=0 for success, it can be
> redefined to return number of AVOptionRanges.

That seems like an obvious change.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140308/95d6d4bb/attachment.asc>


More information about the ffmpeg-devel mailing list