Skip to content

Commit

Permalink
add --no-damage option
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Jul 23, 2023
1 parent 57c44a9 commit cc318d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ pub struct Args {

#[clap(long, default_value_t = DEFAULT_AUDIO_BACKEND.to_string(), help = "which ffmpeg audio capture backend (see https://ffmpeg.org/ffmpeg-devices.html`) to use. you almost certainally want to specify --audio-device if you use this, as the values depend on the backend used")]
audio_backend: String,

#[clap(long="no-damage", default_value = "true", action=ArgAction::SetFalse, help="copy every frame, not just unique frames. This can be helpful to get a non-variable framerate video, but is generally discouraged as it uses much more resources. Useful for testing")]
damage: bool,
}

#[derive(clap::ValueEnum, Debug, Clone, Default)]
Expand Down Expand Up @@ -533,7 +536,11 @@ impl Dispatch<ZwlrScreencopyFrameV1, ()> for State {
(),
);

capture.copy_with_damage(&buf);
if state.args.damage {
capture.copy_with_damage(&buf);
} else {
capture.copy(&buf);
}

state.surfaces_owned_by_compositor.push_back((
surf,
Expand Down

0 comments on commit cc318d1

Please sign in to comment.