Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

use cidre-powered scap

Brendan Allanf7d8abc81ae9
diff --git a/Cargo.lock b/Cargo.lock
index 263dd0863..e4671dc49 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -189,7 +189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41058deaa38c9d9dd933d6d238d825227cffa668e2839b52879f6619c63eee3b"
dependencies = [
"futures",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -1289,7 +1289,7 @@ dependencies = [
"semver",
"serde",
"serde_json",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -1408,18 +1408,21 @@ dependencies = [
[[package]]
name = "cidre"
-version = "0.6.0"
-source = "git+https://github.com/yury/cidre?rev=ef04aaabe14ffbbce4a330973a74b6d797d073ff#ef04aaabe14ffbbce4a330973a74b6d797d073ff"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5b83f5e597a8fb4ba25eec2683aa3e89f9890dd7524622639a38e3f854c60eb"
dependencies = [
"cidre-macros",
+ "half",
"parking_lot",
"tokio",
]
[[package]]
name = "cidre-macros"
-version = "0.1.0"
-source = "git+https://github.com/yury/cidre?rev=ef04aaabe14ffbbce4a330973a74b6d797d073ff#ef04aaabe14ffbbce4a330973a74b6d797d073ff"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f07a383a232853874a9b0b3e80e6eefe9bea73495b8ab4bdd960bc7c1db4c6d"
[[package]]
name = "clang-sys"
@@ -1746,17 +1749,6 @@ dependencies = [
"url",
]
-[[package]]
-name = "core-audio-types"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9bb31b6a9e9c7cdfbc73bed41f978c41f294e7fc1218f9d74a4bd8901beb87a1"
-dependencies = [
- "cfg-if 1.0.0",
- "core-foundation-sys 0.8.7",
- "libc",
-]
-
[[package]]
name = "core-audio-types-rs"
version = "0.3.4"
@@ -1881,34 +1873,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "core-graphics2"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e4583956b9806b69f73fcb23aee05eb3620efc282972f08f6a6db7504f8334d"
-dependencies = [
- "bitflags 2.9.0",
- "block",
- "cfg-if 1.0.0",
- "core-foundation 0.10.0",
- "libc",
-]
-
-[[package]]
-name = "core-media"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "735c25a66449364e6850ac0e27e45d5b13c6e6fe6f44a2f96cbff2d9d29447e3"
-dependencies = [
- "block",
- "cfg-if 1.0.0",
- "core-audio-types",
- "core-foundation 0.10.0",
- "core-graphics2",
- "core-video",
- "libc",
-]
-
[[package]]
name = "core-media-rs"
version = "0.3.4"
@@ -1919,7 +1883,7 @@ dependencies = [
"core-foundation 0.10.0",
"core-utils-rs",
"core-video-rs",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -1943,19 +1907,6 @@ dependencies = [
"four-char-code",
]
-[[package]]
-name = "core-video"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d45e71d5be22206bed53c3c3cb99315fc4c3d31b8963808c6bc4538168c4f8ef"
-dependencies = [
- "block",
- "core-foundation 0.10.0",
- "core-graphics2",
- "io-surface",
- "libc",
-]
-
[[package]]
name = "core-video-rs"
version = "0.3.4"
@@ -1966,7 +1917,7 @@ dependencies = [
"core-graphics 0.24.0",
"core-utils-rs",
"io-surface",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -3510,9 +3461,9 @@ dependencies = [
[[package]]
name = "half"
-version = "2.4.1"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888"
+checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
dependencies = [
"cfg-if 1.0.0",
"crunchy",
@@ -3960,6 +3911,17 @@ dependencies = [
"libc",
]
+[[package]]
+name = "io-uring"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
+dependencies = [
+ "bitflags 2.9.0",
+ "cfg-if 1.0.0",
+ "libc",
+]
+
[[package]]
name = "ipnet"
version = "2.9.0"
@@ -4224,9 +4186,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.161"
+version = "0.2.174"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1"
+checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
[[package]]
name = "libdbus-sys"
@@ -4649,7 +4611,7 @@ dependencies = [
"once_cell",
"png",
"serde",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"windows-sys 0.59.0",
]
@@ -6254,7 +6216,7 @@ dependencies = [
"rustc-hash 2.1.1",
"send_wrapper",
"slotmap",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"web-sys",
]
@@ -6297,7 +6259,7 @@ checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b"
dependencies = [
"getrandom 0.2.15",
"libredox",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -6623,22 +6585,19 @@ dependencies = [
[[package]]
name = "scap"
version = "0.0.8"
-source = "git+https://github.com/CapSoftware/scap?rev=b914379d787f#b914379d787f934b0cf1f8db6d3cdbd6947b144c"
+source = "git+https://github.com/CapSoftware/scap?rev=d69dcb2e653a#d69dcb2e653a714bf91d147333deb5fb06acb940"
dependencies = [
+ "cidre",
"cocoa 0.25.0",
- "core-foundation 0.10.0",
- "core-graphics 0.24.0",
"core-graphics-helmer-fork",
- "core-media",
- "core-media-rs",
"cpal 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)",
"dbus",
+ "futures",
"objc",
"pipewire",
"rand 0.8.5",
- "screencapturekit",
"sysinfo",
- "tao-core-video-sys",
+ "thiserror 2.0.12",
"windows 0.58.0",
"windows-capture",
]
@@ -7607,18 +7566,6 @@ dependencies = [
"x11-dl",
]
-[[package]]
-name = "tao-core-video-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "271450eb289cb4d8d0720c6ce70c72c8c858c93dd61fc625881616752e6b98f6"
-dependencies = [
- "cfg-if 1.0.0",
- "core-foundation-sys 0.8.7",
- "libc",
- "objc",
-]
-
[[package]]
name = "tao-macros"
version = "0.1.3"
@@ -7690,7 +7637,7 @@ dependencies = [
"tauri-runtime",
"tauri-runtime-wry",
"tauri-utils",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"tokio",
"tray-icon",
"url",
@@ -7743,7 +7690,7 @@ dependencies = [
"sha2",
"syn 2.0.90",
"tauri-utils",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"time",
"url",
"uuid",
@@ -7809,7 +7756,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -7825,7 +7772,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-utils",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"tracing",
"url",
"windows-registry 0.3.0",
@@ -7846,7 +7793,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-plugin-fs",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"url",
]
@@ -7867,7 +7814,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-utils",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"toml",
"url",
"uuid",
@@ -7885,7 +7832,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -7904,7 +7851,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tauri-plugin-fs",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"tokio",
"url",
"urlpattern",
@@ -7924,7 +7871,7 @@ dependencies = [
"serde_repr",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"time",
"url",
]
@@ -7959,7 +7906,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"url",
"windows 0.60.0",
"zbus 5.3.0",
@@ -7980,7 +7927,7 @@ dependencies = [
"sys-locale",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -7995,7 +7942,7 @@ dependencies = [
"serde_repr",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -8025,7 +7972,7 @@ dependencies = [
"shared_child",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"tokio",
]
@@ -8039,7 +7986,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin-deep-link",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"tracing",
"windows-sys 0.59.0",
"zbus 5.3.0",
@@ -8056,7 +8003,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"tokio",
"tracing",
]
@@ -8084,7 +8031,7 @@ dependencies = [
"tauri",
"tauri-plugin",
"tempfile",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"time",
"tokio",
"url",
@@ -8104,7 +8051,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
]
[[package]]
@@ -8124,7 +8071,7 @@ dependencies = [
"serde",
"serde_json",
"tauri-utils",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"url",
"windows 0.61.1",
]
@@ -8214,7 +8161,7 @@ dependencies = [
"serde_json",
"serde_with",
"swift-rs",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"toml",
"url",
"urlpattern",
@@ -8302,11 +8249,11 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "2.0.6"
+version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47"
+checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
dependencies = [
- "thiserror-impl 2.0.6",
+ "thiserror-impl 2.0.12",
]
[[package]]
@@ -8322,9 +8269,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
-version = "2.0.6"
+version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312"
+checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [
"proc-macro2",
"quote",
@@ -8409,16 +8356,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.39.3"
+version = "1.46.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5"
+checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
dependencies = [
"backtrace",
"bytes",
+ "io-uring",
"libc",
"mio 1.0.2",
"pin-project-lite",
"signal-hook-registry",
+ "slab",
"socket2",
"tokio-macros",
"tracing",
@@ -8427,9 +8376,9 @@ dependencies = [
[[package]]
name = "tokio-macros"
-version = "2.4.0"
+version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
+checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
@@ -8685,7 +8634,7 @@ dependencies = [
"once_cell",
"png",
"serde",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"windows-sys 0.59.0",
]
@@ -9297,7 +9246,7 @@ version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae2d11c4a686e4409659d7891791254cf9286d3cfe0eef54df1523533d22295"
dependencies = [
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"windows 0.61.1",
"windows-core 0.61.0",
]
@@ -10298,7 +10247,7 @@ dependencies = [
"sha2",
"soup3",
"tao-macros",
- "thiserror 2.0.6",
+ "thiserror 2.0.12",
"url",
"webkit2gtk",
"webkit2gtk-sys",
diff --git a/Cargo.toml b/Cargo.toml
index 716aa8863..4770d46ea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ specta = { version = "=2.0.0-rc.20", features = [
"uuid",
] }
-scap = { git = "https://github.com/CapSoftware/scap", rev = "b914379d787f" }
+scap = { git = "https://github.com/CapSoftware/scap", rev = "d69dcb2e653a" }
nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2", features = [
"input-native",
"serialize",
@@ -41,7 +41,7 @@ sentry = { version = "0.34.0", features = [
] }
tracing = "0.1.41"
-cidre = { git = "https://github.com/yury/cidre", rev = "ef04aaabe14ffbbce4a330973a74b6d797d073ff" }
+cidre = "0.9.2"
windows = "0.58.0"
windows-sys = "0.59.0"
diff --git a/apps/cli/src/record.rs b/apps/cli/src/record.rs
index 1eaea9747..668fb14f9 100644
--- a/apps/cli/src/record.rs
+++ b/apps/cli/src/record.rs
@@ -30,26 +30,19 @@ pub struct RecordStart {
impl RecordStart {
pub async fn run(self) -> Result<(), String> {
- let (target_info, _) = self
- .target
- .screen
- .map(|id| {
- cap_media::sources::list_screens()
- .into_iter()
- .find(|s| s.0.id == id)
- .map(|(s, t)| (ScreenCaptureTarget::Screen { id: s.id }, t))
- .ok_or(format!("Screen with id '{id}' not found"))
- })
- .or_else(|| {
- self.target.window.map(|id| {
- cap_media::sources::list_windows()
- .into_iter()
- .find(|s| s.0.id == id)
- .map(|(s, t)| (ScreenCaptureTarget::Window { id: s.id }, t))
- .ok_or(format!("Window with id '{id}' not found"))
- })
- })
- .ok_or("No target specified".to_string())??;
+ let (target_info, _) = match (self.target.screen, self.target.window) {
+ (Some(id), _) => cap_media::sources::list_screens()
+ .into_iter()
+ .find(|s| s.0.id == id)
+ .map(|(s, t)| (ScreenCaptureTarget::Screen { id: s.id }, t))
+ .ok_or(format!("Screen with id '{id}' not found")),
+ (_, Some(id)) => cap_media::sources::list_windows()
+ .into_iter()
+ .find(|s| s.0.id == id)
+ .map(|(s, t)| (ScreenCaptureTarget::Window { id: s.id }, t))
+ .ok_or(format!("Window with id '{id}' not found")),
+ _ => Err("No target specified".to_string()),
+ }?;
let camera = if let Some(camera_index) = self.camera {
if let Some(camera_info) = nokhwa::query(ApiBackend::Auto)
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 17c335d4d..87fa91ed8 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -1153,10 +1153,11 @@ async fn take_screenshot(app: AppHandle, _state: MutableState<'_, App>) -> Resul
};
if let Some(window) = CapWindowId::Main.get(&app) {
- window.hide().ok();
+ let _ = window.hide();
}
- let mut capturer = Capturer::new(options);
+ let mut capturer =
+ Capturer::build(options).map_err(|e| format!("Failed to construct error: {e}"))?;
capturer.start_capture();
let frame = capturer
.get_next_frame()
@@ -1164,7 +1165,7 @@ async fn take_screenshot(app: AppHandle, _state: MutableState<'_, App>) -> Resul
capturer.stop_capture();
if let Some(window) = CapWindowId::Main.get(&app) {
- window.show().ok();
+ let _ = window.show();
}
match frame {
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index ef644eabb..caddf5501 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -171,7 +171,7 @@ impl CompletedRecording {
#[tauri::command(async)]
#[specta::specta]
-pub fn list_capture_screens() -> Vec<CaptureScreen> {
+pub async fn list_capture_screens() -> Vec<CaptureScreen> {
cap_media::sources::list_screens()
.into_iter()
.map(|(v, _)| v)
@@ -180,7 +180,7 @@ pub fn list_capture_screens() -> Vec<CaptureScreen> {
#[tauri::command(async)]
#[specta::specta]
-pub fn list_capture_windows() -> Vec<CaptureWindow> {
+pub async fn list_capture_windows() -> Vec<CaptureWindow> {
cap_media::sources::list_windows()
.into_iter()
.map(|(v, _)| v)
diff --git a/crates/media/src/platform/macos.rs b/crates/media/src/platform/macos.rs
index 28402edc5..b1cd783f4 100644
--- a/crates/media/src/platform/macos.rs
+++ b/crates/media/src/platform/macos.rs
@@ -1,4 +1,4 @@
-use cidre::cv;
+use cidre::{cg, cv};
use cocoa::{base::id, foundation::NSDictionary};
use core_foundation::{
array::CFArrayGetCount,
@@ -347,7 +347,7 @@ pub fn get_display_refresh_rate(
if rate == 0 {
// adapted from https://github.com/mpv-player/mpv/commit/eacf22e42a6bbce8a32e64f5563ac431122c1186
- let link = cv::DisplayLink::with_cg_display(display.id)
+ let link = cv::DisplayLink::with_cg_display(cg::DirectDisplayId(display.id))
.map_err(|e| format!("with_cg_display / {e}"))?;
let t = link.nominal_output_video_refresh_period();
diff --git a/crates/media/src/sources/screen_capture.rs b/crates/media/src/sources/screen_capture.rs
index ec7c8e7d1..f0e156d49 100644
--- a/crates/media/src/sources/screen_capture.rs
+++ b/crates/media/src/sources/screen_capture.rs
@@ -197,7 +197,7 @@ pub struct CropRatio {
}
impl<TCaptureFormat: ScreenCaptureFormat> ScreenCaptureSource<TCaptureFormat> {
- pub fn init(
+ pub async fn init(
target: &ScreenCaptureTarget,
output_type: Option<FrameType>,
show_camera: bool,
@@ -242,7 +242,9 @@ impl<TCaptureFormat: ScreenCaptureFormat> ScreenCaptureSource<TCaptureFormat> {
start_time,
};
- let options = this.create_options(scap_target, crop_area, captures_audio)?;
+ let options = this
+ .create_options(scap_target, crop_area, captures_audio)
+ .await?;
this.options = Arc::new(options);
@@ -305,7 +307,7 @@ impl<TCaptureFormat: ScreenCaptureFormat> ScreenCaptureSource<TCaptureFormat> {
let id = {
#[cfg(target_os = "macos")]
{
- display.raw_handle.id
+ display.raw_handle.0
}
#[cfg(windows)]
@@ -394,7 +396,7 @@ impl<TCaptureFormat: ScreenCaptureFormat> ScreenCaptureSource<TCaptureFormat> {
})
}
- fn create_options(
+ async fn create_options(
&self,
target: scap::Target,
crop_area: Option<Area>,
@@ -660,6 +662,8 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
control_signal,
|capturer| match capturer.raw().get_next_sample_buffer() {
Ok((sample_buffer, typ)) => {
+ use cidre::sc;
+
let sample_buffer = unsafe {
std::mem::transmute::<_, cidre::arc::R<cidre::cm::SampleBuf>>(sample_buffer)
};
@@ -670,7 +674,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
let relative_time = unix_timestamp - start_time_f64;
match typ {
- SCStreamOutputType::Screen => {
+ sc::stream::OutputType::Screen => {
let Some(pixel_buffer) = sample_buffer.image_buf() else {
return ControlFlow::Continue(());
};
@@ -695,7 +699,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
}
}
}
- SCStreamOutputType::Audio => {
+ sc::stream::OutputType::Audio => {
let res = || {
cap_fail::fail_err!("screen_capture audio skip", ());
Ok::<(), ()>(())
@@ -729,6 +733,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
let _ = audio_tx.send((frame, relative_time));
}
+ _ => {}
}
ControlFlow::Continue(())
@@ -818,7 +823,7 @@ pub fn list_windows() -> Vec<(CaptureWindow, Target)> {
pub fn get_target_fps(target: &scap::Target) -> Result<u32, String> {
#[cfg(target_os = "macos")]
match target {
- scap::Target::Display(display) => platform::get_display_refresh_rate(display.raw_handle.id),
+ scap::Target::Display(display) => platform::get_display_refresh_rate(display.raw_handle.0),
scap::Target::Window(window) => platform::get_display_refresh_rate(
platform::display_for_window(window.raw_handle)
.ok_or_else(|| "failed to get display for window".to_string())?
@@ -848,7 +853,7 @@ fn display_for_target<'a>(
{
let id = platform::display_for_window(window.raw_handle)?;
targets.iter().find(|t| match t {
- scap::Target::Display(d) => d.raw_handle.id == id.id,
+ scap::Target::Display(d) => d.raw_handle.0 == id.id,
_ => false,
})
}
diff --git a/crates/recording/src/capture_pipeline.rs b/crates/recording/src/capture_pipeline.rs
index fc5fffe5f..8d7ff0e22 100644
--- a/crates/recording/src/capture_pipeline.rs
+++ b/crates/recording/src/capture_pipeline.rs
@@ -359,7 +359,7 @@ pub type ScreenCaptureMethod = CMSampleBufferCapture;
#[cfg(not(target_os = "macos"))]
pub type ScreenCaptureMethod = AVFrameCapture;
-pub fn create_screen_capture(
+pub async fn create_screen_capture(
capture_target: &ScreenCaptureTarget,
show_camera: bool,
force_show_cursor: bool,
@@ -379,6 +379,7 @@ pub fn create_screen_capture(
audio_tx,
start_time,
)
+ .await
.map(|v| (v, video_rx))
.map_err(|e| RecordingError::Media(MediaError::TaskLaunch(e)))
}
diff --git a/crates/recording/src/instant_recording.rs b/crates/recording/src/instant_recording.rs
index fd62b28df..452fef5d0 100644
--- a/crates/recording/src/instant_recording.rs
+++ b/crates/recording/src/instant_recording.rs
@@ -190,7 +190,8 @@ pub async fn spawn_instant_recording_actor<'a>(
30,
system_audio.0,
start_time,
- )?;
+ )
+ .await?;
debug!("screen capture: {screen_source:#?}");
diff --git a/crates/recording/src/studio_recording.rs b/crates/recording/src/studio_recording.rs
index bc8d65920..c9297ce6b 100644
--- a/crates/recording/src/studio_recording.rs
+++ b/crates/recording/src/studio_recording.rs
@@ -655,7 +655,8 @@ async fn create_segment_pipeline(
120,
system_audio.0,
start_time,
- )?;
+ )
+ .await?;
let screen_crop_ratio = screen_source.crop_ratio();
let camera_feed = match camera_feed.as_ref() {