Improve screencast performance: lower defaults, fps cap, drop mousemove flood
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-3
@@ -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"))))
|
||||
|
||||
Reference in New Issue
Block a user