-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathCargo.toml
More file actions
171 lines (146 loc) · 5.63 KB
/
Copy pathCargo.toml
File metadata and controls
171 lines (146 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
[package]
name = "screencapturekit"
version = "8.0.1"
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/doom-fish/screencapturekit-rs"
repository = "https://github.com/doom-fish/screencapturekit-rs"
documentation = "https://doom-fish.github.io/screencapturekit-rs/screencapturekit/"
description = "Safe Rust bindings for Apple's ScreenCaptureKit framework - screen and audio capture on macOS"
authors = ["Per Johansson <per@doom.fish>"]
keywords = ["screencapturekit", "screen-capture", "macos", "video", "audio"]
categories = ["multimedia", "os::macos-apis", "api-bindings"]
rust-version = "1.76"
readme = "README.md"
build = "build.rs"
include = [
"src/**/*",
"swift-bridge/Package.swift",
"swift-bridge/Sources/**/*",
"build.rs",
"Cargo.toml",
"README.md",
"LICENSE-*",
"CHANGELOG.md",
"COVERAGE.md",
]
[lints.rust]
unsafe_op_in_unsafe_fn = "warn"
missing_debug_implementations = "warn"
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
[lib]
name = "screencapturekit"
crate-type = ["lib"]
[features]
default = []
cargo-clippy = []
# Async support (executor-agnostic, works with any async runtime)
# Pulls in `futures-core` only for its `Stream` trait so `AsyncSCStream` can
# integrate with the `StreamExt` combinator ecosystem. `futures-core` is a tiny,
# `no_std`, trait-only crate.
async = ["dep:futures-core"]
# macOS version feature flags
# Enable features for specific macOS versions
# NB: when adding new versions, be sure to update build.rs to pass
# the correct feature flags over to the Swift bridge build.
macos_13_0 = []
macos_14_0 = ["macos_13_0"]
macos_14_2 = ["macos_14_0"]
macos_14_4 = ["macos_14_2"]
macos_15_0 = ["macos_14_4"]
macos_15_2 = ["macos_15_0"]
macos_26_0 = ["macos_15_2"]
[dependencies]
# Both deps resolve to crates.io by default. For local development against
# in-tree sibling checkouts of `apple-cf-rs` / `apple-metal-rs`, copy
# `.cargo/config.example.toml` to `.cargo/config.toml` (it's gitignored)
# and Cargo's `[patch.crates-io]` will redirect to your sibling paths.
# This lets `cargo install screencapturekit` and `release-plz` work from
# a clean checkout without requiring the sibling repos.
apple-cf = { version = ">=0.6, <0.10", default-features = false, features = ["cg", "iosurface", "dispatch", "cv", "cm"] }
apple-metal = { version = ">=0.6, <0.9", default-features = false }
# Trait-only crate providing `futures_core::Stream`; enabled by the `async`
# feature so `AsyncSCStream` / `AsyncSCRecordingOutput` can be consumed with the
# standard `StreamExt` combinators. No-op unless `async` is enabled.
futures-core = { version = "0.3", default-features = false, optional = true }
[dev-dependencies]
# Cap the transitive bitflags pulled in via the bevy dev-dependency: bitflags
# 2.12.0 overflows the macro recursion limit while compiling dispatch2
# (verified against dispatch2 0.3.1), which breaks `--all-targets` /
# `--all-features` lint and test builds. 2.13.0 fixes the overflow. Cargo.lock
# is gitignored here, so the resolver runs fresh and picks the highest version
# in range — `<2.14` makes that 2.13.0 (working) rather than the broken 2.12.x
# that `<2.13` would select. The upper bound also excludes a not-yet-verified
# 2.14. This is a dev-only constraint and does not affect the published
# dependency set.
bitflags = ">=2.0, <2.14"
png = "0.18"
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "macros", "test-util"] }
# `StreamExt` combinators for exercising the `futures_core::Stream` impls.
futures-util = { version = "0.3", default-features = false }
winit = "0.30"
raw-window-handle = "0.6"
criterion = { version = "0.8", features = ["html_reports"] }
eframe = "0.34"
wgpu = "29"
pollster = "0.4"
bevy = { version = "0.19", default-features = false, features = ["bevy_asset", "bevy_winit", "bevy_render", "bevy_sprite", "bevy_core_pipeline", "x11"] }
[[bench]]
name = "capture_benchmark"
harness = false
[[bench]]
name = "hotspots"
harness = false
required-features = ["macos_14_0"]
[package.metadata.docs.rs]
# Build documentation with all features enabled
all-features = true
# docs.rs builds on Linux, but this crate only works on macOS
default-target = "x86_64-apple-darwin"
targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"]
# Enable rustdoc unstable features for better docs
rustdoc-args = ["--cfg", "docsrs"]
[badges]
maintenance = { status = "actively-developed" }
[[example]]
name = "05_screenshot"
required-features = ["macos_14_0"]
[[example]]
name = "08_async"
required-features = ["async"]
[[example]]
name = "10_recording_output"
required-features = ["macos_15_0"]
[[example]]
name = "11_content_picker"
required-features = ["macos_14_0"]
[[example]]
name = "13_advanced_config"
required-features = ["macos_15_0"]
[[example]]
name = "16_full_metal_app"
path = "examples/16_full_metal_app/main.rs"
required-features = ["macos_14_0"]
# Note: 22_tauri_app is a separate Tauri project, run with:
# cd examples/22_tauri_app && npm install && npm run tauri dev
[[example]]
name = "23_client_server_server"
path = "examples/23_client_server/server.rs"
[[example]]
name = "23_client_server_client"
path = "examples/23_client_server/client.rs"
[[example]]
name = "24_batched_apis_showcase"
required-features = ["macos_14_0"]
[[example]]
name = "profile_capture"
required-features = ["macos_14_0"]
# Release profile keeps debug info so samply / xctrace can symbolicate.
# Full debug info gives precise inlining/line attribution; we lose 0.5s of
# build time vs `line-tables-only` but get 3-5× better stack quality.
[profile.release]
debug = "full"
strip = "none"