[vlc-commits] libvlc: add f_zoom in libvlc_video_viewpoint_t

Thomas Guillem git at videolan.org
Thu Nov 17 09:48:27 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Nov 16 13:44:08 2016 +0100| [f4ea7434d2a68d8b39244dac2aeb7fe4acb2d545] | committer: Thomas Guillem

libvlc: add f_zoom in libvlc_video_viewpoint_t

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

 include/vlc/libvlc_media_player.h | 1 +
 lib/video.c                       | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index b6e697e..038e254 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1177,6 +1177,7 @@ typedef struct libvlc_video_viewpoint_t
     float f_pitch;         /**< view point pitch in degrees */
     float f_roll;          /**< view point roll in degrees */
     float f_field_of_view; /**< field of view in degrees (default 80.0f) */
+    float f_zoom;          /**< zoom factor, [-1.f, 1.f] range, default to 0.f */
 } libvlc_video_viewpoint_t;
 
 /**
diff --git a/lib/video.c b/lib/video.c
index 4b16564..0c5948f 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -287,7 +287,8 @@ libvlc_video_viewpoint_t *libvlc_video_new_viewpoint(void)
     libvlc_video_viewpoint_t *p_vp = malloc(sizeof *p_vp);
     if (unlikely(p_vp == NULL))
         return NULL;
-    p_vp->f_yaw = p_vp->f_pitch = p_vp->f_roll = p_vp->f_field_of_view = 0.0f;
+    p_vp->f_yaw = p_vp->f_pitch = p_vp->f_roll = p_vp->f_field_of_view =
+    p_vp->f_zoom = 0.0f;
     return p_vp;
 }
 
@@ -300,7 +301,7 @@ int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
         .pitch = p_viewpoint->f_pitch,
         .roll  = p_viewpoint->f_roll,
         .fov   = p_viewpoint->f_field_of_view,
-        .zoom  = 0.0f,
+        .zoom  = p_viewpoint->f_zoom,
     };
 
     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi );
@@ -322,6 +323,7 @@ int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
         p_mi->viewpoint.pitch += p_mi->viewpoint.pitch;
         p_mi->viewpoint.roll += p_mi->viewpoint.roll;
         p_mi->viewpoint.fov += p_mi->viewpoint.fov;
+        p_mi->viewpoint.zoom += p_mi->viewpoint.zoom;
     }
     else
         p_mi->viewpoint = update;



More information about the vlc-commits mailing list