[vlc-devel] [PATCH] display: pass a vlc_viewpoint_t directly to VOUT_DISPLAY_CHANGE_VIEWPOINT

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 25 07:13:27 CEST 2020


No need to pass the whole display config.
---
 include/vlc_vout_display.h              | 2 +-
 modules/video_output/caopengllayer.m    | 2 +-
 modules/video_output/ios.m              | 2 +-
 modules/video_output/macosx.m           | 2 +-
 modules/video_output/opengl/display.c   | 2 +-
 modules/video_output/win32/direct3d11.c | 4 ++--
 modules/video_output/win32/glwin32.c    | 2 +-
 src/video_output/display.c              | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index b6282b052b4..2a0b593a13e 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -218,7 +218,7 @@ enum vout_display_query {
     /**
      * Notifies a change of VR/360° viewpoint.
      */
-    VOUT_DISPLAY_CHANGE_VIEWPOINT,   /* const vout_display_cfg_t *p_cfg */
+    VOUT_DISPLAY_CHANGE_VIEWPOINT,   /* const vlc_viewpoint_t * */
 };
 
 /**
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 08e88f42aa8..0dafcec000a 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -347,7 +347,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 return VLC_EGENERIC;
 
             ret = vout_display_opengl_SetViewpoint(sys->vgl,
-                &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+                                                   va_arg(ap, const vlc_viewpoint_t*));
             OpenglUnlock(sys->gl);
             return ret;
         }
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 6fbeaa49afe..80b75147c7e 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -273,7 +273,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
 
         case VOUT_DISPLAY_CHANGE_VIEWPOINT:
             return vout_display_opengl_SetViewpoint(glsys->vgl,
-                &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+                                                    va_arg(ap, const vlc_viewpoint_t*));
 
         case VOUT_DISPLAY_RESET_PICTURES:
             vlc_assert_unreachable ();
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index a1bee8fb12b..15d0c305772 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -387,7 +387,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 
             case VOUT_DISPLAY_CHANGE_VIEWPOINT:
                 return vout_display_opengl_SetViewpoint (sys->vgl,
-                    &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+                                                         va_arg(ap, const vlc_viewpoint_t*));
 
             case VOUT_DISPLAY_RESET_PICTURES:
                 vlc_assert_unreachable ();
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index f4e46f6f33d..2db08ccc03b 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -255,7 +255,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
       }
       case VOUT_DISPLAY_CHANGE_VIEWPOINT:
         return vout_display_opengl_SetViewpoint (sys->vgl,
-            &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+                                                 va_arg(ap, const vlc_viewpoint_t*));
       default:
         msg_Err (vd, "Unknown request %d", query);
     }
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 06f81947843..b88b347356e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -494,10 +494,10 @@ static int Control(vout_display_t *vd, int query, va_list args)
 
     if (query == VOUT_DISPLAY_CHANGE_VIEWPOINT)
     {
-        const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t*);
+        const vlc_viewpoint_t *viewpoint = va_arg(args, const vlc_viewpoint_t*);
         if ( sys->picQuad.pVertexShaderConstants )
         {
-            SetQuadVSProjection( vd, &sys->picQuad, &cfg->viewpoint );
+            SetQuadVSProjection( vd, &sys->picQuad, viewpoint );
             res = VLC_SUCCESS;
         }
     }
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 07a49418e4c..83f28329397 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -79,7 +79,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
 
     if (query == VOUT_DISPLAY_CHANGE_VIEWPOINT)
         return vout_display_opengl_SetViewpoint(sys->vgl,
-            &va_arg (args, const vout_display_cfg_t* )->viewpoint);
+                                                va_arg(args, const vlc_viewpoint_t*));
 
     return CommonControl(vd, &sys->area, &sys->sys, query, args);
 }
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 8fd444168d0..0112425ac14 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -726,7 +726,7 @@ void vout_SetDisplayViewpoint(vout_display_t *vd,
         osys->cfg.viewpoint = *p_viewpoint;
 
         if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_VIEWPOINT,
-                                 &osys->cfg)) {
+                                 &osys->cfg.viewpoint)) {
             msg_Err(vd, "Failed to change Viewpoint");
             osys->cfg.viewpoint = old_vp;
         }
-- 
2.26.2



More information about the vlc-devel mailing list