Commit e62a4aad authored by Steve Lhomme's avatar Steve Lhomme Committed by Thomas Guillem

hotkeys: handle viewpoint changes from the vout

Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 25ec3acb
......@@ -133,6 +133,17 @@ static int MovedEvent( vlc_object_t *p_this, char const *psz_var,
return VLC_SUCCESS;
}
static int ViewpointMovedEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
intf_thread_t *p_intf = (intf_thread_t *)p_data;
intf_sys_t *p_sys = p_intf->p_sys;
input_UpdateViewpoint( p_sys->p_input, newval.p_address, false );
return VLC_SUCCESS;
}
static int ButtonEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
......@@ -189,6 +200,8 @@ static void ChangeVout( intf_thread_t *p_intf, vout_thread_t *p_vout )
p_intf );
var_DelCallback( p_old_vout, "mouse-button-down", ButtonEvent,
p_intf );
var_DelCallback( p_old_vout, "viewpoint-moved", ViewpointMovedEvent,
p_intf );
}
vlc_object_release( p_old_vout );
}
......@@ -200,6 +213,8 @@ static void ChangeVout( intf_thread_t *p_intf, vout_thread_t *p_vout )
p_intf );
var_AddCallback( p_sys->p_vout, "mouse-button-down", ButtonEvent,
p_intf );
var_AddCallback( p_sys->p_vout, "viewpoint-moved", ViewpointMovedEvent,
p_intf );
}
}
......@@ -238,6 +253,8 @@ static void ChangeInput( intf_thread_t *p_intf, input_thread_t *p_input )
p_intf );
var_DelCallback( p_old_vout, "mouse-button-down", ButtonEvent,
p_intf );
var_DelCallback( p_old_vout, "viewpoint-moved", ViewpointMovedEvent,
p_intf );
}
}
......
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