Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
clippy
Richie McIlroy7aa618fe099b
diff --git a/crates/recording/src/output_pipeline/oop_fragmented_m4s_win.rs b/crates/recording/src/output_pipeline/oop_fragmented_m4s_win.rsindex 01507b636..67990eb16 100644--- a/crates/recording/src/output_pipeline/oop_fragmented_m4s_win.rs+++ b/crates/recording/src/output_pipeline/oop_fragmented_m4s_win.rs@@ -385,7 +385,7 @@ impl WindowsOOPFragmentedM4SMuxer {}};- let mut encode_one =+ let encode_one =|encoder: &mut cap_enc_ffmpeg::h264_packet::H264PacketEncoder,subprocess: &mut RespawningMuxerSubprocess,tracker: &mut FragmentManifestTracker,diff --git a/crates/recording/src/sources/screen_capture/windows.rs b/crates/recording/src/sources/screen_capture/windows.rsindex e89496620..0d8e9daef 100644--- a/crates/recording/src/sources/screen_capture/windows.rs+++ b/crates/recording/src/sources/screen_capture/windows.rs@@ -643,24 +643,26 @@ impl output_pipeline::VideoSource for VideoSource {let mut error_tx = error_tx;let mut d3d_device = d3d_device;- let build_params = |device: &ID3D11Device| -> CreateCapturerParams<'_> {- CreateCapturerParams {- display_id: &display_id,- settings: &settings,- d3d_device: device,- video_tx: &video_tx,- video_frame_counter: &video_frame_counter,- video_drop_counter: &video_drop_counter,- expected_width,- expected_height,- frame_scaler: frame_scaler.clone(),- scaling_logged: scaling_logged.clone(),- scaled_frame_count: scaled_frame_count.clone(),- stall_health_tx: stats_health_tx.clone(),- }- };+ macro_rules! build_params {+ ($device:expr) => {+ CreateCapturerParams {+ display_id: &display_id,+ settings: &settings,+ d3d_device: $device,+ video_tx: &video_tx,+ video_frame_counter: &video_frame_counter,+ video_drop_counter: &video_drop_counter,+ expected_width,+ expected_height,+ frame_scaler: frame_scaler.clone(),+ scaling_logged: scaling_logged.clone(),+ scaled_frame_count: scaled_frame_count.clone(),+ stall_health_tx: stats_health_tx.clone(),+ }+ };+ }- let mut capturer = match create_d3d_capturer(&build_params(&d3d_device), &error_tx) {+ let mut capturer = match create_d3d_capturer(&build_params!(&d3d_device), &error_tx) {Ok(c) => {trace!("D3D capturer created successfully");Some(c)@@ -768,7 +770,7 @@ impl output_pipeline::VideoSource for VideoSource {continue;}}- match create_d3d_capturer(&build_params(&d3d_device), &error_tx) {+ match create_d3d_capturer(&build_params!(&d3d_device), &error_tx) {Ok(mut new_cap) => match new_cap.start() {Ok(()) => {info!(@@ -808,7 +810,7 @@ impl output_pipeline::VideoSource for VideoSource {drop(old);}- match create_d3d_capturer(&build_params(&d3d_device), &error_tx) {+ match create_d3d_capturer(&build_params!(&d3d_device), &error_tx) {Ok(mut new_cap) => match new_cap.start() {Ok(()) => {let count = restart_counterdiff --git a/crates/rendering-skia/src/layers/background.rs b/crates/rendering-skia/src/layers/background.rsindex 90fd81b09..0db3e137e 100644--- a/crates/rendering-skia/src/layers/background.rs+++ b/crates/rendering-skia/src/layers/background.rs@@ -275,33 +275,30 @@ impl RecordableLayer for BackgroundLayer {fn prepare(&mut self, frame_data: &FrameData) -> Result<(), SkiaRenderingError> {let new_background = Background::from(frame_data.uniforms.background.clone());- // Handle image loading if neededmatch &new_background {- Background::Image { path } | Background::Wallpaper { path } => {- if self.image_path.as_ref() != Some(path) || self.loaded_image.is_none() {- // For now, we'll do synchronous loading. In a real implementation,- // this should be async or cached at a higher level- match std::fs::read(path) {- Ok(image_data) => {- let data = skia_safe::Data::new_copy(&image_data);- if let Some(image) = Image::from_encoded(&data) {- self.loaded_image = Some(image);- self.image_path = Some(path.clone());- } else {- tracing::error!("Failed to decode image: {:?}", path);- return Err(SkiaRenderingError::Other(anyhow::anyhow!(- "Failed to decode image"- )));- }- }- Err(e) => {- tracing::error!("Failed to load image: {:?}, error: {}", path, e);+ Background::Image { path } | Background::Wallpaper { path }+ if self.image_path.as_ref() != Some(path) || self.loaded_image.is_none() =>+ {+ match std::fs::read(path) {+ Ok(image_data) => {+ let data = skia_safe::Data::new_copy(&image_data);+ if let Some(image) = Image::from_encoded(&data) {+ self.loaded_image = Some(image);+ self.image_path = Some(path.clone());+ } else {+ tracing::error!("Failed to decode image: {:?}", path);return Err(SkiaRenderingError::Other(anyhow::anyhow!(- "Failed to load image: {}",- e+ "Failed to decode image")));}}+ Err(e) => {+ tracing::error!("Failed to load image: {:?}, error: {}", path, e);+ return Err(SkiaRenderingError::Other(anyhow::anyhow!(+ "Failed to load image: {}",+ e+ )));+ }}}_ => {}diff --git a/crates/scap-targets/src/main.rs b/crates/scap-targets/src/main.rsindex 8a836ddb5..d24f8f022 100644--- a/crates/scap-targets/src/main.rs+++ b/crates/scap-targets/src/main.rs@@ -128,7 +128,7 @@ fn main() {}).collect::<Vec<_>>();- relevant_windows.sort_by(|a, b| b.1.cmp(&a.1));+ relevant_windows.sort_by_key(|b| std::cmp::Reverse(b.1));// Print current topmost window infoif let Some((topmost_window, level)) = relevant_windows.first()