[vlc-devel] [PATCH] video_output:win32: remove the video_format_t parameter

Steve Lhomme robux4 at videolabs.io
Mon Aug 7 09:02:38 CEST 2017


It's always vd->source.

--
replaces https://patches.videolan.org/patch/17711/
- rebased
---
 modules/video_output/win32/common.c     | 16 +++++++---------
 modules/video_output/win32/common.h     |  1 -
 modules/video_output/win32/direct3d11.c |  4 ++--
 modules/video_output/win32/direct3d9.c  |  4 ++--
 modules/video_output/win32/directdraw.c |  2 +-
 modules/video_output/win32/wingdi.c     |  2 +-
 6 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index e734316431..3617f7a9dc 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -145,10 +145,10 @@ picture_pool_t *CommonPool(vout_display_t *vd, unsigned count)
 *****************************************************************************/
 void UpdateRects(vout_display_t *vd,
     const vout_display_cfg_t *cfg,
-    const video_format_t *source,
     bool is_forced)
 {
     vout_display_sys_t *sys = vd->sys;
+    const video_format_t *source = &vd->source;
 #define rect_src sys->rect_src
 #define rect_src_clipped sys->rect_src_clipped
 #define rect_dest sys->rect_dest
@@ -160,8 +160,6 @@ void UpdateRects(vout_display_t *vd,
     /* */
     if (!cfg)
         cfg = vd->cfg;
-    if (!source)
-        source = &vd->source;
 
     /* Retrieve the window size */
     if (!sys->pf_GetRect(sys, &rect))
@@ -406,13 +404,13 @@ void CommonManage(vout_display_t *vd)
                          rect_parent.bottom - rect_parent.top,
                          SWP_NOZORDER);
 
-            UpdateRects(vd, NULL, NULL, true);
+            UpdateRects(vd, NULL, true);
         }
     }
 
     /* HasMoved means here resize or move */
     if (EventThreadGetAndResetHasMoved(sys->event))
-        UpdateRects(vd, NULL, NULL, false);
+        UpdateRects(vd, NULL, false);
 }
 
 /**
@@ -638,7 +636,7 @@ static void RestoreScreensaver(vout_display_t *vd)
 #else
 
 void CommonManage(vout_display_t *vd) {
-    UpdateRects(vd, NULL, NULL, false);
+    UpdateRects(vd, NULL, false);
 }
 void CommonClean(vout_display_t *vd) {}
 void CommonDisplay(vout_display_t *vd) {}
@@ -662,7 +660,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
         } else {
             cfg    = va_arg(args, const vout_display_cfg_t *);
         }
-        UpdateRects(vd, cfg, NULL, true);
+        UpdateRects(vd, cfg, true);
         return VLC_SUCCESS;
     }
 #if !VLC_WINSTORE_APP
@@ -682,7 +680,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
                          rect_window.right - rect_window.left,
                          rect_window.bottom - rect_window.top, SWP_NOMOVE);
         }
-        UpdateRects(vd, cfg, NULL, false);
+        UpdateRects(vd, cfg, false);
         return VLC_SUCCESS;
     }
     case VOUT_DISPLAY_CHANGE_WINDOW_STATE: {       /* unsigned state */
@@ -708,7 +706,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
         bool fs = va_arg(args, int);
         if (CommonControlSetFullscreen(vd, fs))
             return VLC_EGENERIC;
-        UpdateRects(vd, NULL, NULL, false);
+        UpdateRects(vd, NULL, false);
         return VLC_SUCCESS;
     }
 
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index a957048541..c1c6e6f368 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -98,7 +98,6 @@ int  CommonUpdatePicture(picture_t *, picture_t **fallback, uint8_t *plane, unsi
 
 void UpdateRects (vout_display_t *,
                   const vout_display_cfg_t *,
-                  const video_format_t *,
                   bool is_forced);
 void AlignRect(RECT *, int align_boundary, int align_size);
 
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 4fbeeb8d26..1ac66d6d63 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1168,7 +1168,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
             sys->picQuad.i_width = texDesc.Width;
 
             BEFORE_UPDATE_RECTS;
-            UpdateRects(vd, NULL, NULL, true);
+            UpdateRects(vd, NULL, true);
             AFTER_UPDATE_RECTS;
             UpdateSize(vd);
         }
@@ -1652,7 +1652,7 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
     }
 
     BEFORE_UPDATE_RECTS;
-    UpdateRects(vd, NULL, NULL, true);
+    UpdateRects(vd, NULL, true);
     AFTER_UPDATE_RECTS;
 
 #if defined(HAVE_ID3D11VIDEODECODER)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index b6e9c1f79e..9da418a542 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -937,7 +937,7 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt)
        return VLC_EGENERIC;
     }
 
-    UpdateRects(vd, NULL, NULL, true);
+    UpdateRects(vd, NULL, true);
 
     if (Direct3D9CreateResources(vd, fmt)) {
         msg_Err(vd, "Failed to allocate resources");
@@ -993,7 +993,7 @@ static int Direct3D9Reset(vout_display_t *vd)
         return VLC_EGENERIC;
     }
 
-    UpdateRects(vd, NULL, NULL, true);
+    UpdateRects(vd, NULL, true);
 
     /* re-create them */
     if (Direct3D9CreateResources(vd, &vd->fmt)) {
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index 67ac86495e..0e6f568f64 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -441,7 +441,7 @@ static int DirectXOpen(vout_display_t *vd, video_format_t *fmt)
         msg_Err(vd, "cannot initialize DirectX DirectDraw");
         return VLC_EGENERIC;
     }
-    UpdateRects(vd, NULL, NULL, true);
+    UpdateRects(vd, NULL, true);
 
     /* Create the picture pool */
     if (DirectXCreatePool(vd, &sys->sys.use_overlay, fmt)) {
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index 77ca3aa1f7..04cfb5855c 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -314,7 +314,7 @@ static int Init(vout_display_t *vd,
     else
         sys->sys.pool = NULL;
 
-    UpdateRects(vd, NULL, NULL, true);
+    UpdateRects(vd, NULL, true);
 
     return VLC_SUCCESS;
 }
-- 
2.12.1



More information about the vlc-devel mailing list