[vlc-devel] [PATCH 20/41] vout:win32: rely less on the vout_display_t structure

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 22 16:13:58 CET 2019


Sometimes we just need it for logging or not at all.
---
 modules/video_output/win32/common.c     | 30 ++++++++++++-------------
 modules/video_output/win32/common.h     |  4 ++--
 modules/video_output/win32/direct3d11.c |  4 ++--
 modules/video_output/win32/direct3d9.c  |  6 ++---
 modules/video_output/win32/glwin32.c    |  4 ++--
 modules/video_output/win32/wingdi.c     |  4 ++--
 6 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index c95b21def4..ab2a3b0789 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -43,9 +43,9 @@
 #include "common.h"
 #include "../video_chroma/copy.h"
 
-static void CommonChangeThumbnailClip(vout_display_t *, vout_display_sys_win32_t *, bool show);
+static void CommonChangeThumbnailClip(vlc_object_t *, vout_display_sys_win32_t *, bool show);
 #if !VLC_WINSTORE_APP
-static int  CommonControlSetFullscreen(vout_display_t *, vout_display_sys_win32_t *, bool is_fullscreen);
+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,7 @@ static void UpdateRectsInternal(vout_display_t *vd, vout_display_sys_win32_t *sy
         rect_dest.right, rect_dest.bottom);
 #endif
 
-    CommonChangeThumbnailClip(vd, sys, true);
+    CommonChangeThumbnailClip(VLC_OBJECT(vd), sys, true);
 
 exit:
     /* Signal the change in size/position */
@@ -293,10 +293,10 @@ void UpdateRects(vout_display_t *vd, vout_display_sys_win32_t *sys)
 
 #if !VLC_WINSTORE_APP
 /* */
-void CommonClean(vout_display_t *vd, vout_display_sys_win32_t *sys)
+void CommonClean(vlc_object_t *obj, vout_display_sys_win32_t *sys)
 {
     if (sys->event) {
-        CommonChangeThumbnailClip(vd, sys, false);
+        CommonChangeThumbnailClip(obj, sys, false);
         EventThreadStop(sys->event);
         EventThreadDestroy(sys->event);
     }
@@ -353,7 +353,7 @@ void CommonManage(vout_display_t *vd, vout_display_sys_win32_t *sys)
  * It ensures that the video window is shown after the first picture
  * is displayed.
  */
-void CommonDisplay(vout_display_t *vd, vout_display_sys_win32_t *sys)
+void CommonDisplay(vout_display_sys_win32_t *sys)
 {
     if (!sys->is_first_display)
         return;
@@ -374,7 +374,7 @@ void CommonDisplay(vout_display_t *vd, vout_display_sys_win32_t *sys)
 
 #if !VLC_WINSTORE_APP
 /* */
-static void CommonChangeThumbnailClip(vout_display_t *vd, vout_display_sys_win32_t *sys, bool show)
+static void CommonChangeThumbnailClip(vlc_object_t *obj, vout_display_sys_win32_t *sys, bool show)
 {
     /* Windows 7 taskbar thumbnail code */
     OSVERSIONINFO winVer;
@@ -412,14 +412,14 @@ static void CommonChangeThumbnailClip(vout_display_t *vd, vout_display_sys_win32
         hr = taskbl->lpVtbl->SetThumbnailClip(taskbl, hroot,
                                                  show ? &video : NULL);
         if ( hr != S_OK )
-            msg_Err(vd, "SetThumbNailClip failed: 0x%0lx", hr);
+            msg_Err(obj, "SetThumbNailClip failed: 0x%0lx", hr);
 
         taskbl->lpVtbl->Release(taskbl);
     }
     CoUninitialize();
 }
 
-static int CommonControlSetFullscreen(vout_display_t *vd, vout_display_sys_win32_t *sys, bool is_fullscreen)
+static int CommonControlSetFullscreen(vlc_object_t *obj, vout_display_sys_win32_t *sys, bool is_fullscreen)
 {
 #ifdef MODULE_NAME_IS_direct3d9
     if (sys->use_desktop && is_fullscreen)
@@ -443,7 +443,7 @@ static int CommonControlSetFullscreen(vout_display_t *vd, vout_display_sys_win32
     GetWindowPlacement(hwnd, &window_placement);
 
     if (is_fullscreen) {
-        msg_Dbg(vd, "entering fullscreen mode");
+        msg_Dbg(obj, "entering fullscreen mode");
 
         /* Change window style, no borders and no title bar */
         SetWindowLong(hwnd, GWL_STYLE, WS_CLIPCHILDREN | WS_VISIBLE);
@@ -481,7 +481,7 @@ static int CommonControlSetFullscreen(vout_display_t *vd, vout_display_sys_win32
         }
         SetForegroundWindow(hwnd);
     } else {
-        msg_Dbg(vd, "leaving fullscreen mode");
+        msg_Dbg(obj, "leaving fullscreen mode");
 
         /* Change window style, no borders and no title bar */
         SetWindowLong(hwnd, GWL_STYLE, EventThreadGetWindowStyle(sys->event));
@@ -512,9 +512,9 @@ static int CommonControlSetFullscreen(vout_display_t *vd, vout_display_sys_win32
 void CommonManage(vout_display_t *vd, vout_display_sys_win32_t *sys) {
     UpdateRectsInternal(vd, sys, false);
 }
-void CommonClean(vout_display_t *vd, vout_display_sys_win32_t *) {}
-void CommonDisplay(vout_display_t *vd, vout_display_sys_win32_t *) {}
-void CommonChangeThumbnailClip(vout_display_t *vd, vout_display_sys_win32_t *, bool show) {}
+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
 
 int CommonControl(vout_display_t *vd, vout_display_sys_win32_t *sys, int query, va_list args)
@@ -571,7 +571,7 @@ int CommonControl(vout_display_t *vd, vout_display_sys_win32_t *sys, int query,
     }
     case VOUT_DISPLAY_CHANGE_FULLSCREEN: {
         bool fs = va_arg(args, int);
-        if (CommonControlSetFullscreen(vd, sys, fs))
+        if (CommonControlSetFullscreen(VLC_OBJECT(vd), sys, fs))
             return VLC_EGENERIC;
         UpdateRectsInternal(vd, sys, false);
         return VLC_SUCCESS;
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index 3bd022ca80..8b93c5ef39 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -91,10 +91,10 @@ 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 *);
-void CommonClean(vout_display_t *, vout_display_sys_win32_t *);
+void CommonClean(vlc_object_t *, vout_display_sys_win32_t *);
 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_t *, vout_display_sys_win32_t *);
+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 6522e5145f..090bfdf2af 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -549,7 +549,7 @@ error:
 static void Close(vout_display_t *vd)
 {
     Direct3D11Close(vd);
-    CommonClean(vd, &vd->sys->sys);
+    CommonClean(VLC_OBJECT(vd), &vd->sys->sys);
     Direct3D11Destroy(vd);
 }
 
@@ -957,7 +957,7 @@ static void Display(vout_display_t *vd, picture_t *picture)
     sys->swapCb(sys->outside_opaque);
     d3d11_device_unlock( &sys->d3d_dev );
 
-    CommonDisplay(vd, &sys->sys);
+    CommonDisplay(&sys->sys);
 }
 
 static void Direct3D11Destroy(vout_display_t *vd)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 1d72f4cd43..7056de25e7 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1337,7 +1337,7 @@ static void Display(vout_display_t *vd, picture_t *picture)
 
     sys->swapCb(sys->outside_opaque);
 
-    CommonDisplay(vd, &sys->sys);
+    CommonDisplay(&sys->sys);
 }
 
 /**
@@ -1714,7 +1714,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     return VLC_SUCCESS;
 error:
     Direct3D9Close(vd);
-    CommonClean(vd, &sys->sys);
+    CommonClean(VLC_OBJECT(vd), &sys->sys);
     Direct3D9Destroy(sys);
     free(vd->sys);
     return VLC_EGENERIC;
@@ -1729,7 +1729,7 @@ static void Close(vout_display_t *vd)
 
     Direct3D9Close(vd);
 
-    CommonClean(vd, &vd->sys->sys);
+    CommonClean(VLC_OBJECT(vd), &vd->sys->sys);
 
     Direct3D9Destroy(vd->sys);
 
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index fb778810c5..6d65084bd1 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -193,7 +193,7 @@ static void Close(vout_display_t *vd)
         vlc_object_delete(surface);
     }
 
-    CommonClean(vd, &sys->sys);
+    CommonClean(VLC_OBJECT(vd), &sys->sys);
 
     free(sys);
 }
@@ -236,7 +236,7 @@ static void Display(vout_display_t *vd, picture_t *picture)
         vlc_gl_ReleaseCurrent (sys->gl);
     }
 
-    CommonDisplay(vd, &sys->sys);
+    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 9aa41b99d2..523ddc0c88 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -141,7 +141,7 @@ static void Close(vout_display_t *vd)
 {
     Clean(vd);
 
-    CommonClean(vd, &vd->sys->sys);
+    CommonClean(VLC_OBJECT(vd), &vd->sys->sys);
 
     free(vd->sys);
 }
@@ -177,7 +177,7 @@ static void Display(vout_display_t *vd, picture_t *picture)
 #undef rect_src_clipped
 #undef rect_dest
 
-    CommonDisplay(vd, &sys->sys);
+    CommonDisplay(&sys->sys);
     CommonManage(vd, &sys->sys);
 }
 
-- 
2.17.1



More information about the vlc-devel mailing list