Commit 12c869d3 authored by Steve Lhomme's avatar 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

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.
parent bd43fa7a
......@@ -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
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))
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");
/* 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 */
......@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment