[vlc-devel] [PATCH 18/18] glwin32: correct vertical alignment

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Fri Aug 4 19:41:12 CEST 2017


---
 modules/video_output/win32/common.c  | 9 +++++++++
 modules/video_output/win32/common.h  | 2 ++
 modules/video_output/win32/glwin32.c | 2 ++
 3 files changed, 13 insertions(+)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index cc6fac08a2..79708a51aa 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -196,6 +196,15 @@ void UpdateRects(vout_display_t *vd,
     place_cfg.display.width = rect.right;
     place_cfg.display.height = rect.bottom;
 
+    /* Reverse vertical alignment as the GL tex are Y inverted */
+    if (sys->b_gl)
+    {
+        if (place_cfg.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
+            place_cfg.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
+        else if (place_cfg.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
+            place_cfg.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
+    }
+
     vout_display_place_t place;
     vout_display_PlacePicture(&place, source, &place_cfg, false);
 
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index a957048541..5172d0f2f4 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -62,6 +62,8 @@ typedef struct vout_display_sys_win32_t
     bool is_first_display;
     bool is_on_top;
 
+    bool b_gl;
+
     /* screensaver system settings to be restored when vout is closed */
     UINT i_spi_screensaveactive;
 
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 4b94a286c3..7a7f267822 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -182,6 +182,8 @@ static int Open(vlc_object_t *object)
     if (!sys)
         return VLC_ENOMEM;
 
+    sys->b_gl = true;
+
     /* */
     if (CommonInit(vd))
         goto error;
-- 
2.13.1



More information about the vlc-devel mailing list