Improve screencast performance: lower defaults, fps cap, drop mousemove flood

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-27 11:09:16 +08:00
parent b9ee546bc1
commit a409f35e6c
7 changed files with 116 additions and 41 deletions
+11 -3
View File
@@ -83,11 +83,19 @@ def get_idle_timeout() -> int:
def get_viewport_size() -> tuple[int, int]:
width = max(800, int(os.getenv("VIEWPORT_WIDTH", "1280")))
height = max(600, int(os.getenv("VIEWPORT_HEIGHT", "720")))
width = max(800, int(os.getenv("VIEWPORT_WIDTH", "1024")))
height = max(600, int(os.getenv("VIEWPORT_HEIGHT", "576")))
return width, height
def get_screencast_quality() -> int:
quality = int(os.getenv("SCREENCAST_QUALITY", "80"))
quality = int(os.getenv("SCREENCAST_QUALITY", "55"))
return min(100, max(10, quality))
def get_screencast_nth_frame() -> int:
return max(1, int(os.getenv("SCREENCAST_EVERY_NTH_FRAME", "2")))
def get_screencast_max_fps() -> int:
return min(30, max(5, int(os.getenv("SCREENCAST_MAX_FPS", "15"))))