[vlc-commits] vout:win32: enable projection gestures per module

Steve Lhomme git at videolan.org
Tue Apr 2 16:33:02 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 26 12:03:24 2019 +0100| [0198a1470903d42c45f9386bc8b786ab07d76d8c] | committer: Steve Lhomme

vout:win32: enable projection gestures per module

Only the ones that can handle 360 projection should enable it.

We don't need to pass the vout_display_t anymore.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0198a1470903d42c45f9386bc8b786ab07d76d8c
---

 modules/video_output/win32/common.c     | 15 +++++++--------
 modules/video_output/win32/common.h     |  2 +-
 modules/video_output/win32/direct3d11.c |  8 ++++++--
 modules/video_output/win32/direct3d9.c  |  7 +++++--
 modules/video_output/win32/glwin32.c    |  3 ++-
 modules/video_output/win32/wingdi.c     |  2 +-
 6 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 5025d892b3..b436f20def 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -77,11 +77,16 @@ static bool GetWindowDimensions(void *opaque, UINT *width, UINT *height)
 }
 
 /* */
-int CommonInit(vlc_object_t *obj, vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys)
+int CommonInit(vlc_object_t *obj, display_win32_area_t *area,
+               vout_display_sys_win32_t *sys, bool projection_gestures)
 {
     if (unlikely(area->vdcfg.window == NULL))
         return VLC_EGENERIC;
 
+    area->pf_GetDisplayDimensions = GetWindowDimensions;
+    area->opaque_dimensions = sys;
+
+    /* */
 #if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
     sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
 #endif
@@ -92,12 +97,6 @@ int CommonInit(vlc_object_t *obj, vout_display_t *vd, display_win32_area_t *area
     sys->is_first_placement = true;
     sys->is_on_top        = false;
 
-#if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
-    sys->dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
-#endif
-    area->pf_GetDisplayDimensions = GetWindowDimensions;
-    area->opaque_dimensions = sys;
-
     var_Create(obj, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
 
     /* */
@@ -115,7 +114,7 @@ int CommonInit(vlc_object_t *obj, vout_display_t *vd, display_win32_area_t *area
     cfg.y      = var_InheritInteger(obj, "video-y");
     cfg.width  = area->vdcfg.display.width;
     cfg.height = area->vdcfg.display.height;
-    cfg.is_projected = vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR;
+    cfg.is_projected = projection_gestures;
 
     event_hwnd_t hwnd;
     if (EventThreadStart(sys->event, &hwnd, &cfg))
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 88745755b7..552d7a34b1 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -75,7 +75,7 @@ typedef struct vout_display_sys_win32_t
  * Prototypes from common.c
  *****************************************************************************/
 #if !VLC_WINSTORE_APP
-int  CommonInit(vlc_object_t *, vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *);
+int  CommonInit(vlc_object_t *, display_win32_area_t *, vout_display_sys_win32_t *, bool projection_gestures);
 void CommonClean(vlc_object_t *, vout_display_sys_win32_t *);
 #endif /* !VLC_WINSTORE_APP */
 void CommonManage(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *);
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index fe8456b43d..4b7decafb2 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -481,8 +481,12 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 #endif
     InitArea(vd, &sys->area, cfg);
 #if !VLC_WINSTORE_APP
-    if (d3d11_ctx == NULL && CommonInit(VLC_OBJECT(vd), vd, &sys->area, &sys->sys))
-        goto error;
+    if (d3d11_ctx == NULL)
+    {
+        if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys,
+                       vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR))
+            goto error;
+    }
 #else /* !VLC_WINSTORE_APP */
     sys->area.pf_GetDisplayDimensions = GetExtenalSwapchainDimensions;
     sys->area.opaque_dimensions = sys;
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index d5e0a4369e..77590d8476 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1681,8 +1681,11 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     sys->desktop_save.is_on_top     = false;
 
     InitArea(vd, &sys->area, cfg);
-    if (d3d9_device == NULL && CommonInit(VLC_OBJECT(vd), vd, &sys->area, &sys->sys))
-        goto error;
+    if (d3d9_device == NULL)
+    {
+        if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false))
+            goto error;
+    }
 
     /* */
     video_format_t fmt;
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 2a3252134e..053cc36569 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -123,7 +123,8 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     /* */
     InitArea(vd, &sys->area, cfg);
-    if (CommonInit(VLC_OBJECT(vd), vd, &sys->area, &sys->sys))
+    if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys,
+                   vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR))
         goto error;
 
     if (vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR)
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index e7da115fe4..46a7885176 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -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), vd, &sys->area, &sys->sys))
+    if (CommonInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false))
         goto error;
 
     /* */



More information about the vlc-commits mailing list