[vlc-commits] vout:win32: the first display call check is actually the first placement
Steve Lhomme
git at videolan.org
Mon Apr 1 12:03:29 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Apr 1 09:08:49 2019 +0200| [5e502e8da36b944b2d67fe6eb7aa80ed37f70f39] | committer: Steve Lhomme
vout:win32: the first display call check is actually the first placement
Show the video window the first time it's placed.
We don't need CommonDisplay() anymore.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5e502e8da36b944b2d67fe6eb7aa80ed37f70f39
---
modules/video_output/win32/common.c | 34 ++++++++++-----------------------
modules/video_output/win32/common.h | 3 +--
modules/video_output/win32/direct3d11.c | 4 ----
modules/video_output/win32/direct3d9.c | 2 --
modules/video_output/win32/glwin32.c | 2 --
modules/video_output/win32/wingdi.c | 1 -
6 files changed, 11 insertions(+), 35 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 85cf30e6e1..087d67e6bf 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -74,7 +74,7 @@ int CommonInit(vout_display_t *vd, vout_display_sys_win32_t *sys, bool b_windowl
sys->hfswnd = NULL;
sys->changes = 0;
sys->b_windowless = b_windowless;
- sys->is_first_display = true;
+ sys->is_first_placement = true;
sys->is_on_top = false;
sys->pf_GetPictureWidth = GetPictureWidth;
@@ -209,9 +209,17 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_forc
EventThreadUpdateSourceAndPlace(sys->event, source, &place);
if (sys->hvideownd)
+ {
+ UINT swpFlags = SWP_NOCOPYBITS | SWP_NOZORDER | SWP_ASYNCWINDOWPOS;
+ if (sys->is_first_placement)
+ {
+ swpFlags |= SWP_SHOWWINDOW;
+ sys->is_first_placement = false;
+ }
SetWindowPos(sys->hvideownd, 0,
place.x, place.y, place.width, place.height,
- SWP_NOCOPYBITS | SWP_NOZORDER | SWP_ASYNCWINDOWPOS);
+ swpFlags);
+ }
}
#endif
@@ -331,28 +339,6 @@ void CommonManage(vout_display_t *vd, vout_display_sys_win32_t *sys)
UpdateRects(vd, sys, false);
}
-/**
- * It ensures that the video window is shown after the first picture
- * is displayed.
- */
-void CommonDisplay(vout_display_sys_win32_t *sys)
-{
- if (!sys->is_first_display)
- return;
-
- /* Video window is initially hidden, show it now since we got a
- * picture to show.
- */
- SetWindowPos(sys->hvideownd, 0, 0, 0, 0, 0,
- SWP_ASYNCWINDOWPOS|
- SWP_FRAMECHANGED|
- SWP_SHOWWINDOW|
- SWP_NOMOVE|
- SWP_NOSIZE|
- SWP_NOZORDER);
- sys->is_first_display = false;
-}
-
/* */
static void CommonChangeThumbnailClip(vout_display_t *vd, vout_display_sys_win32_t *sys, bool show)
{
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index fbd2f95abb..04107f13ab 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -63,7 +63,7 @@ typedef struct vout_display_sys_win32_t
unsigned changes; /* changes made to the video display */
/* Misc */
- bool is_first_display;
+ bool is_first_placement;
bool is_on_top;
/* Coordinates of src and dest images (used when blitting to display) */
@@ -87,7 +87,6 @@ typedef struct vout_display_sys_win32_t
int CommonInit(vout_display_t *, vout_display_sys_win32_t *, bool b_windowless, const vout_display_cfg_t *);
#if !VLC_WINSTORE_APP
void CommonClean(vout_display_t *, vout_display_sys_win32_t *);
-void CommonDisplay(vout_display_sys_win32_t *);
#endif /* !VLC_WINSTORE_APP */
void CommonManage(vout_display_t *, vout_display_sys_win32_t *);
int CommonControl(vout_display_t *, vout_display_sys_win32_t *, int , va_list );
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index e57902bb4e..b5c357a55f 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -965,10 +965,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
d3d11_device_lock( &sys->d3d_dev );
sys->swapCb(sys->outside_opaque);
d3d11_device_unlock( &sys->d3d_dev );
-
-#if !VLC_WINSTORE_APP
- CommonDisplay(&sys->sys);
-#endif
}
static void Direct3D11Destroy(vout_display_t *vd)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 552d9525cd..522619f2d2 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1341,8 +1341,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
return;
sys->swapCb(sys->outside_opaque);
-
- CommonDisplay(&sys->sys);
}
/**
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index dec5dd5cc3..98ea9d3131 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -242,8 +242,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
vout_display_opengl_Display (sys->vgl, &vd->source);
vlc_gl_ReleaseCurrent (sys->gl);
}
-
- CommonDisplay(&sys->sys);
}
static void Manage (vout_display_t *vd)
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index f86507f594..3f4ee0fe41 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -177,7 +177,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
#undef rect_src_clipped
#undef rect_dest
- CommonDisplay(&sys->sys);
CommonManage(vd, &sys->sys);
}
More information about the vlc-commits
mailing list