[vlc-commits] hotkeys: handle viewpoint changes from the vout

Steve Lhomme git at videolan.org
Tue Jul 25 16:43:06 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Tue Jul 25 14:51:11 2017 +0200| [e62a4aadadd58853114c5e7ae0fd445b885a6905] | committer: Thomas Guillem

hotkeys: handle viewpoint changes from the vout

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e62a4aadadd58853114c5e7ae0fd445b885a6905
---

 modules/control/hotkeys.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index a3ddfd9f5e..148588eab0 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -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 );
         }
     }
 



More information about the vlc-commits mailing list