Commit 900e2f5e authored by Steve Lhomme's avatar Steve Lhomme

vout:win32: add a flag to allow display modules handle the full display size

Right now all Windows display module render on the hvideownd which is already
cropped and positioned according to the PlacePicture results.
In external rendering we do not have this mechanism and so we need to be able
to render on the full display but cropping according to the PlacePicture result.

Ultimately that should be the only mode. D3D and OpenGL should have no problem
cropping and stretching in the proper area. WinGDI should also be able to only
draw on a portion of a HWND. It can already stretch.
parent 135970ac
......@@ -79,7 +79,8 @@ static bool GetWindowDimensions(void *opaque, UINT *width, UINT *height)
/* */
int CommonInit(vlc_object_t *obj, display_win32_area_t *area,
vout_display_sys_win32_t *sys, bool projection_gestures)
vout_display_sys_win32_t *sys,
bool projection_gestures, bool full_size_video)
{
if (unlikely(area->vdcfg.window == NULL))
return VLC_EGENERIC;
......@@ -95,6 +96,7 @@ int CommonInit(vlc_object_t *obj, display_win32_area_t *area,
sys->hvideownd = NULL;
sys->hparent = NULL;
sys->is_first_placement = true;
sys->full_size_video = full_size_video;
/* */
sys->event = EventThreadCreate(obj, area->vdcfg.window);
......@@ -184,6 +186,11 @@ void UpdateRects(vout_display_t *vd, display_win32_area_t *area, vout_display_sy
swpFlags |= SWP_SHOWWINDOW;
sys->is_first_placement = false;
}
if (sys->full_size_video)
SetWindowPos(sys->hvideownd, 0,
0, 0, display_width, display_height,
swpFlags);
else
SetWindowPos(sys->hvideownd, 0,
area->place.x, area->place.y, area->place.width, area->place.height,
swpFlags);
......
......@@ -67,6 +67,7 @@ typedef struct vout_display_sys_win32_t
/* Misc */
bool is_first_placement;
bool full_size_video; /* true if hvideownd should have the same size as hwnd */
} vout_display_sys_win32_t;
......@@ -74,7 +75,8 @@ typedef struct vout_display_sys_win32_t
* Prototypes from common.c
*****************************************************************************/
#if !VLC_WINSTORE_APP
int CommonInit(vlc_object_t *, display_win32_area_t *, vout_display_sys_win32_t *, bool projection_gestures);
int CommonInit(vlc_object_t *, display_win32_area_t *, vout_display_sys_win32_t *,
bool projection_gestures, bool full_size_video);
void CommonClean(vlc_object_t *, vout_display_sys_win32_t *);
#endif /* !VLC_WINSTORE_APP */
int CommonControl(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, int , va_list );
......
......@@ -476,7 +476,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
if (d3d11_ctx == NULL)
{
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys,
vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR))
vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR, false))
goto error;
}
#else /* !VLC_WINSTORE_APP */
......
......@@ -1624,7 +1624,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
InitArea(vd, &sys->area, cfg);
if (d3d9_device == NULL)
{
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false))
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false, false))
goto error;
}
......
......@@ -124,7 +124,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
/* */
InitArea(vd, &sys->area, cfg);
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys,
vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR))
vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR, false))
goto error;
if (vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR)
......
......@@ -118,7 +118,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
return VLC_ENOMEM;
InitArea(vd, &sys->area, cfg);
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false))
if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false, false))
goto error;
/* */
......
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