[vlc-commits] glwin32: used flipped coordinates just before we use the placement
Steve Lhomme
git at videolan.org
Wed Aug 26 13:47:20 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Aug 25 12:34:01 2020 +0200| [19a7843683f9bf7d383c7470db3c2b2e59c3dd7d] | committer: Steve Lhomme
glwin32: used flipped coordinates just before we use the placement
No need to do it everytime we receive a possible new placement.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=19a7843683f9bf7d383c7470db3c2b2e59c3dd7d
---
modules/video_output/Makefile.am | 3 ---
modules/video_output/win32/common.c | 8 --------
modules/video_output/win32/glwin32.c | 17 ++++++++++++++---
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/modules/video_output/Makefile.am b/modules/video_output/Makefile.am
index 83fc2bf96a..c42fdc474a 100644
--- a/modules/video_output/Makefile.am
+++ b/modules/video_output/Makefile.am
@@ -145,9 +145,6 @@ libglwin32_plugin_la_SOURCES = \
video_output/win32/win32touch.c video_output/win32/win32touch.h
libwgl_plugin_la_SOURCES = video_output/win32/wgl.c
-libglwin32_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
- -DMODULE_NAME_IS_glwin32
-
libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid libvlc_opengl.la
libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 libvlc_opengl.la
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 60fb4e0f25..110ce8ac62 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -99,14 +99,6 @@ void CommonPlacePicture(vout_display_t *vd, display_win32_area_t *area, vout_dis
/* Update the window position and size */
vout_display_cfg_t place_cfg = area->vdcfg;
-#if (defined(MODULE_NAME_IS_glwin32))
- /* Reverse vertical alignment as the GL tex are Y inverted */
- if (place_cfg.align.vertical == VLC_VIDEO_ALIGN_TOP)
- place_cfg.align.vertical = VLC_VIDEO_ALIGN_BOTTOM;
- else if (place_cfg.align.vertical == VLC_VIDEO_ALIGN_BOTTOM)
- place_cfg.align.vertical = VLC_VIDEO_ALIGN_TOP;
-#endif
-
vout_display_place_t before_place = area->place;
vout_display_PlacePicture(&area->place, &vd->source, &place_cfg);
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 7397d7e9bb..434801ea0d 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -211,11 +211,22 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
return;
if (sys->area.place_changed)
{
- const int width = sys->area.place.width;
- const int height = sys->area.place.height;
+ vout_display_cfg_t place_cfg = sys->area.vdcfg;
+ vout_display_place_t place;
+
+ /* Reverse vertical alignment as the GL tex are Y inverted */
+ if (place_cfg.align.vertical == VLC_VIDEO_ALIGN_TOP)
+ place_cfg.align.vertical = VLC_VIDEO_ALIGN_BOTTOM;
+ else if (place_cfg.align.vertical == VLC_VIDEO_ALIGN_BOTTOM)
+ place_cfg.align.vertical = VLC_VIDEO_ALIGN_TOP;
+
+ vout_display_PlacePicture(&place, &vd->source, &place_cfg);
+
+ const int width = place.width;
+ const int height = place.height;
vlc_gl_Resize (sys->gl, width, height);
vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)width / height);
- vout_display_opengl_Viewport(sys->vgl, sys->area.place.x, sys->area.place.y, width, height);
+ vout_display_opengl_Viewport(sys->vgl, place.x, place.y, width, height);
sys->area.place_changed = false;
}
vout_display_opengl_Prepare (sys->vgl, picture, subpicture);
More information about the vlc-commits
mailing list