[vlc-devel] [PATCH] libvlc: add API to propagate mouse move and down/up events

Felix Paul Kühne fkuehne at videolan.org
Tue May 6 17:45:26 CEST 2014


Hello Rémi,

Thanks for the review.

On 05 May 2014, at 22:21, Rémi Denis-Courmont <remi at remlab.net> wrote:

> Le lundi 5 mai 2014, 23:20:28 Rémi Denis-Courmont a écrit :
>> Le lundi 5 mai 2014, 21:47:29 Felix Paul Kühne a écrit :
>>> This is needed when using OSD menus with a vout which can't detect mouse
>>> movements because it doesn't have access to the window server it lives in
>>> 
>>> vmem.
>> 
>> You don't know which vmem instance you are referring to. This is totally
>> broken if you have more than one window.

This is absolutely true.

However: libvlc_video_get_cursor() already uses the same pattern I do in this patch. It lets you access the video output by N.

Additionally, if you consider the remainder of the video API listed in libvlc_medoa_player.h, it appears to me as if more than one video output per libvlc instance was never a supported scenario. This starts with the ability to select a single video track only, but doesn’t end there.

> (And I think this is solved by implementing a proper vout plugin, not by 
> hacking vmem further.)

I fully agree, however, this is not really feasible in the scenario targeted by the patch.

For the NPAPI plugin, we support a special rendering mode called “windowless”, which does not make use of the existing libvlc vout modules. It is blitting the vmem buffer directly into the HTML context of a website. This allows fancy stuff like the application of HTML5 effects on the vout and overlays of HTML contents like buttons or text.
In this scenario, vmem is not aware of a mouse cursor, which is the correct way to do things. However, the web plugin is notified about mouse movements and clicks within the drawing rectangle. Those events need to be forwarded to libvlc in a way, so the user can interact with an OSD like a DVD menu, etc. Of course, it is the web plugin’s duty to convert relative screen coordinates of the mouse to screen coordinates within the video by taking account of current scaling, possibly adapted aspect ratio, etc. This is part of a second patch (implemented for the mac only so far), which I push as soon as this patch is merged.

Please let me know if you stumble across ideas how to improve this patch.

Thanks,

Felix




More information about the vlc-devel mailing list