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

Lukasz Marek lukasz.m.luki at gmail.com
Mon Mar 3 23:04:25 CET 2014


> IMO either there should be a AVOptionRange with an array in it
> or 3 AVOptionRange


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.

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.

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


-- 
Best Regards,
Lukasz Marek

If you can't explain it simply, you don't understand it well enough. - 
Albert Einstein


More information about the ffmpeg-devel mailing list