[vlc-commits] vout: opengl: transmit the window aspect ratio

Adrien Maglo git at videolan.org
Fri Nov 25 10:37:32 CET 2016


vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Mon Nov 21 18:26:25 2016 +0100| [5a67ef064179cd140e8d02dd9500744d46ab3363] | committer: Thomas Guillem

vout: opengl: transmit the window aspect ratio

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 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..c7d7898 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_SetWindowAspectRatio(sys->vgl, (float)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..f89e7c3 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_SetWindowAspectRatio(sys->vgl, (float)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_SetWindowAspectRatio(sys->vgl, (float)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..bfeefe5 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_SetWindowAspectRatio(sys->vgl, (float)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..81be6c5 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_SetWindowAspectRatio(sys->vgl, (float)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..4a0ac0d 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_SetWindowAspectRatio(sys->vgl, (float)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..9d7546b 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_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);
         glViewport (place.x, place.y, place.width, place.height);
         vlc_gl_ReleaseCurrent (sys->gl);
         return VLC_SUCCESS;



More information about the vlc-commits mailing list