[vlc-commits] vout:win32: remove the display dimensions callback
Steve Lhomme
git at videolan.org
Tue Apr 30 11:14:01 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Apr 16 08:45:50 2019 +0200| [12c869d3807be051b80ba1d2689e74135496019d] | committer: Steve Lhomme
vout:win32: remove the display dimensions callback
The dimension to use is always set in area->vdcfg.display. The hwnd size always
matches this size since we resize it accordingly for each
DISPLAY_CHANGE_DISPLAY_SIZE call.
There is a slight delay between the moment the window tells the core of the
size change and the moment it's effective in the display. So resizing quickly
is not as smooth as when reading the HWND size directly.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12c869d3807be051b80ba1d2689e74135496019d
---
modules/video_output/win32/common.c | 36 ------------------------------------
modules/video_output/win32/common.h | 3 ---
2 files changed, 39 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 1b34b2e41a..cff32ff017 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -44,19 +44,9 @@
#include "common.h"
#include "../video_chroma/copy.h"
-static bool GetExternalDimensions(void *opaque, UINT *width, UINT *height)
-{
- const display_win32_area_t *area = opaque;
- *width = area->vdcfg.display.width;
- *height = area->vdcfg.display.height;
- return true;
-}
-
void InitArea(vout_display_t *vd, display_win32_area_t *area, const vout_display_cfg_t *vdcfg)
{
area->place_changed = false;
- area->pf_GetDisplayDimensions = GetExternalDimensions;
- area->opaque_dimensions = area;
area->vdcfg = *vdcfg;
area->texture_source = vd->source;
@@ -67,18 +57,6 @@ void InitArea(vout_display_t *vd, display_win32_area_t *area, const vout_display
#if !VLC_WINSTORE_APP
static void CommonChangeThumbnailClip(vlc_object_t *, vout_display_sys_win32_t *, bool show);
-static bool GetWindowDimensions(void *opaque, UINT *width, UINT *height)
-{
- const vout_display_sys_win32_t *sys = opaque;
- assert(sys != NULL);
- RECT out;
- if (!GetClientRect(sys->hvideownd, &out))
- return false;
- *width = RECTWidth(out);
- *height = RECTHeight(out);
- return true;
-}
-
/* */
int CommonInit(vlc_object_t *obj, display_win32_area_t *area,
vout_display_sys_win32_t *sys, bool projection_gestures)
@@ -86,9 +64,6 @@ int CommonInit(vlc_object_t *obj, display_win32_area_t *area,
if (unlikely(area->vdcfg.window == NULL))
return VLC_EGENERIC;
- area->pf_GetDisplayDimensions = GetWindowDimensions;
- area->opaque_dimensions = sys;
-
/* */
#if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
@@ -128,19 +103,8 @@ int CommonInit(vlc_object_t *obj, display_win32_area_t *area,
*****************************************************************************/
void UpdateRects(vlc_object_t *obj, display_win32_area_t *area, vout_display_sys_win32_t *sys)
{
- UINT display_width, display_height;
-
- /* Retrieve the window size */
- if (!area->pf_GetDisplayDimensions(area->opaque_dimensions, &display_width, &display_height))
- {
- msg_Err(obj, "could not get the window dimensions");
- return;
- }
-
/* Update the window position and size */
vout_display_cfg_t place_cfg = area->vdcfg;
- place_cfg.display.width = display_width;
- place_cfg.display.height = display_height;
#if (defined(MODULE_NAME_IS_glwin32))
/* Reverse vertical alignment as the GL tex are Y inverted */
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 9b04e40d20..e2d928a05a 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -39,9 +39,6 @@ typedef struct display_win32_area_t
video_format_t texture_source;
vout_display_cfg_t vdcfg;
-
- bool (*pf_GetDisplayDimensions)(void *opaque, UINT *w, UINT *h);
- void *opaque_dimensions;
} display_win32_area_t;
#define RECTWidth(r) (LONG)((r).right - (r).left)
More information about the vlc-commits
mailing list