[MPlayer-G2-dev] Re: mp-G2 pre18

Andriy N. Gritsenko andrej at lucky.net
Mon May 12 19:52:01 CEST 2003


    Hi, Arpi!

Sometime (on Monday, May 12 at 19:23) I've received something...
>i still prefer sth like:

>struct priv_st {
>	int w,h
>	void* something;
>	char palette[1024];
>	...
>};

Then you have to have struct priv_st priv_st_defaults={...} with defaults
anyway.

>static cfg_t config={
>  "width", STRUCT_OFF(priv_st,w), ...,
>  ...
>  NULL
>}

>vf_foobar_open(vf_instance_t* vf, void* args){
>    vf->priv=calloc(sizeof(priv_st),1);
>    if(!cfg_parse_args(vf->priv,config)) return 0;
>    ...
>    return 1;
>}

Only thing you missed there is it will be created only on plugin open so
it's hard to change it's defaults from config. But may be it's also good
to call config API after creating that instance. May be, because it will
take new API entry and support of dinamically allocated objects. I didn't
mention that all these objects will take extra memory for temporal buffer
(do you remember about VFCTRL_GET_PARAMS ?) and may take extra memory for
individual config trees. :)

    I think I know how to do it a like that (without additional type of
struct, of course!) but it will take some big time to rebuild concept and
code. ;)

    Also I have to say that cfg_parse_args() will be UI specific call so
we cannot implement it without some pl_func_t* structure, so we again
need plugins API. :)

    With best wishes.
    Andriy.



More information about the MPlayer-G2-dev mailing list