New crate tsc-media: - VideoFrame (I420, NV12, BGRA, RGBA with strides) and AudioBuffer (interleaved f32, 48 kHz) - YUV <-> RGB conversion with yuvutils-rs (BT.601 limited range), RGBA output for Slint pixel buffers, PSNR helper - Bounded drop-oldest frame channel with async and blocking receive - VideoEncoder / VideoDecoder traits, Codec (VP8, VP9, H.264, AV1) with an optional str0m mapping, codec preference (viewer VP9 > VP8 > AV1 > H.264, streamer hardware > VP8 > OpenH264 > VP9) and backend selection - libvpx VP8/VP9 encoder and decoder over libvpx-native-sys (small unsafe wrapper: realtime CBR, cpu-used 8, error resilient, screen content, runtime bitrate changes) - H.264 through Cisco's OpenH264 loaded at runtime (hash-checked), with an HTTPS + SHA-256 download helper - AV1 decoding through dav1d (feature av1) - Hardware encoder factory trait with VA-API / Media Foundation stubs deny.toml: allow the bzip2-1.0.6 license (pure Rust bzip2 used to unpack the OpenH264 download). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
59 lines
2.3 KiB
TOML
59 lines
2.3 KiB
TOML
[package]
|
|
name = "tsc-media"
|
|
version = "0.1.0"
|
|
description = "Video frames, pixel conversion, video codecs (VP8/VP9, H.264, AV1) and screen / system-audio capture for streams."
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
|
|
[features]
|
|
default = ["vpx", "openh264", "openh264-download"]
|
|
# VP8 and VP9 through the system libvpx (pkg-config `vpx`).
|
|
vpx = ["dep:libvpx-native-sys"]
|
|
# H.264 through Cisco's prebuilt OpenH264 library, loaded at runtime. The
|
|
# OpenH264 source is never compiled in (see docs/media.md).
|
|
openh264 = ["dep:openh264"]
|
|
# Download of Cisco's OpenH264 binary over HTTPS with a SHA-256 check.
|
|
openh264-download = ["openh264", "dep:reqwest", "dep:bzip2", "dep:sha2"]
|
|
# AV1 decoding through the system libdav1d (pkg-config `dav1d` >= 1.3).
|
|
av1 = ["dep:dav1d"]
|
|
# X11 screen capture (Linux).
|
|
x11 = ["dep:x11rb", "dep:memmap2", "dep:rustix"]
|
|
# Wayland screen capture (ScreenCast portal + PipeWire) and PipeWire system
|
|
# audio (Linux).
|
|
pipewire = ["dep:ashpd", "dep:pipewire"]
|
|
# Conversion between `Codec` and `str0m::format::Codec`.
|
|
str0m = ["dep:str0m"]
|
|
|
|
[dependencies]
|
|
bzip2 = { version = "0.6.1", optional = true }
|
|
dav1d = { version = "0.11.1", optional = true }
|
|
libvpx-native-sys = { version = "5.0.17", optional = true }
|
|
openh264 = { version = "0.9.8", default-features = false, features = ["libloading"], optional = true }
|
|
reqwest = { version = "0.13.5", default-features = false, features = ["rustls"], optional = true }
|
|
sha2 = { version = "0.10.9", optional = true }
|
|
str0m = { version = "0.23.1", default-features = false, optional = true }
|
|
thiserror = "2.0.21"
|
|
tokio = { version = "1", features = ["sync"] }
|
|
tracing = "0.1.44"
|
|
yuv = "0.8.19"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
ashpd = { version = "0.13.13", default-features = false, features = ["screencast", "tokio"], optional = true }
|
|
memmap2 = { version = "0.9.11", optional = true }
|
|
pipewire = { version = "0.10.1", optional = true }
|
|
rustix = { version = "1.1.5", features = ["fs"], optional = true }
|
|
x11rb = { version = "0.13.2", features = ["randr", "shm", "xfixes"], optional = true }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
wasapi = "0.24.0"
|
|
windows-capture = "2.0.1"
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread", "time"] }
|
|
|
|
[lints]
|
|
workspace = true
|