[vlc-devel] Re : [PATCH] - issue with mouse-x/mouse-y on Linux

brezhoneg Breizh brezhoneg1 at yahoo.fr
Wed Feb 11 21:32:59 CET 2009

De : Rémi Denis-Courmont <rem at videolan.org>

Le mercredi 11 février 2009 19:54:06 brezhoneg1, vous avez écrit :
>> Now, do we need [   p_vout->fmt_in.i_x_offset,
>> p_vout->fmt_in.i_visible_width + p_vout->fmt_in.i_x_offset  ] as the
>> range of value is another question ? But, if this formula is used, this
>> is the segment that results from it.

>mouse-x and mouse-y are used by plugins to determine where (in the original 
>format reference) the user clicks. DVD menus and puzzles are the two users 
>that I know. IMHO, no matter how you look at it, there is no way to obtain a 
>general correct formula with non zero offsets. As far as I understand, the 
>video offsets is nothing but the amount of padding at the beginning of each 
>scan line and the number of initial unused scan lines.

You just gave me the element I was missing, : mouse-x and mouse-y have to be in the original format reference for DVD menus and puzzles to exactly pinpoint things.

Actually, x_offset and y_offset are only used (in my tests) when cropping. Since a picture is never actually truncated, a (x_offset, y_offset, visible_width, visible_height) tells everybody the subset of pixels that are really used in memory. Yet, DVD menus still need the full non-truncated picture to figure out things.

So the [ xoffset, x_offset + visible_width] is indeed the right reference since it refers to the full untouched  initial picture ( whereas [0, visible_width] would be plainly wrong )

Now, for xcommon.c and sdl.c, we should do something because the way it is done is not consistent.
Either we remove testing the limits (vout in msw, mac and others seem to live without them ?) or we guarantee the entire segment (not a truncated one!) is available   (Right now, we have { 0 } U [x_offset, visible_width - x_offset ] set !!!!)

Which solution do you prefer ?

>How that corelates to the original width should not be known. IMHO, this is 
>just yet another bug in the video filter architecture. The mouse coordinates 
>should be translated by filters as appropriate. Anyway, that exceeds my 
>competences already.


Ne pleurez pas si votre Webmail ferme ! Récupérez votre historique sur Yahoo! Mail ! http://fr.docs.yahoo.com/mail/transfert_mails.html

More information about the vlc-devel mailing list