[vlc-commits] core: vout: notify when the viewpoint can change

Thomas Guillem git at videolan.org
Fri Nov 18 10:45:44 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Nov 16 16:05:53 2016 +0100| [31c33ab24dcf9de787ae5214c4f4066dbff77dcd] | committer: Thomas Guillem

core: vout: notify when the viewpoint can change

The boolean variable "viewpoint-changeable" will be used by interfaces in order to
know if 360° navigation should be handled.

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

 src/video_output/display.c   | 3 +++
 src/video_output/event.h     | 5 +++++
 src/video_output/vout_intf.c | 1 +
 3 files changed, 9 insertions(+)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index b3fce3c..5747b49 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1319,6 +1319,9 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
         osys->sar.den != source->i_sar_den)
         osys->ch_sar = true;
 
+    vout_SendEventViewpointChangeable(osys->vout,
+        p_display->fmt.projection_mode != PROJECTION_MODE_RECTANGULAR);
+
     return p_display;
 error:
     vlc_mutex_destroy(&osys->lock);
diff --git a/src/video_output/event.h b/src/video_output/event.h
index 8f11250..a5e47da 100644
--- a/src/video_output/event.h
+++ b/src/video_output/event.h
@@ -100,6 +100,11 @@ static inline void vout_SendEventMouseHidden(vout_thread_t *vout)
     /* TODO */
     VLC_UNUSED(vout);
 }
+static inline void vout_SendEventViewpointChangeable(vout_thread_t *vout,
+                                                     bool b_can_change)
+{
+    var_SetBool(vout, "viewpoint-changeable", b_can_change);
+}
 
 #if 0
 static inline void vout_SendEventSnapshot(vout_thread_t *vout, const char *filename)
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 1aa78be..262da21 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -306,6 +306,7 @@ void vout_IntfInit( vout_thread_t *p_vout )
     /* Viewpoint */
     var_Create( p_vout, "viewpoint", VLC_VAR_ADDRESS  | VLC_VAR_DOINHERIT );
     var_AddCallback( p_vout, "viewpoint", ViewpointCallback, NULL );
+    var_Create( p_vout, "viewpoint-changeable", VLC_VAR_BOOL );
 
     vout_IntfReinit( p_vout );
 }



More information about the vlc-commits mailing list