[vlc-devel] [PATCH 3/3] OpenGL vouts: transmit the window size to update the aspect ratio

Adrien Maglo magsoft at videolan.org
Mon Nov 21 17:45:58 CET 2016


---
 modules/video_output/caopengllayer.m | 1 +
 modules/video_output/gl.c            | 2 ++
 modules/video_output/ios2.m          | 2 ++
 modules/video_output/macosx.m        | 2 ++
 modules/video_output/win32/glwin32.c | 1 +
 modules/video_output/xcb/glx.c       | 1 +
 6 files changed, 9 insertions(+)

diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 1be3ee6..6f11f0e 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -389,6 +389,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 
             vout_display_place_t place;
             vout_display_PlacePicture (&place, source, &cfg_tmp, false);
+            vout_display_opengl_SetWindowSize(sys->vgl, place.width, place.height);
             sys->place = place;
 
             return VLC_SUCCESS;
diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c
index e272396..a9a5903 100644
--- a/modules/video_output/gl.c
+++ b/modules/video_output/gl.c
@@ -232,6 +232,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         vout_display_PlacePicture (&place, src, c, false);
         vlc_gl_Resize (sys->gl, place.width, place.height);
         vlc_gl_MakeCurrent (sys->gl);
+        vout_display_opengl_SetWindowSize(sys->vgl, place.width, place.height);
         glViewport (place.x, place.y, place.width, place.height);
         vlc_gl_ReleaseCurrent (sys->gl);
         return VLC_SUCCESS;
@@ -246,6 +247,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 
         vout_display_PlacePicture (&place, src, cfg, false);
         vlc_gl_MakeCurrent (sys->gl);
+        vout_display_opengl_SetWindowSize(sys->vgl, place.width, place.height);
         glViewport (place.x, place.y, place.width, place.height);
         vlc_gl_ReleaseCurrent (sys->gl);
         return VLC_SUCCESS;
diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index a47941f..c8a95d6 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -419,6 +419,8 @@ static int Control(vout_display_t *vd, int query, va_list ap)
                     sys->place = place;
                 }
 
+                vout_display_opengl_SetWindowSize(sys->vgl, place.width, place.height);
+
                 // x / y are top left corner, but we need the lower left one
                 if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
                     glViewport(place.x, cfg_tmp.display.height - (place.y + place.height), place.width, place.height);
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 3ba8fd0..c9ab41c 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -421,6 +421,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                     sys->place = place;
                 }
 
+                vout_display_opengl_SetWindowSize(sys->vgl, place.width, place.height);
+
                 /* For resize, we call glViewport in reshape and not here.
                  This has the positive side effect that we avoid erratic sizing as we animate every resize. */
                 if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 07c2425..1445460 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -311,6 +311,7 @@ static void Manage (vout_display_t *vd)
 
     const int width  = sys->rect_dest.right  - sys->rect_dest.left;
     const int height = sys->rect_dest.bottom - sys->rect_dest.top;
+    vout_display_opengl_SetWindowSize(sys->vgl, width, height);
     glViewport(0, 0, width, height);
 }
 
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index a7fb71b..c4c02be 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -235,6 +235,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         vout_display_PlacePicture (&place, source, cfg, false);
 
         vlc_gl_MakeCurrent (sys->gl);
+        vout_display_opengl_SetWindowSize(sys->vgl, place.width, place.height);
         glViewport (place.x, place.y, place.width, place.height);
         vlc_gl_ReleaseCurrent (sys->gl);
         return VLC_SUCCESS;
-- 
2.9.3



More information about the vlc-devel mailing list