Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

log errors with opening camera feed

PJe3655b94f168
diff --git a/Cargo.lock b/Cargo.lock
index 2d56f9c73..5dbb79094 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1489,7 +1489,7 @@ dependencies = [
[[package]]
name = "desktop"
-version = "0.3.0-beta.5.7"
+version = "0.3.0-beta.5.7.1"
dependencies = [
"anyhow",
"axum",
@@ -1518,7 +1518,7 @@ dependencies = [
"mp4",
"nix 0.29.0",
"nokhwa 0.10.3 (git+https://github.com/CapSoftware/nokhwa?branch=brendonovich-fork)",
- "nokhwa-bindings-macos 0.2.0 (git+https://github.com/Brendonovich/nokhwa?rev=2de5a760d5f1)",
+ "nokhwa-bindings-macos 0.2.0 (git+https://github.com/CapSoftware/nokhwa?branch=brendonovich-fork)",
"num-traits",
"objc",
"objc2-app-kit",
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index 3c86be500..efba493b9 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "desktop"
-version = "0.3.0-beta.5.7"
+version = "0.3.0-beta.5.7.1"
description = "Beautiful, shareable screen recordings."
authors = ["you"]
edition = "2021"
@@ -83,7 +83,7 @@ global-hotkey = "0.5.5"
[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.24.0"
core-foundation = "0.10.0"
-nokhwa-bindings-macos = { git = "https://github.com/Brendonovich/nokhwa", rev = "2de5a760d5f1" }
+nokhwa-bindings-macos = { git = "https://github.com/CapSoftware/nokhwa", branch = "brendonovich-fork" }
objc2-app-kit = { version = "0.2.2", features = ["NSWindow", "NSResponder"] }
cocoa = "0.26.0"
objc = "0.2.7"
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index e98f39fc9..bbcc4e09b 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -162,11 +162,14 @@ impl App {
if self.camera_feed.is_none() {
self.camera_feed = CameraFeed::init(&camera_label, self.camera_tx.clone())
.await
+ .map_err(|error| eprintln!("{error}"))
+ .ok();
+ } else if let Some(camera_feed) = self.camera_feed.as_mut() {
+ camera_feed
+ .switch_cameras(&camera_label)
+ .await
+ .map_err(|error| eprintln!("{error}"))
.ok();
- }
-
- if let Some(camera_feed) = self.camera_feed.as_mut() {
- camera_feed.switch_cameras(&camera_label).await.ok();
}
}
None => {