[vlc-devel] [V2 PATCH 1/2] es_out: add ES_OUT_SET_VOUT_MOUSE_CALLBACKS

Rémi Denis-Courmont remi at remlab.net
Mon Jul 16 19:09:07 CEST 2018

Le maanantaina 16. heinäkuuta 2018, 16.52.45 EEST Thomas Guillem a écrit :
> > I reckon that conventionally, the VLC mouse event receiver saves the state
> > (if it needs too), not the sender.
> Demuxers won't be able to know when a new vout is restarted or created. So
> the old mouse state that demuxers save can be invalid. That's why I prefer
> to save the mouse state from the vout.

If I have to designate an invalid state between the last event received by the 
demuxer, and the previous state of the video output, it would be the latter.

In this specific corner case, it actually makes more sense to have the demuxer 
save the old state than the provide it. Otherwise, the demuxer will receive 
impossible events such as:
- mouse button released that was not "never" pressed,
- mouse button pressed that was already pressed,
- mouse cursor moving from a position that it did not have.

In other words, the demuxer does not care about the would-be state that it did 
not receive. It either cares about the difference between the previous and 
current, or only about the current state. I believe that Laurent's approach of 
saving the state where it's actually needed makes far more sense from 
reliability point of view.


More information about the vlc-devel mailing list