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

Lukasz Marek lukasz.m.luki at gmail.com
Sun Mar 9 00:12:53 CET 2014


On 08.03.2014 22:00, Nicolas George wrote:
> 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.

Yes. I wanted to face Michael's remarks about triplets etc. With 
component name field, device could return more than one parameter at one 
call, but this is probably a stuff than can be added/discussed later.

>> 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.

I had no timer recently to work on it, but thanks for comment. I hope to 
send some patch tomorrow.

-- 
Best Regards,
Lukasz Marek

I may be drunk, Miss, but in the morning I will be sober and you will 
still be ugly. - Winston Churchill


More information about the ffmpeg-devel mailing list