[vlc-commits] vout: win32: allow using the vout without a window
Steve Lhomme
git at videolan.org
Thu Nov 15 14:20:04 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Nov 15 12:01:04 2018 +0100| [0fb0d953216575d70cbe433b526a601e2c5bd406] | committer: Steve Lhomme
vout: win32: allow using the vout without a window
This is already how the UWP vout works but by not compiling some code.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0fb0d953216575d70cbe433b526a601e2c5bd406
---
modules/video_output/win32/common.c | 14 +++++++-------
modules/video_output/win32/common.h | 4 +++-
modules/video_output/win32/direct3d11.c | 2 +-
modules/video_output/win32/direct3d9.c | 2 +-
modules/video_output/win32/directdraw.c | 2 +-
modules/video_output/win32/glwin32.c | 2 +-
modules/video_output/win32/wingdi.c | 2 +-
7 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index eb2c08a54c..d2ff2150bb 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -67,7 +67,7 @@ static unsigned int GetPictureHeight(const vout_display_t *vd)
}
/* */
-int CommonInit(vout_display_t *vd)
+int CommonInit(vout_display_t *vd, bool b_windowless)
{
vout_display_sys_t *sys = vd->sys;
@@ -76,11 +76,16 @@ int CommonInit(vout_display_t *vd)
sys->hparent = NULL;
sys->hfswnd = NULL;
sys->changes = 0;
+ sys->b_windowless = b_windowless;
sys->is_first_display = true;
sys->is_on_top = false;
sys->pf_GetPictureWidth = GetPictureWidth;
sys->pf_GetPictureHeight = GetPictureHeight;
+
+#if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
+ sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
+#endif
#if !VLC_WINSTORE_APP
sys->pf_GetRect = GetRect;
SetRectEmpty(&sys->rect_display);
@@ -93,9 +98,7 @@ int CommonInit(vout_display_t *vd)
sys->event = EventThreadCreate(vd);
if (!sys->event)
return VLC_EGENERIC;
-#endif
-#if !VLC_WINSTORE_APP
event_cfg_t cfg;
memset(&cfg, 0, sizeof(cfg));
#ifdef MODULE_NAME_IS_direct3d9
@@ -124,10 +127,7 @@ int CommonInit(vout_display_t *vd)
vout_display_SendEventFullscreen(vd, false);
}
-#endif
-#if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
- sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
-#endif
+#endif /* !VLC_WINSTORE_APP */
return VLC_SUCCESS;
}
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 17d7275c2a..90168a992b 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -36,6 +36,8 @@
*****************************************************************************/
typedef struct vout_display_sys_win32_t
{
+ bool b_windowless; /* the rendering is done offscreen */
+
/* */
event_thread_t *event;
@@ -88,7 +90,7 @@ typedef struct vout_display_sys_win32_t
/*****************************************************************************
* Prototypes from common.c
*****************************************************************************/
-int CommonInit(vout_display_t *);
+int CommonInit(vout_display_t *, bool b_windowless);
void CommonClean(vout_display_t *);
void CommonManage(vout_display_t *);
int CommonControl(vout_display_t *, int , va_list );
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 1a708e613e..311b921e19 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -276,7 +276,7 @@ static int Open(vlc_object_t *object)
if (ret != VLC_SUCCESS)
return ret;
- if (CommonInit(vd))
+ if (CommonInit(vd, false))
goto error;
#if VLC_WINSTORE_APP
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 7fd40e63c8..eb3b6120b4 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -293,7 +293,7 @@ static int Open(vlc_object_t *object)
sys->desktop_save.win.top = var_InheritInteger(vd, "video-y");
sys->desktop_save.win.bottom = vd->cfg->display.height;
- if (CommonInit(vd))
+ if (CommonInit(vd, false))
goto error;
/* */
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index b74e17d125..d28f1c275c 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -210,7 +210,7 @@ static int Open(vlc_object_t *object)
var_Create(vd, "directx-device", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
/* Initialisation */
- if (CommonInit(vd))
+ if (CommonInit(vd, false))
goto error;
/* */
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index ecc8dee939..a22afec660 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -124,7 +124,7 @@ static int Open(vlc_object_t *object)
return VLC_ENOMEM;
/* */
- if (CommonInit(vd))
+ if (CommonInit(vd, false))
goto error;
EventThreadUpdateTitle(sys->sys.event, VOUT_TITLE " (OpenGL output)");
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index 9521febc24..6014a9ff0d 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -97,7 +97,7 @@ static int Open(vlc_object_t *object)
if (!sys)
return VLC_ENOMEM;
- if (CommonInit(vd))
+ if (CommonInit(vd, false))
goto error;
/* */
More information about the vlc-commits
mailing list