Commit 4c3384da authored by Laurent Aimar's avatar Laurent Aimar

Let mouse events go through vout filter chain.

It only works for vout display modules.
parent 1e48c75e
......@@ -1422,6 +1422,15 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
#include "vout_internal.h"
void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
{
vlc_mouse_t tmp;
vlc_mutex_lock( &vout->p->vfilter_lock );
if (vout->p->p_vf2_chain) {
if (!filter_chain_MouseFilter(vout->p->p_vf2_chain, &tmp, m))
m = &tmp;
}
vlc_mutex_unlock( &vout->p->vfilter_lock );
if (vlc_mouse_HasMoved(&vout->p->mouse, m)) {
vout_SendEventMouseMoved(vout, m->i_x, m->i_y);
}
......@@ -1453,10 +1462,13 @@ static void DummyVoutSendDisplayEventMouse(vout_thread_t *vout, vlc_mouse_t *fal
if (!vout->p) {
p.mouse = *fallback;
vlc_mutex_init(&p.vfilter_lock);
p.p_vf2_chain = NULL;
vout->p = &p;
}
vout_SendDisplayEventMouse(vout, m);
if (vout->p == &p) {
vlc_mutex_destroy(&p.vfilter_lock);
*fallback = p.mouse;
vout->p = NULL;
}
......
......@@ -1111,8 +1111,12 @@ static void* RunThread( void *p_this )
p_filtered_picture = NULL;
if( p_picture )
{
vlc_mutex_lock( &p_vout->p->vfilter_lock );
p_filtered_picture = filter_chain_VideoFilter( p_vout->p->p_vf2_chain,
p_picture );
vlc_mutex_unlock( &p_vout->p->vfilter_lock );
}
const bool b_snapshot = vout_snapshot_IsRequested( &p_vout->p->snapshot );
......
......@@ -60,7 +60,7 @@ struct vout_thread_sys_t
vlc_cond_t picture_wait;
/* */
vlc_mutex_t vfilter_lock; /**< video filter2 change lock */
vlc_mutex_t vfilter_lock; /**< video filter2 lock */
/* */
uint32_t render_time; /**< last picture render time */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment