Files
VoelinClient/Cargo.toml
T
selikhovandClaude Opus 5.5 8519199c6b voelin-media: MJPEG cameras for the Stream Studio
Many USB cameras offer their large sizes only as MJPEG (the Fifine K420:
2560x1440 and 1920x1080 compressed, raw only up to 1280x720), and the
studio camera offered PipeWire raw formats only, so it was stuck at 720p.

MJPEG is now offered and decoded with zune-jpeg (already in the tree
through `image`) straight into pooled RGBA frames, on a thread of its own:
the camera thread copies each picture into a recycled buffer and hands it
over latest-wins, so a slow decode drops pictures instead of holding up
the camera, and nothing is allocated per picture once running. The offers
come from what V4L2 lists for the camera: the wanted size at the wanted
rate in a raw format first (no decoding), then the wanted size with MJPEG
first, then every format at the sizes it lists; PipeWire's V4L2 source
otherwise took a size on trust and failed to set NV12 at 1440p.

zune-jpeg is built optimised in dev builds like the other per-pixel code:
unoptimised, a 1440p picture took most of a second.

Tested on the Fifine K420: 2560x1440, 1920x1080 and 1280x720 arrive at
the right size at 10 fps, which is what the camera sends in this light
(v4l2-ctl measures the same); a camera-like 1440p picture decodes in about
30 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:07:44 +03:00

140 lines
3.9 KiB
TOML

[workspace]
resolver = "3"
# third_party: vendored crates patched in below (not workspace members, so
# their own tests and dev-dependencies stay out of our builds).
exclude = ["fuzz", "third_party"]
members = [
"crates/proto/tsproto-types",
"crates/proto/tsproto-structs",
"crates/proto/tsproto-packets",
"crates/proto/tsproto",
"crates/proto/ts-bookkeeping",
"crates/proto/tsclientlib",
"crates/voelin-android",
"crates/voelin-audio",
"crates/voelin-core",
"crates/voelin-gateway",
"crates/voelin-gateway-proto",
"crates/voelin-media",
"crates/voelin-model",
"crates/voelin-observer",
"crates/voelin-platform",
"crates/voelin-query",
"crates/voelin-store",
"crates/voelin-stream",
"crates/voelin-ui",
"tools/voelinctl",
]
default-members = [
"crates/proto/tsproto-types",
"crates/proto/tsproto-structs",
"crates/proto/tsproto-packets",
"crates/proto/tsproto",
"crates/proto/ts-bookkeeping",
"crates/proto/tsclientlib",
"crates/voelin-audio",
"crates/voelin-core",
"crates/voelin-gateway",
"crates/voelin-gateway-proto",
"crates/voelin-model",
"crates/voelin-observer",
"crates/voelin-platform",
"crates/voelin-query",
"crates/voelin-store",
"crates/voelin-stream",
"crates/voelin-ui",
"tools/voelinctl",
]
[workspace.package]
edition = "2024"
rust-version = "1.94"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Faumaray/Voelin"
publish = false
[workspace.lints.rust]
# deny, not forbid: generated code (Slint) needs a local allow.
unsafe_code = "deny"
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
[profile.dev.package.num-bigint]
# The Init1 puzzle does a large modular exponentiation on connect; unoptimized
# it takes seconds.
opt-level = 3
# Audio processing (echo cancellation, noise suppression) runs in real time on
# every 10 ms of microphone audio; unoptimized it needs about a third of a core.
[profile.dev.package.sonora]
opt-level = 3
[profile.dev.package.sonora-aec3]
opt-level = 3
[profile.dev.package.sonora-agc2]
opt-level = 3
[profile.dev.package.sonora-common-audio]
opt-level = 3
[profile.dev.package.sonora-fft]
opt-level = 3
[profile.dev.package.sonora-ns]
opt-level = 3
[profile.dev.package.sonora-simd]
opt-level = 3
# Screen sharing runs pixel conversion, codecs and RTP for every frame;
# unoptimized, a debug build manages a few frames per second at 1080p.
# (libvpx, dav1d and libopus are system / release-built C libraries.)
[profile.dev.package.yuv]
opt-level = 3
[profile.dev.package.voelin-media]
opt-level = 3
[profile.dev.package.str0m]
opt-level = 3
[profile.dev.package.str0m-proto]
opt-level = 3
[profile.dev.package.str0m-aws-lc-rs]
opt-level = 3
[profile.dev.package.openh264]
opt-level = 3
[profile.dev.package.dav1d]
opt-level = 3
[profile.dev.package.opus2]
opt-level = 3
[profile.dev.package.pipewire]
opt-level = 3
[profile.dev.package.libspa]
opt-level = 3
[profile.dev.package.x11rb-protocol]
opt-level = 3
[profile.dev.package.wayland-backend]
opt-level = 3
[profile.dev.package.wayland-client]
opt-level = 3
# MJPEG cameras: unoptimized, a 1440p picture takes most of a second.
[profile.dev.package.zune-jpeg]
opt-level = 3
[profile.dev]
# Line tables (for backtraces) for workspace crates, no debug info for
# dependencies: keeps target/ several times smaller. Override locally for
# debugging with CARGO_PROFILE_DEV_DEBUG=true.
debug = "line-tables-only"
[profile.dev.package."*"]
debug = false
# dimpl (DTLS for str0m) with a configurable SRTP profile order; see
# third_party/dimpl/VOELIN-PATCH.md.
[patch.crates-io]
dimpl = { path = "third_party/dimpl" }
[profile.release]
# One optimisation unit across all crates: inlining across crate boundaries
# matters for the per-pixel and per-packet code of streams. Panics still
# unwind (no `panic = "abort"`): a panic in one tokio task or media thread
# must not end the app (tasks and threads report it, mutexes recover from
# poisoning), and the crash reporter's hook runs either way.
lto = "fat"
codegen-units = 1