Skip to content

Commit

Permalink
ci2-remote-control: implement Default for RecordingConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Jan 5, 2025
1 parent 3d7250b commit 5ce10ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion camera/ci2-remote-control/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub struct Mp4RecordingConfig {
}

/// Configuration for an ffmpeg-based recording
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Default)]
pub struct FfmpegRecordingConfig {
pub codec_args: FfmpegCodecArgs,
/// Limits the recording to a maximum frame rate.
Expand All @@ -207,6 +207,12 @@ pub enum RecordingConfig {
Ffmpeg(FfmpegRecordingConfig),
}

impl Default for RecordingConfig {
fn default() -> Self {
Self::Ffmpeg(Default::default())
}
}

impl RecordingConfig {
pub fn max_framerate(&self) -> &RecordingFrameRate {
use RecordingConfig::*;
Expand Down

0 comments on commit 5ce10ce

Please sign in to comment.