feat: macos, screencapturekit

1. Add new feature `screencapturekit`.
2. Remove `unwrap()` in mod `screencapturekit`.
No all `unwrap()` in this crate are removed.
3. Add selector check before calling it.

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-11-22 21:09:54 +08:00
parent e851e41b6e
commit f5b0c718de
5 changed files with 52 additions and 19 deletions

View file

@ -12,6 +12,7 @@ rust-version = "1.70"
[features]
asio = ["asio-sys", "num-traits"] # Only available on Windows. See README for setup instructions.
oboe-shared-stdcxx = ["oboe/shared-stdcxx"] # Only available on Android. See README for what it does.
screencapturekit = ["cidre"]
[dependencies]
dasp_sample = "0.11"
@ -53,7 +54,15 @@ mach2 = "0.4" # For access to mach_timebase type.
[target.'cfg(target_os = "macos")'.dependencies]
coreaudio-rs = { version = "0.11", default-features = false, features = ["audio_unit", "core_audio"] }
cidre = { git = "https://github.com/yury/cidre.git", rev = "f05c428" }
cidre = { git = "https://github.com/yury/cidre.git", rev = "f05c428", features = [
"blocks",
"async",
"dispatch",
"av",
"sc",
"macos_12_3",
], default-features = false, optional = true }
[target.'cfg(target_os = "ios")'.dependencies]
coreaudio-rs = { version = "0.11", default-features = false, features = ["audio_unit", "core_audio", "audio_toolbox"] }