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

Steve Lhomme robux4 at videolabs.io
Wed Aug 2 09:33:38 CEST 2017


It's always vd->source.
---
 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 5bb7f8f551..57c74700ea 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1180,7 +1180,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
              * adjust the vertex */
             vd->fmt.i_height = texDesc.Height;
             vd->fmt.i_width = texDesc.Width;
-            UpdateRects(vd, NULL, NULL, true);
+            UpdateRects(vd, NULL, true);
             UpdateSize(vd);
         }
     }
@@ -1647,7 +1647,7 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
     if (!sys->d3dregion_format)
         sys->d3dregion_format = GetBlendableFormat(vd, VLC_CODEC_BGRA);
 
-    UpdateRects(vd, NULL, NULL, true);
+    UpdateRects(vd, NULL, true);
 
 #if defined(HAVE_ID3D11VIDEODECODER)
     if( sys->context_lock != INVALID_HANDLE_VALUE )
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 407c5e81f0..394645fb58 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 d3c59310e3..2282080918 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 4dc43a7ee2..ad34d649d7 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