Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

comments

Richie McIlroy766f3880d06c
diff --git a/apps/desktop/src-tauri/src/camera_legacy.rs b/apps/desktop/src-tauri/src/camera_legacy.rs
index 7617d8ab4..ceb6a73a2 100644
--- a/apps/desktop/src-tauri/src/camera_legacy.rs
+++ b/apps/desktop/src-tauri/src/camera_legacy.rs
@@ -214,7 +214,7 @@ impl WsBlurState {
rgba_data: &[u8],
width: u32,
height: u32,
- _stride: u32,
+ stride: u32,
mode: cap_camera_effects::BlurMode,
) -> Option<(Arc<Vec<u8>>, u32, u32, u32)> {
if !self.init_attempted {
@@ -258,7 +258,7 @@ impl WsBlurState {
rgba_data,
wgpu::TexelCopyBufferLayout {
offset: 0,
- bytes_per_row: Some(width * 4),
+ bytes_per_row: Some(stride),
rows_per_image: Some(height),
},
wgpu::Extent3d {
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index fd3d3677f..251e33285 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -597,17 +597,17 @@ pub async fn start_recording(
let mut app_state = state_mtx.write().await;
app_state.was_camera_only_recording = true;
- let current_mirrored = app_state
+ let (current_mirrored, current_background_blur) = app_state
.camera_preview
.get_state()
- .map(|s| s.mirrored)
- .unwrap_or(false);
+ .map(|s| (s.mirrored, s.background_blur))
+ .unwrap_or_default();
let camera_state = CameraPreviewState {
size: crate::camera::CAMERA_PRESET_LARGE,
shape: CameraPreviewShape::Full,
mirrored: current_mirrored,
- background_blur: cap_project::BackgroundBlurMode::Off,
+ background_blur: current_background_blur,
};
if let Err(err) = app_state.camera_preview.set_state(camera_state) {
diff --git a/crates/camera-effects/src/segmentation.rs b/crates/camera-effects/src/segmentation.rs
index 3ed1790a0..471fcc6c8 100644
--- a/crates/camera-effects/src/segmentation.rs
+++ b/crates/camera-effects/src/segmentation.rs
@@ -94,7 +94,7 @@ fn try_register_coreml(
}
Err(e) => {
tracing::warn!("Camera background blur: CoreML EP registration failed, using CPU: {e}");
- Session::builder().unwrap_or_else(|_| panic!("Failed to recreate session builder"))
+ e.recover()
}
}
}
@@ -114,7 +114,7 @@ fn try_register_directml(
tracing::warn!(
"Camera background blur: DirectML EP registration failed, using CPU: {e}"
);
- Session::builder().unwrap_or_else(|_| panic!("Failed to recreate session builder"))
+ e.recover()
}
}
}