Iive's version Re: [MPlayer-G2-dev] g2 config - restart...

Arpi arpi at thot.banki.hu
Wed May 14 22:41:02 CEST 2003


Hi,

> It looks like am too late with my drafts
> anyway i see that many of the ideas i had have
> been introdused. Anyway i send it as
> attachment, maybe there are still good ideas

yes, there are good ones, definitly!
at least i found 2 interesting ideas:

> Just an examples:
>  "*.demuxer.avi.nointerlace" = "1"
>  "1.demuxer.avi.nointeleave=0"
> the avi demuxer will see only "nointerleave" part.

this is good for teh config files.
(dunno what is taht *. and 1. at the start, i skip them for now)

such thing is already used by Xfree since ages:

!Maker.Cursor.topleft:          topleft
!Maker.Cursor.top:              top
!Maker.Cursor.topright:         topright
..

imho it could also solve the problem of module-dependant options which may
not be available always when parsing configfiles.

btw i don't know yet teh naming convention for core and modules.
for example it could be:
demuxer.soemvar=123
demuxer.avi.something=456
or:
demuxer.core.somevar=123
demuxer.avi.something=456
or
demuxer.core.somevar=123
demuxer.modules.avi.something=456
or
demuxer.somevar=123
demux_avi.something=456

better ideas?

> 2. Implementation
> There should not be global option file as it is now.
> In instance structure to be added array of 'options' 
> 
> union {
>   int   as_int;
>   float as_float;
>   void* as pointer
>   off-t as_off_t;
> }param_u;//this is from g1 cfgparser.h
> 
> ....
>   param_u options[];
>   ...
> } instance_t;
> 
> In every module there should be array structure like config_t:
>   - name of the option - string
>   - type of the option number (int,float) or pointer (to string)
>   - option number - index in the options[]
>   - default value - string or number
>   - max,min limits (for numbers)

> If option is changed at runtime a function could be called
> so the nessessery reinit to be done.e.g.
> 
> static uint32_t option_changed(int option_num){
> switch (option_num){
>   case enum_idct:
>     lavc_idct_change(lavctx,module_inst->options[emum_idct].as_int);
>   return OK;
>   default:
>    return RESTORE;
>   }
> }
> // Better add new flag, CONF_RUNTIME_CHANGABLE or something...
> 
>    
> 4. Bad sides.
> The index values should be unique, and it is not always nice to work with 
> something like 
>     if ( instance->options[15].as_int > 1 ) print_info();
> so each option will be enumarated (I've never used enum so far):
>     if ( instance->options[lavc_debug].as_int > 1 ) print_info();
> 

it raises a big question: module-dependent struct or array (of union)?
(ie. my/albeu's vs. iive's idea of keeping config variables)
both solutions have important advantages and disadvantages.

for runtime configuration (control) and inter-module args passing
(including automatic module insertion with some paramaters) is easier
with array. it can also handle default values in config_t easier.

> There is no place for suboptions. In fact suboptions are options
> for some other module. ( Am I wrong?).

yes, maybe you're right...

it's actually question of commandline syntax we want to use to pass
module-dependant args.


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-G2-dev mailing list