[vlc-devel] [PATCH 10/17] vout: opengl: handle VOUT_DISPLAY_CHANGE_VIEWPOINT

Steve Lhomme robux4 at videolabs.io
Mon Nov 14 15:16:19 CET 2016


---
 modules/video_output/caopengllayer.m |  4 ++++
 modules/video_output/gl.c            |  3 +++
 modules/video_output/ios2.m          |  4 ++++
 modules/video_output/macosx.m        |  6 +++++-
 modules/video_output/win32/glwin32.c | 13 ++++++++++++-
 modules/video_output/xcb/glx.c       |  4 ++++
 6 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 7ad6cc5..81a6e92 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -402,6 +402,10 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             return VLC_SUCCESS;
         }
 
+        case VOUT_DISPLAY_CHANGE_VIEWPOINT:
+            return vout_display_opengl_SetViewpoint(sys->vgl,
+                &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+
         case VOUT_DISPLAY_RESET_PICTURES:
             vlc_assert_unreachable ();
         default:
diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c
index 082aa78..3d5afa8 100644
--- a/modules/video_output/gl.c
+++ b/modules/video_output/gl.c
@@ -249,6 +249,9 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         vlc_gl_ReleaseCurrent (sys->gl);
         return VLC_SUCCESS;
       }
+      case VOUT_DISPLAY_CHANGE_VIEWPOINT:
+        return vout_display_opengl_SetViewpoint (sys->vgl,
+            &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
       default:
         msg_Err (vd, "Unknown request %d", query);
     }
diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index 797c615..7c77b1b 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -425,6 +425,10 @@ static int Control(vout_display_t *vd, int query, va_list ap)
             return VLC_SUCCESS;
         }
 
+        case VOUT_DISPLAY_CHANGE_VIEWPOINT:
+            return vout_display_opengl_SetViewpoint(sys->vgl,
+                &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+
         case VOUT_DISPLAY_RESET_PICTURES:
             vlc_assert_unreachable ();
         default:
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 2c3dcd3..c6d1d07 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -432,7 +432,11 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 [NSCursor setHiddenUntilMouseMoves: YES];
                 return VLC_SUCCESS;
             }
-                
+
+            case VOUT_DISPLAY_CHANGE_VIEWPOINT:
+                return vout_display_opengl_SetViewpoint (sys->vgl,
+                    &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+
             case VOUT_DISPLAY_RESET_PICTURES:
                 vlc_assert_unreachable ();
             default:
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 01bae19..cd7339b 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -147,6 +147,17 @@ static void DestroyGPUAffinityDC(vout_display_t *vd) {
     fncDeleteDCNV(vd->sys->affinityHDC);
 }
 
+static int Control(vout_display_t *vd, int query, va_list args)
+{
+    vout_display_sys_t *sys = vd->sys;
+
+    if (query == VOUT_DISPLAY_CHANGE_VIEWPOINT)
+        return vout_display_opengl_SetViewpoint(sys->vgl,
+            &va_arg (args, const vout_display_cfg_t* )->viewpoint);
+
+    return CommonControl(vd, query, args);
+}
+
 /**
  * It creates an OpenGL vout display.
  */
@@ -227,7 +238,7 @@ static int Open(vlc_object_t *object)
     vd->pool    = Pool;
     vd->prepare = Prepare;
     vd->display = Display;
-    vd->control = CommonControl;
+    vd->control = Control;
     vd->manage  = Manage;
 
     return VLC_SUCCESS;
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index 469f9ec..e87704a 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -247,6 +247,10 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         xcb_flush (sys->conn);
         return VLC_SUCCESS;
 
+    case VOUT_DISPLAY_CHANGE_VIEWPOINT:
+        return vout_display_opengl_SetViewpoint (sys->vgl,
+            &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+
     case VOUT_DISPLAY_RESET_PICTURES:
         vlc_assert_unreachable ();
     default:
-- 
2.10.1



More information about the vlc-devel mailing list