From 5851b6258037d2b2c7d763fac17d33d131eb8922 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 12 Oct 2024 09:23:31 +0200 Subject: [PATCH] Simplify virtual display video size Do not use an unnecessary intermediate Rect object. PR #5370 --- .../main/java/com/genymobile/scrcpy/video/ScreenCapture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java b/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java index e279f569..05d349da 100644 --- a/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java +++ b/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java @@ -126,9 +126,9 @@ public class ScreenCapture extends SurfaceCapture { } try { - Rect videoRect = screenInfo.getVideoSize().toRect(); + Size videoSize = screenInfo.getVideoSize(); virtualDisplay = ServiceManager.getDisplayManager() - .createVirtualDisplay("scrcpy", videoRect.width(), videoRect.height(), displayId, surface); + .createVirtualDisplay("scrcpy", videoSize.getWidth(), videoSize.getHeight(), displayId, surface); Ln.d("Display: using DisplayManager API"); } catch (Exception displayManagerException) { try {