Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
166 lines (147 loc) · 5.06 KB
/
Copy pathCargo.toml
File metadata and controls
166 lines (147 loc) · 5.06 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
[workspace]
resolver = "2"
members = [
"apps/cli",
"crates/*",
"crates/workspace-hack",
]
[workspace.dependencies]
anyhow = { version = "1.0.86" }
# This includes a currently-unreleased fix that ensures the audio stream is actually
# stopped and released on drop on macOS, plus zeroing of WASAPI capture
# packets flagged AUDCLNT_BUFFERFLAGS_SILENT (loopback of an idle endpoint
# otherwise surfaces unspecified buffer contents as audio).
cpal = { git = "https://github.com/CapSoftware/cpal", rev = "6013cb5f8bd3" }
ffmpeg = { package = "ffmpeg-next", git = "https://github.com/CapSoftware/rust-ffmpeg", rev = "49db1fede112" }
tokio = { version = "1.39.3", features = [
"macros",
"process",
"fs",
"sync",
"rt",
"rt-multi-thread",
"time",
] }
specta = { version = "=2.0.0-rc.20", features = [
"derive",
"serde_json",
"uuid",
"chrono"
] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2", features = [
"input-native",
"serialize",
] }
nokhwa-bindings-macos = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2" }
wgpu = { version = "25.0.0", features = ["wgpu-core"] }
wgpu-hal = "25.0.0"
wgpu-core = "25.0.0"
flume = "0.11.0"
thiserror = "1.0"
sentry = { version = "0.42.0", features = [
"anyhow",
"backtrace",
"debug-images",
] }
tracing = "0.1.41"
futures = "0.3.31"
aho-corasick = "1.1.4"
cidre = { git = "https://github.com/CapSoftware/cidre", rev = "bf84b67079a8", features = [
"macos_12_7",
"cv",
"cf",
"cg",
"core_audio",
"sc",
"av",
"blocks",
"async",
"dispatch",
"io_surface",
"mtl",
"vt",
"vn",
], default-features = false }
windows = "0.60.0"
windows-core = "0.60"
windows-sys = "0.59.0"
windows-capture = "1.5.0"
percent-encoding = "2.3.1"
sysinfo = "0.32"
# TODO: Reenable these: https://github.com/CapSoftware/Cap/issues/859
[workspace.lints.rust]
deprecated = "allow"
unexpected_cfgs = "allow"
unused_must_use = "deny"
[workspace.lints.clippy]
dbg_macro = "deny"
let_underscore_future = "deny"
unchecked_duration_subtraction = "deny"
collapsible_if = "deny"
clone_on_copy = "deny"
redundant_closure = "deny"
ptr_arg = "deny"
len_zero = "deny"
let_unit_value = "deny"
unnecessary_lazy_evaluations = "deny"
needless_range_loop = "deny"
manual_clamp = "deny"
[profile.dev]
debug = 1
[profile.dev.package."*"]
debug = 0
[profile.dev.package.cap-camera-effects]
opt-level = 2
[profile.dev.package.cap-audio]
opt-level = 2
# opt-level 0 compiles the AVX2 BT.709 kernel into a spill loop. On the
# ci-verify profile that is 180 ms for 1080p against 3 ms for swscale, and
# the Windows real-capture job then keeps about 6 fps. opt-level 1 is under
# 2 ms, still faster than swscale.
[profile.dev.package.cap-enc-ffmpeg]
opt-level = 1
# The verification suite decodes markers from every output pixel it reads;
# unoptimised it spends minutes in its own loops.
[profile.dev.package.cap-verify]
opt-level = 3
# Engine verification suite in CI (.github/workflows/engine-verify.yml).
# Dependencies come from the Rust cache, so optimising them costs nothing on
# a warm run and speeds up the cases; workspace crates rebuild on every run
# and stay cheap to compile. No debuginfo or incremental state to cache.
[profile.ci-verify]
inherits = "dev"
debug = 0
incremental = false
[profile.ci-verify.package."*"]
opt-level = 1
# `package."*"` does not cover workspace members, so this crate otherwise
# stays at opt-level 0. See `[profile.dev.package.cap-enc-ffmpeg]`.
[profile.ci-verify.package.cap-enc-ffmpeg]
opt-level = 1
[profile.ci-verify.package.cap-verify]
opt-level = 3
# Optimize for smaller binary size
[profile.release]
panic = "unwind"
codegen-units = 1 # Compile crates one after another so the compiler can optimize better
# Thin LTO runs the cross-crate optimisation in parallel across crates. Fat LTO
# serialised the whole program through one thread and one address space, which
# cost ~60 minutes of the Windows release job (18m for the CLI link + 41m for
# the desktop link) and needed the swapfile / pagefile workarounds in
# desktop-release.yml to survive 16GB runners.
lto = "thin"
opt-level = "s" # Optimize for binary size
# Line tables are all Sentry needs to symbolicate the uploaded dSYM / PDB
# (function names + file:line). Full debuginfo multiplied rlib size and link
# memory for variable/type info nothing consumes.
debug = "line-tables-only"
[patch.crates-io]
# screencapturekit = { git = "https://github.com/CapSoftware/screencapturekit-rs", rev = "7ff1e103742e56c8f6c2e940b5e52684ed0bed69" } # branch = "cap-main"
cidre = { git = "https://github.com/CapSoftware/cidre", rev = "bf84b67079a8" }
# https://github.com/gfx-rs/wgpu/pull/7550
# wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "cd41a6e32a6239b65d1cecbeccde6a43a100914a" }
wgpu-hal = { path = "vendor/wgpu-hal" }
# https://github.com/CapSoftware/reqwest/commit/9b5ecbd5210a9510fde766015cabb724c1e70d2e
reqwest = { git = "https://github.com/CapSoftware/reqwest", rev = "9b5ecbd5210a9510fde766015cabb724c1e70d2e" }