M7/M8 (part 1): tsc-media frames, conversion and video codecs

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
This commit is contained in:
Claude committed 2026-09-25 19:53:13 +00:00
1 parent 81ecb53100
commit cc4cb52011
14 files changed
+2923 -1

No files matched your search

Generated
+311 -1
View File
@@ -289,6 +289,16 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
[[package]]
name = "annotate-snippets"
version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4"
dependencies = [
"anstyle",
"unicode-width",
]
[[package]]
name = "annotate-snippets"
version = "0.12.16"
@@ -424,6 +434,21 @@ dependencies = [
"libloading",
]
[[package]]
name = "ashpd"
version = "0.13.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb8421aaa9644a5faf26735f258b669b15f063313ef8f8e2bdb28912a1a6f111"
dependencies = [
"enumflags2",
"futures-util",
"getrandom 0.4.3",
"serde",
"serde_repr",
"tokio",
"zbus",
]
[[package]]
name = "asn1-rs"
version = "0.7.2"
@@ -676,6 +701,19 @@ version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]]
name = "av-data"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fca67ba5d317924c02180c576157afd54babe48a76ebc66ce6d34bb8ba08308e"
dependencies = [
"byte-slice-cast",
"bytes",
"num-derive",
"num-rational",
"num-traits",
]
[[package]]
name = "aws-lc-rs"
version = "1.18.1"
@@ -818,6 +856,7 @@ version = "0.72.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
dependencies = [
"annotate-snippets 0.11.5",
"bitflags 2.13.2",
"cexpr",
"clang-sys",
@@ -971,6 +1010,12 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06"
[[package]]
name = "byte-slice-cast"
version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d"
[[package]]
name = "bytemuck"
version = "1.25.2"
@@ -1009,6 +1054,15 @@ version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]]
name = "bzip2"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c"
dependencies = [
"libbz2-rs-sys",
]
[[package]]
name = "calloop"
version = "0.13.0"
@@ -1096,6 +1150,16 @@ dependencies = [
"nom 7.1.3",
]
[[package]]
name = "cfg-expr"
version = "0.20.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe4ece8474b5f766c63426647e7b4b316b67431ade1036a8313cee24a03ae917"
dependencies = [
"smallvec",
"target-lexicon",
]
[[package]]
name = "cfg-if"
version = "1.0.5"
@@ -1369,6 +1433,12 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "cookie-factory"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2"
[[package]]
name = "core-foundation"
version = "0.9.4"
@@ -1802,6 +1872,28 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"
[[package]]
name = "dav1d"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ee89cb860616069c67520dcd66cacdb900b57c799f634a0eb6d91f6e2a82b61"
dependencies = [
"av-data",
"bitflags 2.13.2",
"dav1d-sys",
"static_assertions",
]
[[package]]
name = "dav1d-sys"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3c91aea6668645415331133ed6f8ddf0e7f40160cd97a12d59e68716a58704b"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "dbl"
version = "0.3.2"
@@ -3438,7 +3530,7 @@ version = "1.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f55d48ebef05e2bf09ba5a1fc67bcb11033b9e12a2a50ed3105c7d25e2b539d0"
dependencies = [
"annotate-snippets",
"annotate-snippets 0.12.16",
"by_address",
"data-url",
"derive_more",
@@ -4169,6 +4261,12 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libbz2-rs-sys"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34b357333733e8260735ba5894eb928c02ecc69c78715f01a8019e7fa7f2db4c"
[[package]]
name = "libc"
version = "0.2.189"
@@ -4234,6 +4332,33 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "libspa"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "882f7427e7989dcc9d388b7f05c4630390a1d7696f9ffa469cd4a7a48f0b4c40"
dependencies = [
"bitflags 2.13.2",
"cc",
"cookie-factory",
"libc",
"libspa-sys",
"nom 8.0.0",
"rustix 1.1.5",
"system-deps",
]
[[package]]
name = "libspa-sys"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b6e17bdaf63ed0d5e4144022624032b41fd9733112e8c74ac26fc9bf1291924"
dependencies = [
"bindgen",
"cc",
"system-deps",
]
[[package]]
name = "libsqlite3-sys"
version = "0.38.2"
@@ -4255,6 +4380,16 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "libvpx-native-sys"
version = "5.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "296dc47df55b51ac871fac5f30a61dd3c3ea3f56a076498a6785f5e6f2f6ea75"
dependencies = [
"pkg-config",
"semver-parser",
]
[[package]]
name = "linebender_resource_handle"
version = "0.1.1"
@@ -5177,6 +5312,26 @@ version = "11.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
[[package]]
name = "openh264"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc9071a0b5f9c501ddd01066c2600d922cc799dc450a52975222bcda7755a08"
dependencies = [
"openh264-sys2",
"wide",
]
[[package]]
name = "openh264-sys2"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ada29a4cadc13d4d326737af87c13e224210d7d99fe47594e9f3f9b0102fd70"
dependencies = [
"libloading",
"sha2 0.10.9",
]
[[package]]
name = "openssl-probe"
version = "0.2.1"
@@ -5441,6 +5596,16 @@ version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "pest"
version = "2.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45d3aca230fad2e6f6317ca0a72724338c4960cb97168a85cdee66df4a9a21a8"
dependencies = [
"memchr",
"ucd-trie",
]
[[package]]
name = "petgraph"
version = "0.8.3"
@@ -5560,6 +5725,31 @@ dependencies = [
"futures-io",
]
[[package]]
name = "pipewire"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bde71084c4e25959d68f1ea54daa75e5ecdb338e5caf0b5510143b79baa32d5c"
dependencies = [
"bitflags 2.13.2",
"libc",
"libspa",
"libspa-sys",
"pipewire-sys",
"rustix 1.1.5",
]
[[package]]
name = "pipewire-sys"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce653f53e63e5b93853218092ee9a8906a5d082c92f3f1db26316955dd63ce0"
dependencies = [
"bindgen",
"libspa-sys",
"system-deps",
]
[[package]]
name = "pkcs1"
version = "0.8.0-rc.4"
@@ -6718,6 +6908,15 @@ version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
[[package]]
name = "safe_arch"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42c6efa15875e6ecb39ca61fb0b0c1a40b84fac5a5ffe71eef7d1000c8eb3f5f"
dependencies = [
"bytemuck",
]
[[package]]
name = "salsa20"
version = "0.11.0"
@@ -6886,6 +7085,15 @@ version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
[[package]]
name = "semver-parser"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2"
dependencies = [
"pest",
]
[[package]]
name = "serde"
version = "1.0.229"
@@ -7699,6 +7907,19 @@ dependencies = [
"libc",
]
[[package]]
name = "system-deps"
version = "7.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7"
dependencies = [
"cfg-expr",
"heck",
"pkg-config",
"toml",
"version-compare",
]
[[package]]
name = "t4rust-derive"
version = "0.3.1"
@@ -7740,6 +7961,12 @@ dependencies = [
"xattr",
]
[[package]]
name = "target-lexicon"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
[[package]]
name = "task-local"
version = "0.1.1"
@@ -7952,6 +8179,7 @@ dependencies = [
"signal-hook-registry",
"socket2",
"tokio-macros",
"tracing",
"windows-sys 0.61.2",
]
@@ -8310,6 +8538,30 @@ dependencies = [
"tsproto-types",
]
[[package]]
name = "tsc-media"
version = "0.1.0"
dependencies = [
"ashpd",
"bzip2",
"dav1d",
"libvpx-native-sys",
"memmap2",
"openh264",
"pipewire",
"reqwest",
"rustix 1.1.5",
"sha2 0.10.9",
"str0m",
"thiserror 2.0.21",
"tokio",
"tracing",
"wasapi",
"windows-capture",
"x11rb",
"yuv",
]
[[package]]
name = "tsc-model"
version = "0.1.0"
@@ -8590,6 +8842,12 @@ version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
[[package]]
name = "ucd-trie"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
[[package]]
name = "udev"
version = "0.9.3"
@@ -8771,6 +9029,12 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "version-compare"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e"
[[package]]
name = "version_check"
version = "0.9.5"
@@ -8830,6 +9094,19 @@ dependencies = [
"try-lock",
]
[[package]]
name = "wasapi"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee144c215d8d31e94c1a599fbaf540ca82a7017e4f1786816b179f334fac751d"
dependencies = [
"log",
"num-integer",
"thiserror 2.0.21",
"windows",
"windows-core",
]
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
@@ -9207,6 +9484,16 @@ dependencies = [
"static_assertions",
]
[[package]]
name = "wide"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d920ac99c3c8edce110cb8d07dbb324d6d026011dce85b1e9355b70f0adacc4f"
dependencies = [
"bytemuck",
"safe_arch",
]
[[package]]
name = "widestring"
version = "1.2.1"
@@ -9265,6 +9552,19 @@ dependencies = [
"windows-numerics",
]
[[package]]
name = "windows-capture"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09046acbe9b6d039cde50e8c8178d95bb0f9b33ed7feccc4465dadc5404b31b4"
dependencies = [
"parking_lot",
"rayon",
"thiserror 2.0.21",
"windows",
"windows-future",
]
[[package]]
name = "windows-collections"
version = "0.3.2"
@@ -9820,6 +10120,15 @@ dependencies = [
"synstructure 0.14.0",
]
[[package]]
name = "yuv"
version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a295923535c00a4e72a50a0a1130097f93160b39892dd4d2d006b1e2b90d6bf9"
dependencies = [
"num-traits",
]
[[package]]
name = "zbus"
version = "5.19.0"
@@ -9845,6 +10154,7 @@ dependencies = [
"rustix 1.1.5",
"serde",
"serde_repr",
"tokio",
"tracing",
"uds_windows",
"uuid",