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

Arpi arpi at thot.banki.hu
Thu Feb 7 17:55:29 CET 2002


Hi,

> > 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...
no...
errno works in old messy way: func returns -1, and caller checks the global
errno. i don't like this.
we should return >=0 if implemented and <0 if error (n/a or not implemented
or failed). in my original control() api drafts 0=false 1=true anyway, so
at query calls we can use these values.
(there were query, set and get calls. query returns 0/1/error, get returns
the requested value or error, set returns success or error)

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

what about control(int cmd, void* param, ...); ?
as most function uses pointer, it's easy to use, but we keep the
extendibility

A'rpi / Astral & ESP-team

--
"I don't RTFM? Wow. What's the meaning of this? It's new for me."
	-- Martin Baum, a tipical MPlayer user...



More information about the MPlayer-dev-eng mailing list