[MPlayer-G2-dev] libvo2 api/design problem

Gábor Lénárt lgb at lgb.hu
Mon Jul 7 23:35:20 CEST 2003


On Mon, Jul 07, 2003 at 11:14:00PM +0200, Arpi wrote:
> Now when a vo driver is configured, vo->event_callback is called
> wiht VO_EVENT_CONFIG, so the event handler can open a window and set
> it via the VOCTRL_SET_WINDOW control().
> 
> I 2 possible solutions:
> 1. assume that every vo device with name beginning wiht char 'x' is x11
>    device. so xv, xmga, xvidix, xgl...
>    it sounds quite lame, but this is the only way to know if a driver is
>    x11 or non-x11 driver, before calling preinit(). it may be interesting
>    for a GUI or even for a CLI app to know which drivers require X11 or
>    which drivers won't use X11 (if the GUI has embedded winde, liek a
>    browser plugin).
> 2. instead of using VO_EVENT_CONFIG to requiest teh window, we could
>    define VO_EVENT_SET_WINDOW or so, so x11 drivers can ask for a
>    window (at config()) if not yet set (via control()).

I guess idea #2 looks more familiar at least for me. It's more clear even
from the point of view of modularization. But #1 is interesting as well,
however for THIS single problem #2 is better, IMHO. Of course it will be
also good to have some dependency information without messing with vo
drivers, but it can be easily implemented to extend the vo_info_t structure
with some 'dependency' flags (X11 dependent vo, etc, maybe other good
ideas as well). Also I think, some of the VOs should be NOT available for
an average GUI, because GUI users often does not know too much about
program internals, and so, that's why -vo mga will be VERY annoying for
them (you can't make them understand that -vo mga will produce only an
overlay and not a window at the point of X). For them only xmga, or xv
can be assumed as selectable vo drivers. But maybe not :) 

Also, for eg builing plugger for browsers requires replacing x11_common.c.
It would be better to provide some call mechanism to allow to UI frontend
coders to easily pass some function pointers or something with their own
functions without replacing code, also it would allow to link together the
object files with a plugger skeleton, then with mplayer CLI skeleton etc,
without tricking x11_common.c and their replacments. So modularization :)

- Gábor (larta'H)



More information about the MPlayer-G2-dev mailing list