[vlc-devel] [PATCH 02/41] vout:win32: the UpdateRects outside of common is always forced
Steve Lhomme
robux4 at ycbcr.xyz
Fri Mar 22 16:13:40 CET 2019
Otherwise it's handled internally to minimize changes.
---
modules/video_output/win32/common.c | 19 ++++++++++++-------
modules/video_output/win32/common.h | 2 +-
modules/video_output/win32/direct3d11.c | 6 +++---
modules/video_output/win32/direct3d9.c | 4 ++--
modules/video_output/win32/wingdi.c | 2 +-
5 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 18b1ffdfbf..f78bdeb5c5 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -138,7 +138,7 @@ int CommonInit(vout_display_t *vd, bool b_windowless, const vout_display_cfg_t *
* its job is to update the source and destination RECTs used to display the
* picture.
*****************************************************************************/
-void UpdateRects(vout_display_t *vd, bool is_forced)
+static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
{
vout_display_sys_t *sys = vd->sys;
const video_format_t *source = &vd->source;
@@ -303,6 +303,11 @@ exit:
#undef rect_dest_clipped
}
+void UpdateRects(vout_display_t *vd)
+{
+ UpdateRectsInternal(vd, true);
+}
+
#if !VLC_WINSTORE_APP
/* */
void CommonClean(vout_display_t *vd)
@@ -354,13 +359,13 @@ void CommonManage(vout_display_t *vd)
rect_parent.bottom - rect_parent.top,
SWP_NOZORDER);
- UpdateRects(vd, true);
+ UpdateRectsInternal(vd, true);
}
}
/* HasMoved means here resize or move */
if (EventThreadGetAndResetHasMoved(sys->event))
- UpdateRects(vd, false);
+ UpdateRectsInternal(vd, false);
}
/**
@@ -529,7 +534,7 @@ static int CommonControlSetFullscreen(vout_display_t *vd, bool is_fullscreen)
#else
void CommonManage(vout_display_t *vd) {
- UpdateRects(vd, false);
+ UpdateRectsInternal(vd, false);
}
void CommonClean(vout_display_t *vd) {}
void CommonDisplay(vout_display_t *vd) {}
@@ -547,7 +552,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
case VOUT_DISPLAY_CHANGE_SOURCE_CROP: {
const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
sys->area.vdcfg = *cfg;
- UpdateRects(vd, true);
+ UpdateRectsInternal(vd, true);
return VLC_SUCCESS;
}
#if !VLC_WINSTORE_APP
@@ -568,7 +573,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
rect_window.bottom - rect_window.top, SWP_NOMOVE);
}
sys->area.vdcfg = *cfg;
- UpdateRects(vd, false);
+ UpdateRectsInternal(vd, false);
return VLC_SUCCESS;
}
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: { /* unsigned state */
@@ -594,7 +599,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
bool fs = va_arg(args, int);
if (CommonControlSetFullscreen(vd, fs))
return VLC_EGENERIC;
- UpdateRects(vd, false);
+ UpdateRectsInternal(vd, false);
return VLC_SUCCESS;
}
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index d6befddfef..2e6253626f 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -94,7 +94,7 @@ void CommonManage(vout_display_t *);
int CommonControl(vout_display_t *, int , va_list );
void CommonDisplay(vout_display_t *);
-void UpdateRects (vout_display_t *, bool is_forced);
+void UpdateRects (vout_display_t *);
/*****************************************************************************
* Constants
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 23a641c615..ec917bd884 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -862,7 +862,7 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
sys->picQuad.i_height = texDesc.Height;
sys->picQuad.i_width = texDesc.Width;
- UpdateRects(vd, true);
+ UpdateRects(vd);
UpdateSize(vd);
}
}
@@ -1473,7 +1473,7 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
sys->picQuad.i_height = (sys->picQuad.i_height + 0x01) & ~0x01;
}
- UpdateRects(vd, true);
+ UpdateRects(vd);
video_format_t surface_fmt = *fmt;
surface_fmt.i_width = sys->picQuad.i_width;
@@ -1576,7 +1576,7 @@ static int Direct3D11CreateGenericResources(vout_display_t *vd)
ID3D11DepthStencilState_Release(pDepthStencilState);
}
- UpdateRects(vd, true);
+ UpdateRects(vd);
hr = UpdateBackBuffer(vd);
if (FAILED(hr)) {
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index b730a5abef..efa0132522 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -877,7 +877,7 @@ static int Direct3D9Reset(vout_display_t *vd, video_format_t *fmtp)
return VLC_EGENERIC;
}
- UpdateRects(vd, true);
+ UpdateRects(vd);
/* re-create them */
if (Direct3D9CreateResources(vd, fmtp)) {
@@ -1492,7 +1492,7 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt,
fmt->i_bmask = d3dfmt->bmask;
sys->sw_texture_fmt = d3dfmt;
- UpdateRects(vd, true);
+ UpdateRects(vd);
if (Direct3D9CreateResources(vd, fmt)) {
msg_Err(vd, "Failed to allocate resources");
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index cd04e30b09..c34b4ae264 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -275,7 +275,7 @@ static int Init(vout_display_t *vd, video_format_t *fmt)
if (!sys->sys.b_windowless)
EventThreadUpdateTitle(sys->sys.event, VOUT_TITLE " (WinGDI output)");
- UpdateRects(vd, true);
+ UpdateRects(vd);
return VLC_SUCCESS;
}
--
2.17.1
More information about the vlc-devel
mailing list