[MPlayer-G2-dev] Re: libvo2 api/design problem
Alban Bedel
albeu at free.fr
Tue Jul 8 11:20:49 CEST 2003
Hi Zoltan Ponekker,
on Tue, 8 Jul 2003 10:22:19 +0200 (CEST) you wrote:
>
> Hali
>
> > I'd prefere #1, but would extend the vo_info_t structure by
> > a special requirements field and put there a VO_NEED_X11 or something
> > like that.
>
> Me too.
I'd like to see smthg like VO_X11_CAPS wich mean that the vo can
optionaly use a provided window (like tdfx_vid, mga?, etc).
These won't fail if a window isn't avaible.
And VO_NEED_X11 for the vo's wich always need a window (x11,xv,etc).
Imho smtgh in the lines of vo_xover could be intersting too. This is for
vo's wich use an overlay with colorkey (pretty common in our case).
I'm too lazy to try to explain xover, so below is some g1 psedo-code.
xover_preinit(subvo) { // subvo is another vo wich must support xover controls
subvo->control(VO_CTRL_HAS_XOVER, ...); // check api support
subvo->preinit; // First look if the subvo work
x11_preinit;
}
xover_config( ... ) {
subvo->config( ... ); // A flag is passed to make the subvo know that he is under xover
setup_x11_win; // see vo_xover, vo_xmga or vo_xvidix ;)
subvo->control(VO_CTRL_SET_COLORKEY, ...); // Set the colorkey
subvo->control(VO_CTRL_SET_WIN, ... ); // Set the position/size of the overlay
}
xover_check_event( ) {
if(check_x11_event()) // Check for window move/resize
subvo->control(VO_CTRL_SET_WIN, ... );
subvo->check_event;
}
All other call are (more or less) directly passed to the subvo.
So vo's wich support this little 'api' get automatic x11 support.
Another advantage of such method is that it can be used with any
windowing system.
I didn't looked libvo2 yet but it's probably easy to have something
similar in a cleaner way.
Albeu
--
Everything is controlled by a small evil group
to which, unfortunately, no one we know belongs.
More information about the MPlayer-G2-dev
mailing list