[vlc-devel] [PATCH 21/41] vout:win32: isolate common code that can't be used on Winstore
Steve Lhomme
robux4 at ycbcr.xyz
Fri Mar 22 16:13:59 CET 2019
This way we can tell which code is not meant to be used for external rendering.
---
modules/video_output/win32/common.c | 17 ++++++++---------
modules/video_output/win32/common.h | 4 +++-
modules/video_output/win32/direct3d11.c | 4 ++++
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index ab2a3b0789..9fd58e7fbd 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -43,8 +43,8 @@
#include "common.h"
#include "../video_chroma/copy.h"
-static void CommonChangeThumbnailClip(vlc_object_t *, vout_display_sys_win32_t *, bool show);
#if !VLC_WINSTORE_APP
+static void CommonChangeThumbnailClip(vlc_object_t *, vout_display_sys_win32_t *, bool show);
static int CommonControlSetFullscreen(vlc_object_t *, vout_display_sys_win32_t *, bool is_fullscreen);
static bool GetRect(const vout_display_sys_win32_t *sys, RECT *out)
@@ -275,7 +275,9 @@ static void UpdateRectsInternal(vout_display_t *vd, vout_display_sys_win32_t *sy
rect_dest.right, rect_dest.bottom);
#endif
+#if !VLC_WINSTORE_APP
CommonChangeThumbnailClip(VLC_OBJECT(vd), sys, true);
+#endif
exit:
/* Signal the change in size/position */
@@ -370,9 +372,7 @@ void CommonDisplay(vout_display_sys_win32_t *sys)
SWP_NOZORDER);
sys->is_first_display = false;
}
-#endif
-#if !VLC_WINSTORE_APP
/* */
static void CommonChangeThumbnailClip(vlc_object_t *obj, vout_display_sys_win32_t *sys, bool show)
{
@@ -507,15 +507,14 @@ static int CommonControlSetFullscreen(vlc_object_t *obj, vout_display_sys_win32_
return VLC_SUCCESS;
}
-#else
+#else /* VLC_WINSTORE_APP */
-void CommonManage(vout_display_t *vd, vout_display_sys_win32_t *sys) {
+void CommonManage(vout_display_t *vd, vout_display_sys_win32_t *sys)
+{
+ /* just check the rendering size didn't change */
UpdateRectsInternal(vd, sys, false);
}
-void CommonClean(vlc_object_t *vd, vout_display_sys_win32_t *) {}
-void CommonDisplay(vout_display_sys_win32_t *) {}
-void CommonChangeThumbnailClip(vlc_object_t *vd, vout_display_sys_win32_t *, bool show) {}
-#endif
+#endif /* VLC_WINSTORE_APP */
int CommonControl(vout_display_t *vd, vout_display_sys_win32_t *sys, int query, va_list args)
{
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 8b93c5ef39..84c0a87ac7 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -91,10 +91,12 @@ typedef struct vout_display_sys_win32_t
* Prototypes from common.c
*****************************************************************************/
int CommonInit(vout_display_t *, vout_display_sys_win32_t *, bool b_windowless, const vout_display_cfg_t *);
+#if !VLC_WINSTORE_APP
void CommonClean(vlc_object_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 );
-void CommonDisplay(vout_display_sys_win32_t *);
void UpdateRects (vout_display_t *, vout_display_sys_win32_t *);
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 090bfdf2af..84d66131ec 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -549,7 +549,9 @@ error:
static void Close(vout_display_t *vd)
{
Direct3D11Close(vd);
+#if !VLC_WINSTORE_APP
CommonClean(VLC_OBJECT(vd), &vd->sys->sys);
+#endif
Direct3D11Destroy(vd);
}
@@ -957,7 +959,9 @@ static void Display(vout_display_t *vd, picture_t *picture)
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)
--
2.17.1
More information about the vlc-devel
mailing list