Settings were JSON blobs the UI read once at start and wrote back. The engine had no way to read settings, nothing was notified of changes, and there was no place for command line or config file values. settings::Settings holds typed keys (a Key<T> carries its name, value type, default, validation and a kind for a settings page; a registry lists the registered keys). The effective value comes from the runtime value stored in the client database, else the command line or environment (VOELIN_SETTING_STREAM__FPS, --set key=value), else a config file (TOML or JSON), else the default; reset() removes the runtime value. Reads come from memory as Arc<T>; writes update memory, notify, and go to SQLite on a writer thread in batches. Subscribers get every set and reset; a SettingWatch per key gets value changes. Stored values are versioned: the first migration copies the share dialog's frame rate and bitrate and the crash report opt-in out of the UI's blob, which stays for older versions. The keys the streaming work needs are defined: stream.fps (default 60), stream.bitrate_kbps (8000), stream.layers (LayerSpec-compatible), codec, capture and encoder backends, SRTP profiles, hardware acceleration and stream.permissions, plus audio and crash_reports. No key has a maximum. The engine takes Command::SetSetting/ResetSetting/AttachSettings and reports Event::SettingChanged/SettingRejected for every change, also ones made directly on the settings; a changed audio key is applied to the sessions. stream.permissions answers join requests: everyone accepts, channel accepts clients in our channel and denies others (the server relays requests from any channel), nobody denies, friends asks (no contacts yet). StartStream's auto_accept still accepts everyone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
50 lines
1.8 KiB
TOML
50 lines
1.8 KiB
TOML
[package]
|
|
name = "voelin-core"
|
|
version = "0.1.0"
|
|
description = "Client engine: server sessions merging voice, gateway and query sources; the API the UI drives."
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
|
|
[features]
|
|
default = ["audio-device"]
|
|
# Capture and play audio through the system's devices.
|
|
audio-device = ["voelin-audio/device"]
|
|
# The `media` module: capture and video codecs for streams, with whatever
|
|
# voelin-media backends are enabled (e.g. MediaCodec and a registered capture
|
|
# source on Android).
|
|
media = ["dep:voelin-media"]
|
|
# `media` with voelin-media's desktop backends: libvpx, OpenH264 loaded at
|
|
# runtime, X11 and PipeWire on Linux. Not for Android (libvpx does not
|
|
# cross-compile there).
|
|
media-desktop = ["media", "voelin-media/default"]
|
|
|
|
[dependencies]
|
|
anyhow = "1"
|
|
futures = "0.3"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
thiserror = "2"
|
|
tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time"] }
|
|
tokio-tungstenite = "0.30"
|
|
toml = "1.1.6"
|
|
tracing = "0.1"
|
|
voelin-audio = { path = "../voelin-audio", default-features = false }
|
|
voelin-gateway-proto = { path = "../voelin-gateway-proto" }
|
|
voelin-media = { path = "../voelin-media", default-features = false, features = ["str0m"], optional = true }
|
|
voelin-model = { path = "../voelin-model" }
|
|
voelin-observer = { path = "../voelin-observer" }
|
|
voelin-query = { path = "../voelin-query" }
|
|
voelin-store = { path = "../voelin-store" }
|
|
voelin-stream = { path = "../voelin-stream" }
|
|
tsclientlib = { path = "../proto/tsclientlib" }
|
|
tsproto-packets = { path = "../proto/tsproto-packets" }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1", features = ["macros", "rt-multi-thread", "test-util"] }
|
|
|
|
[lints]
|
|
workspace = true
|