let the capture rate be capped on purpose, off by default

This commit is contained in:
2026-09-21 06:59:30 +03:00
parent a953875405
commit 0da3691a1b
5 changed files with 87 additions and 12 deletions
+8
View File
@@ -61,6 +61,11 @@ pub struct CaptureConfig {
pub capture_cursor: bool,
pub capture_audio: bool,
pub capture_quality: CaptureQuality,
/// Opt in to recording at `default_fps` instead of the panel's refresh rate.
/// Off by default, and a config written before this field existed gets false
/// through the container `serde(default)` - so nobody's capture changes until
/// they turn it on.
pub limit_capture_fps: bool,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
@@ -151,6 +156,7 @@ impl Default for CaptureConfig {
capture_cursor: true,
capture_audio: false,
capture_quality: CaptureQuality::Auto,
limit_capture_fps: false,
}
}
}
@@ -278,6 +284,7 @@ mod tests {
capture_cursor: false,
capture_audio: true,
capture_quality: CaptureQuality::Full,
limit_capture_fps: true,
},
hotkeys: HotkeyConfig {
start: Some("F9".to_string()),
@@ -299,6 +306,7 @@ mod tests {
let loaded = Config::load_or_create(&path).unwrap();
assert_eq!(loaded.export.default_format, Format::Webm);
assert_eq!(loaded.capture.default_fps, 60);
assert!(loaded.capture.limit_capture_fps);
assert_eq!(loaded.hotkeys.start, Some("F9".to_string()));
assert_eq!(loaded.output_dir, Some(PathBuf::from("./custom")));
assert_eq!(loaded.theme, Theme::Light);