[vlc-devel] [PATCH v2 18/19] vout: win32: simplify setting the placement as changed

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 25 16:20:31 CEST 2020


---
 modules/video_output/win32/common.c     | 6 +++---
 modules/video_output/win32/common.h     | 5 ++++-
 modules/video_output/win32/direct3d11.c | 4 ++--
 modules/video_output/win32/direct3d9.c  | 2 +-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index b76a2f44e1b..43d870e10fc 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -80,7 +80,7 @@ int CommonWindowInit(vout_display_t *vd, display_win32_area_t *area,
     sys->hparent       = hwnd.hparent;
     sys->hvideownd     = hwnd.hvideownd;
 
-    CommonPlacePicture(vd, area);
+    SetPlacementChanged(area);
 
     return VLC_SUCCESS;
 }
@@ -119,7 +119,7 @@ int CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_s
     case VOUT_DISPLAY_CHANGE_ZOOM:
     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP: {
-        CommonPlacePicture(vd, area);
+        SetPlacementChanged(area);
         return VLC_SUCCESS;
     }
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
@@ -135,7 +135,7 @@ int CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_s
                          RECTHeight(clientRect), SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE);
         }
 #endif /* !VLC_WINSTORE_APP */
-        CommonPlacePicture(vd, area);
+        SetPlacementChanged(area);
         return VLC_SUCCESS;
     }
 
diff --git a/modules/video_output/win32/common.h b/modules/video_output/win32/common.h
index c741bdecf83..f86e189d004 100644
--- a/modules/video_output/win32/common.h
+++ b/modules/video_output/win32/common.h
@@ -69,7 +69,10 @@ void CommonWindowClean(vout_display_sys_win32_t *);
 #endif /* !VLC_WINSTORE_APP */
 int  CommonControl(vout_display_t *, display_win32_area_t *, vout_display_sys_win32_t *, int );
 
-void CommonPlacePicture (vout_display_t *, display_win32_area_t *);
+static inline void SetPlacementChanged(display_win32_area_t *area)
+{
+    area->place_changed = true;
+}
 
 void CommonInit(display_win32_area_t *);
 
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 3eae603ded8..c44d9607120 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -615,8 +615,8 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
                 sys->picQuad.i_height = texDesc.Height;
                 sys->picQuad.i_width = texDesc.Width;
 
-                CommonPlacePicture(vd, &sys->area);
                 UpdateSize(vd);
+                sys->area.place_changed = false;
             }
         }
     }
@@ -812,7 +812,7 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmtp, vlc_video_co
         sys->picQuad.i_height = (sys->picQuad.i_height + 0x01) & ~0x01;
     }
 
-    CommonPlacePicture(vd, &sys->area);
+    SetPlacementChanged(&sys->area);
 
     err = QueryDisplayFormat(vd, &fmt);
     if (err != VLC_SUCCESS) {
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 7ee3c24fe04..81b68ef4ab1 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1850,7 +1850,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     }
 
     if (sys->swapCb == LocalSwapchainSwap)
-        CommonPlacePicture(vd, &sys->area);
+        SetPlacementChanged(&sys->area);
 
     sys->hxdll = Direct3D9LoadShaderLibrary();
     if (!sys->hxdll)
-- 
2.26.2



More information about the vlc-devel mailing list