[MPlayer-dev-eng] [PATCH] vo-control method suggestion

David Holm david at realityrift.com
Thu Feb 7 17:51:37 CET 2002


> hmm. look at control() in libao2, or libvo2 drafts.
> you just break the main point of this function: extendibility without
> modifying all the drivers.
> implementation of conyrol() should be like this:
Good point, will do... forgot all about the libvo2 specs actually...
 
> int control(int cmd, void* param){
>   switch(cmd){
>   case VOCTRL_QUERY_XYZ:
>      ...
>   ...
>   case ...
>   }
>   return VOCTRL_NOTIMPL;
> }
> 
> it shouldn't memset zero to struct it doesn't even know and so on.
> if it returns VOCTRL_NOTIMPL it means it doesn't know this extension - teh
> caller should accept this and memset to zero if required.
IMHO isn't it more useful to use the standardized errno's? Doesn't
matter to me, just an idea...

> > +	int (*control)(int request, ...);
> 
> ehh. is this "..." usefull enough? Isn't a simple void* better?
> (pointing to struct depending on cmd)
> 
> I don't like to play with VA_ARGS stuff...

I don't like it alot either, but the truth is it is very extensible, in
5 years it would still be able to take advanced commands which we could
not think of today.

//David




More information about the MPlayer-dev-eng mailing list