From b18b08b8221d3ccf9acb8ab194ff9bf4a02f3f00 Mon Sep 17 00:00:00 2001 From: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:57:54 +0200 Subject: [PATCH] feat(runner): Rust updates and improvements (#196) ## Description - Updates to latest Rust 2024 :tada: - Make DataChannel messages ordered on nestri-server side - Bugfixes and code improvements + formatting ## Type of Change - [x] Bug fix (non-breaking change) - [x] New feature (non-breaking change) ## Checklist - [x] I have updated relevant documentation - [x] My code follows the project's coding style - [x] My changes generate no new warnings/errors --------- Co-authored-by: DatCaptainHorse Co-authored-by: Wanjohi --- .github/workflows/runner.yml | 2 + packages/server/Cargo.lock | 1049 +++------------------ packages/server/Cargo.toml | 2 +- packages/server/src/args/encoding_args.rs | 8 +- packages/server/src/enc_helper.rs | 17 +- packages/server/src/main.rs | 43 +- packages/server/src/nestrisink/imp.rs | 23 +- packages/server/src/nestrisink/mod.rs | 6 +- packages/server/src/proto.rs | 2 +- packages/server/src/proto/proto.rs | 68 +- packages/server/src/websocket.rs | 12 +- 11 files changed, 252 insertions(+), 980 deletions(-) diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index a0ea6ec6..47717f69 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -7,6 +7,7 @@ on: paths: - "containers/runner.Containerfile" - "packages/scripts/**" + - "packages/server/**" - ".github/workflows/runner.yml" schedule: - cron: 7 0 * * 1,3,6 # Regularly to keep that build cache warm @@ -16,6 +17,7 @@ on: - "containers/runner.Containerfile" - ".github/workflows/runner.yml" - "packages/scripts/**" + - "packages/server/**" tags: - v*.*.* release: diff --git a/packages/server/Cargo.lock b/packages/server/Cargo.lock index ef2d22d7..eca99bbb 100644 --- a/packages/server/Cargo.lock +++ b/packages/server/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "arc-swap" @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "async-tungstenite" -version = "0.28.2" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c348fb0b6d132c596eca3dcd941df48fb597aafcb07a738ec41c004b087dc99" +checksum = "ef0f7efedeac57d9b26170f72965ecfd31473ca52ca7a64e925b0b6f5f079886" dependencies = [ "atomic-waker", "futures-core", @@ -215,7 +215,7 @@ dependencies = [ "pin-project-lite", "tokio", "tokio-native-tls", - "tungstenite 0.24.0", + "tungstenite 0.26.2", ] [[package]] @@ -236,53 +236,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "aws-config" -version = "1.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc47e70fc35d054c8fcd296d47a61711f043ac80534a10b4f741904f81e73a90" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-sdk-sso", - "aws-sdk-ssooidc", - "aws-sdk-sts", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "fastrand", - "hex", - "http 0.2.12", - "ring", - "time", - "tokio", - "tracing", - "url", - "zeroize", -] - -[[package]] -name = "aws-credential-types" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" -dependencies = [ - "aws-smithy-async", - "aws-smithy-runtime-api", - "aws-smithy-types", - "zeroize", -] - [[package]] name = "aws-lc-rs" -version = "1.12.2" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca" +checksum = "4cd755adf9707cf671e31d944a189be3deaaeee11c8bc1d669bb8022ac90fbd0" dependencies = [ "aws-lc-sys", "paste", @@ -291,9 +249,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b2ddd3ada61a305e1d8bb6c005d1eaa7d14d903681edfc400406d523a9b491" +checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43" dependencies = [ "bindgen", "cc", @@ -303,308 +261,6 @@ dependencies = [ "paste", ] -[[package]] -name = "aws-runtime" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee7643696e7fdd74c10f9eb42848a87fe469d35eae9c3323f80aa98f350baac" -dependencies = [ - "aws-credential-types", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "fastrand", - "http 0.2.12", - "http-body 0.4.6", - "once_cell", - "percent-encoding", - "pin-project-lite", - "tracing", - "uuid", -] - -[[package]] -name = "aws-sdk-kinesisvideo" -version = "1.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4afed12d6a05c1b7a7e21d7de3395968aa6e738a9596fc7dbc8cbbefa76f45" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-kinesisvideosignaling" -version = "1.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266cabc4a43b393a72fd7ed1a346a539d509cb24b0fb59fb6eb8c64cf68a3f2a" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-sso" -version = "1.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54bab121fe1881a74c338c5f723d1592bf3b53167f80268a1274f404e1acc38" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-ssooidc" -version = "1.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c8234fd024f7ac61c4e44ea008029bde934250f371efe7d4a39708397b1080c" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-sts" -version = "1.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba60e1d519d6f23a9df712c04fdeadd7872ac911c84b2f62a8bda92e129b7962" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-query", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sigv4" -version = "1.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "690118821e46967b3c4501d67d7d52dd75106a9c54cf36cefa1985cedbe94e05" -dependencies = [ - "aws-credential-types", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "form_urlencoded", - "hex", - "hmac", - "http 0.2.12", - "http 1.2.0", - "once_cell", - "percent-encoding", - "sha2", - "time", - "tracing", -] - -[[package]] -name = "aws-smithy-async" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa59d1327d8b5053c54bf2eaae63bf629ba9e904434d0835a28ed3c0ed0a614e" -dependencies = [ - "futures-util", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "aws-smithy-http" -version = "0.60.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7809c27ad8da6a6a68c454e651d4962479e81472aa19ae99e59f9aba1f9713cc" -dependencies = [ - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "bytes-utils", - "futures-core", - "http 0.2.12", - "http-body 0.4.6", - "once_cell", - "percent-encoding", - "pin-project-lite", - "pin-utils", - "tracing", -] - -[[package]] -name = "aws-smithy-json" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623a51127f24c30776c8b374295f2df78d92517386f77ba30773f15a30ce1422" -dependencies = [ - "aws-smithy-types", -] - -[[package]] -name = "aws-smithy-query" -version = "0.60.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" -dependencies = [ - "aws-smithy-types", - "urlencoding", -] - -[[package]] -name = "aws-smithy-runtime" -version = "1.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f7050bbc7107a6c98a397a9fcd9413690c27fa718446967cf03b2d3ac517e" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "bytes", - "fastrand", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "http-body 1.0.1", - "httparse", - "hyper", - "hyper-rustls", - "once_cell", - "pin-project-lite", - "pin-utils", - "rustls 0.21.12", - "tokio", - "tracing", -] - -[[package]] -name = "aws-smithy-runtime-api" -version = "1.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92165296a47a812b267b4f41032ff8069ab7ff783696d217f0994a0d7ab585cd" -dependencies = [ - "aws-smithy-async", - "aws-smithy-types", - "bytes", - "http 0.2.12", - "http 1.2.0", - "pin-project-lite", - "tokio", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-smithy-types" -version = "1.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28f6feb647fb5e0d5b50f0472c19a7db9462b74e2fec01bb0b44eedcc834e97" -dependencies = [ - "base64-simd", - "bytes", - "bytes-utils", - "futures-core", - "http 0.2.12", - "http 1.2.0", - "http-body 0.4.6", - "http-body 1.0.1", - "http-body-util", - "itoa", - "num-integer", - "pin-project-lite", - "pin-utils", - "ryu", - "serde", - "time", - "tokio", - "tokio-util", -] - -[[package]] -name = "aws-smithy-xml" -version = "0.60.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0b0166827aa700d3dc519f72f8b3a91c35d0b8d042dc5d643a91e6f80648fc" -dependencies = [ - "xmlparser", -] - -[[package]] -name = "aws-types" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0df5a18c4f951c645300d365fec53a61418bcf4650f604f85fe2a665bfaa0c2" -dependencies = [ - "aws-credential-types", - "aws-smithy-async", - "aws-smithy-runtime-api", - "aws-smithy-types", - "rustc_version", - "tracing", -] - [[package]] name = "backtrace" version = "0.3.74" @@ -638,16 +294,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - [[package]] name = "base64ct" version = "1.6.0" @@ -730,19 +376,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" - -[[package]] -name = "bytes-utils" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" -dependencies = [ - "bytes", - "either", -] +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cbc" @@ -755,9 +391,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.10" +version = "1.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" dependencies = [ "jobserver", "libc", @@ -844,9 +480,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.27" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", @@ -854,9 +490,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", @@ -866,11 +502,11 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -884,9 +520,9 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cmake" -version = "0.1.53" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" dependencies = [ "cc", ] @@ -1013,9 +649,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" [[package]] name = "der" @@ -1132,9 +768,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" @@ -1168,12 +804,6 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "fnv" version = "1.0.7" @@ -1317,10 +947,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -1354,7 +982,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#7728982000b5ceec876560c9ae1011a1e75e52fa" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" dependencies = [ "futures-channel", "futures-core", @@ -1370,7 +998,7 @@ dependencies = [ [[package]] name = "gio-sys" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#7728982000b5ceec876560c9ae1011a1e75e52fa" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" dependencies = [ "glib-sys", "gobject-sys", @@ -1382,7 +1010,7 @@ dependencies = [ [[package]] name = "glib" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#7728982000b5ceec876560c9ae1011a1e75e52fa" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" dependencies = [ "bitflags 2.8.0", "futures-channel", @@ -1402,9 +1030,9 @@ dependencies = [ [[package]] name = "glib-macros" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#7728982000b5ceec876560c9ae1011a1e75e52fa" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro-crate", "proc-macro2", "quote", @@ -1414,7 +1042,7 @@ dependencies = [ [[package]] name = "glib-sys" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#7728982000b5ceec876560c9ae1011a1e75e52fa" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" dependencies = [ "libc", "system-deps", @@ -1429,7 +1057,7 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gobject-sys" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#7728982000b5ceec876560c9ae1011a1e75e52fa" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" dependencies = [ "glib-sys", "libc", @@ -1450,7 +1078,7 @@ dependencies = [ [[package]] name = "gst-plugin-version-helper" version = "0.8.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#5c7ab9b491f3d8be4a74f17a440288c81203e3ce" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" dependencies = [ "chrono", "toml_edit", @@ -1459,22 +1087,13 @@ dependencies = [ [[package]] name = "gst-plugin-webrtc" version = "0.14.0-alpha.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#5c7ab9b491f3d8be4a74f17a440288c81203e3ce" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" dependencies = [ "anyhow", "async-recursion", "async-tungstenite", - "aws-config", - "aws-credential-types", - "aws-sdk-kinesisvideo", - "aws-sdk-kinesisvideosignaling", - "aws-sigv4", - "aws-smithy-http", - "aws-smithy-types", - "aws-types", "chrono", "ctrlc", - "data-encoding", "fastrand", "futures", "gst-plugin-version-helper", @@ -1493,10 +1112,8 @@ dependencies = [ "http 1.2.0", "human_bytes", "itertools 0.14.0", - "livekit-api", - "livekit-protocol", "parse_link_header", - "rand 0.8.5", + "rand 0.9.0", "reqwest", "serde", "serde_json", @@ -1508,7 +1125,6 @@ dependencies = [ "tracing-log", "tracing-subscriber", "url", - "url-escape", "uuid", "warp", ] @@ -1516,7 +1132,7 @@ dependencies = [ [[package]] name = "gst-plugin-webrtc-signalling" version = "0.14.0-alpha.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#5c7ab9b491f3d8be4a74f17a440288c81203e3ce" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" dependencies = [ "anyhow", "async-tungstenite", @@ -1539,7 +1155,7 @@ dependencies = [ [[package]] name = "gst-plugin-webrtc-signalling-protocol" version = "0.14.0-alpha.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#5c7ab9b491f3d8be4a74f17a440288c81203e3ce" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" dependencies = [ "serde", "serde_json", @@ -1548,7 +1164,7 @@ dependencies = [ [[package]] name = "gstreamer" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "cfg-if", "futures-channel", @@ -1574,7 +1190,7 @@ dependencies = [ [[package]] name = "gstreamer-app" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "futures-core", "futures-sink", @@ -1588,7 +1204,7 @@ dependencies = [ [[package]] name = "gstreamer-app-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gstreamer-base-sys", @@ -1600,7 +1216,7 @@ dependencies = [ [[package]] name = "gstreamer-audio" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "cfg-if", "glib", @@ -1615,7 +1231,7 @@ dependencies = [ [[package]] name = "gstreamer-audio-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gobject-sys", @@ -1628,7 +1244,7 @@ dependencies = [ [[package]] name = "gstreamer-base" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "atomic_refcell", "cfg-if", @@ -1641,7 +1257,7 @@ dependencies = [ [[package]] name = "gstreamer-base-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gobject-sys", @@ -1653,7 +1269,7 @@ dependencies = [ [[package]] name = "gstreamer-net" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "gio", "glib", @@ -1664,7 +1280,7 @@ dependencies = [ [[package]] name = "gstreamer-net-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "gio-sys", "glib-sys", @@ -1676,7 +1292,7 @@ dependencies = [ [[package]] name = "gstreamer-rtp" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib", "gstreamer", @@ -1687,7 +1303,7 @@ dependencies = [ [[package]] name = "gstreamer-rtp-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gstreamer-base-sys", @@ -1699,7 +1315,7 @@ dependencies = [ [[package]] name = "gstreamer-sdp" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib", "gstreamer", @@ -1709,7 +1325,7 @@ dependencies = [ [[package]] name = "gstreamer-sdp-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gstreamer-sys", @@ -1720,7 +1336,7 @@ dependencies = [ [[package]] name = "gstreamer-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "cfg-if", "glib-sys", @@ -1732,7 +1348,7 @@ dependencies = [ [[package]] name = "gstreamer-utils" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "gstreamer", "gstreamer-app", @@ -1743,7 +1359,7 @@ dependencies = [ [[package]] name = "gstreamer-video" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "cfg-if", "futures-channel", @@ -1759,7 +1375,7 @@ dependencies = [ [[package]] name = "gstreamer-video-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gobject-sys", @@ -1772,7 +1388,7 @@ dependencies = [ [[package]] name = "gstreamer-webrtc" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib", "gstreamer", @@ -1784,7 +1400,7 @@ dependencies = [ [[package]] name = "gstreamer-webrtc-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#dee089ab4f2bb28d1e21accd7c5388beaf67e658" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" dependencies = [ "glib-sys", "gstreamer-sdp-sys", @@ -1842,12 +1458,6 @@ dependencies = [ "http 0.2.12", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1920,29 +1530,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http 1.2.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http 1.2.0", - "http-body 1.0.1", - "pin-project-lite", -] - [[package]] name = "httparse" version = "1.10.0" @@ -1973,7 +1560,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body 0.4.6", + "http-body", "httparse", "httpdate", "itoa", @@ -1985,22 +1572,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper", - "log", - "rustls 0.21.12", - "rustls-native-certs", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -2188,9 +1759,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ "block-padding", "generic-array", @@ -2228,15 +1799,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -2246,15 +1808,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -2289,19 +1842,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "9.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" -dependencies = [ - "base64 0.21.7", - "js-sys", - "ring", - "serde", - "serde_json", -] - [[package]] name = "kstring" version = "2.0.2" @@ -2351,45 +1891,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" -[[package]] -name = "livekit-api" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e20c3fc3de5944ce6b5c8da4084cf828bbae7216671e32e83b767ce61feeb7e0" -dependencies = [ - "futures-util", - "jsonwebtoken", - "livekit-protocol", - "log", - "parking_lot", - "prost 0.12.6", - "reqwest", - "scopeguard", - "serde", - "sha2", - "thiserror 1.0.69", - "tokio", - "tokio-tungstenite 0.20.1", - "url", -] - -[[package]] -name = "livekit-protocol" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a1bd23257110be29d024d8d816adff70df18ea1d22ceb1aab6f3ad4aab0d523" -dependencies = [ - "futures-util", - "parking_lot", - "pbjson", - "pbjson-types", - "prost 0.12.6", - "prost-types 0.12.6", - "serde", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -2402,9 +1903,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "matchers" @@ -2464,9 +1965,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -2506,17 +2007,11 @@ dependencies = [ "version_check", ] -[[package]] -name = "multimap" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - [[package]] name = "native-tls" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -2542,15 +2037,15 @@ dependencies = [ "log", "num-derive", "num-traits", - "prost 0.13.4", - "prost-types 0.13.4", + "prost", + "prost-types", "rand 0.9.0", "regex", - "rustls 0.23.22", + "rustls 0.23.23", "serde", "serde_json", "tokio", - "tokio-tungstenite 0.26.1", + "tokio-tungstenite 0.26.2", "webrtc", ] @@ -2675,9 +2170,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "opaque-debug" @@ -2738,12 +2233,6 @@ dependencies = [ "paste", ] -[[package]] -name = "outref" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" - [[package]] name = "overload" version = "0.1.1" @@ -2764,9 +2253,9 @@ dependencies = [ [[package]] name = "p384" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" dependencies = [ "ecdsa", "elliptic-curve", @@ -2815,48 +2304,11 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pbjson" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" -dependencies = [ - "base64 0.21.7", - "serde", -] - -[[package]] -name = "pbjson-build" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" -dependencies = [ - "heck 0.4.1", - "itertools 0.11.0", - "prost 0.12.6", - "prost-types 0.12.6", -] - -[[package]] -name = "pbjson-types" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" -dependencies = [ - "bytes", - "chrono", - "pbjson", - "pbjson-build", - "prost 0.12.6", - "prost-build", - "serde", -] - [[package]] name = "pem" -version = "3.0.4" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" dependencies = [ "base64 0.22.1", "serde", @@ -2877,30 +2329,20 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap", -] - [[package]] name = "pin-project" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" dependencies = [ "proc-macro2", "quote", @@ -3007,66 +2449,22 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" -dependencies = [ - "bytes", - "prost-derive 0.13.4", -] - -[[package]] -name = "prost-build" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" -dependencies = [ - "bytes", - "heck 0.5.0", - "itertools 0.12.1", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost 0.12.6", - "prost-types 0.12.6", - "regex", - "syn", - "tempfile", + "prost-derive", ] [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "prost-derive" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" -dependencies = [ - "anyhow", - "itertools 0.13.0", + "itertools 0.14.0", "proc-macro2", "quote", "syn", @@ -3074,20 +2472,11 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ - "prost 0.12.6", -] - -[[package]] -name = "prost-types" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" -dependencies = [ - "prost 0.13.4", + "prost", ] [[package]] @@ -3117,8 +2506,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.0", - "zerocopy 0.8.14", + "rand_core 0.9.2", + "zerocopy 0.8.20", ] [[package]] @@ -3138,7 +2527,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.0", + "rand_core 0.9.2", ] [[package]] @@ -3152,12 +2541,12 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.14", + "zerocopy 0.8.20", ] [[package]] @@ -3176,9 +2565,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ "bitflags 2.8.0", ] @@ -3215,12 +2604,6 @@ dependencies = [ "regex-syntax 0.8.5", ] -[[package]] -name = "regex-lite" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" - [[package]] name = "regex-syntax" version = "0.6.29" @@ -3246,7 +2629,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body 0.4.6", + "http-body", "hyper", "hyper-tls", "ipnet", @@ -3285,15 +2668,14 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" dependencies = [ "cc", "cfg-if", "getrandom 0.2.15", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] @@ -3367,18 +2749,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.22.4" @@ -3388,39 +2758,27 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.22" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework", -] - [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3445,16 +2803,6 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustls-webpki" version = "0.102.8" @@ -3500,16 +2848,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sdp" version = "0.7.0" @@ -3567,9 +2905,9 @@ checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] @@ -3585,9 +2923,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", @@ -3596,9 +2934,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", @@ -3694,9 +3032,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "smol_str" @@ -3787,9 +3125,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -3841,7 +3179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" dependencies = [ "cfg-expr", - "heck 0.5.0", + "heck", "pkg-config", "toml", "version-compare", @@ -3855,9 +3193,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.16.0" +version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ "cfg-if", "fastrand", @@ -4018,16 +3356,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.25.0" @@ -4050,20 +3378,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "native-tls", - "tokio", - "tokio-native-tls", - "tungstenite 0.20.1", -] - [[package]] name = "tokio-tungstenite" version = "0.21.0" @@ -4078,16 +3392,16 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" +checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" dependencies = [ "futures-util", "log", "native-tls", "tokio", "tokio-native-tls", - "tungstenite 0.26.1", + "tungstenite 0.26.2", ] [[package]] @@ -4105,9 +3419,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -4126,9 +3440,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.23" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", @@ -4211,26 +3525,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 0.2.12", - "httparse", - "log", - "native-tls", - "rand 0.8.5", - "sha1", - "thiserror 1.0.69", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.21.0" @@ -4252,40 +3546,20 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.24.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" dependencies = [ - "byteorder", "bytes", "data-encoding", "http 1.2.0", "httparse", "log", "native-tls", - "rand 0.8.5", - "sha1", - "thiserror 1.0.69", - "url", - "utf-8", -] - -[[package]] -name = "tungstenite" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.2.0", - "httparse", - "log", - "native-tls", - "rand 0.8.5", + "rand 0.9.0", "sha1", "thiserror 2.0.11", + "url", "utf-8", ] @@ -4312,9 +3586,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicase" @@ -4324,9 +3598,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "universal-hash" @@ -4355,21 +3629,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "url-escape" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e0ce4d1246d075ca5abec4b41d33e87a6054d08e2366b63205665e950db218" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf-8" version = "0.7.6" @@ -4396,11 +3655,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.12.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" +checksum = "93d59ca99a559661b96bf898d8fce28ed87935fd2bea9f05983c1464dd6c71b1" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.3.1", ] [[package]] @@ -4427,12 +3686,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "vsimd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" - [[package]] name = "waitgroup" version = "0.1.2" @@ -4475,7 +3728,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls", "tokio-tungstenite 0.21.0", "tokio-util", "tower-service", @@ -4599,7 +3852,7 @@ dependencies = [ "ring", "rtcp", "rtp", - "rustls 0.23.22", + "rustls 0.23.23", "sdp", "serde", "serde_json", @@ -4661,7 +3914,7 @@ dependencies = [ "rand_core 0.6.4", "rcgen", "ring", - "rustls 0.23.22", + "rustls 0.23.23", "sec1", "serde", "sha1", @@ -4980,9 +4233,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] @@ -5048,12 +4301,6 @@ dependencies = [ "time", ] -[[package]] -name = "xmlparser" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" - [[package]] name = "yasna" version = "0.5.2" @@ -5099,11 +4346,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.20", ] [[package]] @@ -5119,9 +4366,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" dependencies = [ "proc-macro2", "quote", diff --git a/packages/server/Cargo.toml b/packages/server/Cargo.toml index 33ab5b49..1931a183 100644 --- a/packages/server/Cargo.toml +++ b/packages/server/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "nestri-server" version = "0.1.0-alpha.2" -edition = "2021" +edition = "2024" [[bin]] name = "nestri-server" diff --git a/packages/server/src/args/encoding_args.rs b/packages/server/src/args/encoding_args.rs index 02b61a9a..1800e0ef 100644 --- a/packages/server/src/args/encoding_args.rs +++ b/packages/server/src/args/encoding_args.rs @@ -1,24 +1,24 @@ use std::ops::Deref; -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Clone)] pub struct RateControlCQP { /// Constant Quantization Parameter (CQP) quality level pub quality: u32, } -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Clone)] pub struct RateControlVBR { /// Target bitrate in kbps pub target_bitrate: i32, /// Maximum bitrate in kbps pub max_bitrate: i32, } -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Clone)] pub struct RateControlCBR { /// Target bitrate in kbps pub target_bitrate: i32, } -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum RateControl { /// Constant Quantization Parameter CQP(RateControlCQP), diff --git a/packages/server/src/enc_helper.rs b/packages/server/src/enc_helper.rs index 27642619..98bb307d 100644 --- a/packages/server/src/enc_helper.rs +++ b/packages/server/src/enc_helper.rs @@ -1,4 +1,5 @@ -use crate::gpu::{self, get_gpu_by_card_path, get_gpus_by_vendor, GPUInfo}; +use crate::args::encoding_args::RateControl; +use crate::gpu::{self, GPUInfo, get_gpu_by_card_path, get_gpus_by_vendor}; use gst::prelude::*; #[derive(Debug, Eq, PartialEq, Clone)] @@ -245,7 +246,10 @@ pub fn encoder_gop_params(encoder: &VideoEncoderInfo, gop_size: u32) -> VideoEnc }) } -pub fn encoder_low_latency_params(encoder: &VideoEncoderInfo) -> VideoEncoderInfo { +pub fn encoder_low_latency_params( + encoder: &VideoEncoderInfo, + rate_control: &RateControl, +) -> VideoEncoderInfo { let mut encoder_optz = encoder_gop_params(encoder, 30); match encoder_optz.encoder_api { @@ -283,13 +287,8 @@ pub fn encoder_low_latency_params(encoder: &VideoEncoderInfo) -> VideoEncoderInf encoder_optz.set_parameter("tune", "zerolatency"); } "svtav1enc" => { - encoder_optz.set_parameter("preset", "12"); - let suffix = if encoder_optz.get_parameters_string().contains("cbr") { - ":pred-struct=1" - } else { - "" - }; - encoder_optz.set_parameter("parameters-string", &format!("lookahead=0{}", suffix)); + encoder_optz.set_parameter("preset", "11"); + encoder_optz.set_parameter("parameters-string", "lookahead=0"); } "av1enc" => { encoder_optz.set_parameter("usage-profile", "realtime"); diff --git a/packages/server/src/main.rs b/packages/server/src/main.rs index cdcd5822..4519ccaa 100644 --- a/packages/server/src/main.rs +++ b/packages/server/src/main.rs @@ -4,13 +4,13 @@ mod gpu; mod latency; mod messages; mod nestrisink; -mod websocket; mod proto; +mod websocket; use crate::args::encoding_args; +use crate::gpu::GPUVendor; use crate::nestrisink::NestriSignaller; use crate::websocket::NestriWebSocket; -use crate::gpu::GPUVendor; use futures_util::StreamExt; use gst::prelude::*; use gstrswebrtc::signaller::Signallable; @@ -55,12 +55,19 @@ fn handle_gpus(args: &args::Args) -> Option { gpu = filtered_gpus.get(args.device.gpu_index as usize).cloned(); } else { // get first GPU - gpu = filtered_gpus.into_iter().find(|g| *g.vendor() != GPUVendor::UNKNOWN); + gpu = filtered_gpus + .into_iter() + .find(|g| *g.vendor() != GPUVendor::UNKNOWN); } } if gpu.is_none() { - println!("No GPU found with the specified parameters: vendor='{}', name='{}', index='{}', card_path='{}'", - args.device.gpu_vendor, args.device.gpu_name, args.device.gpu_index, args.device.gpu_card_path); + println!( + "No GPU found with the specified parameters: vendor='{}', name='{}', index='{}', card_path='{}'", + args.device.gpu_vendor, + args.device.gpu_name, + args.device.gpu_index, + args.device.gpu_card_path + ); return None; } let gpu = gpu.unwrap(); @@ -83,7 +90,11 @@ fn handle_encoder_video(args: &args::Args) -> Option Option enc_helper::VideoEncoderInfo { - let mut optimized_encoder = enc_helper::encoder_low_latency_params(&video_encoder); + let mut optimized_encoder = + enc_helper::encoder_low_latency_params(&video_encoder, &args.encoding.video.rate_control); // Handle rate-control method match &args.encoding.video.rate_control { encoding_args::RateControl::CQP(cqp) => { @@ -240,14 +256,14 @@ async fn main() -> Result<(), Box> { &match &args.encoding.audio.rate_control { encoding_args::RateControl::CBR(cbr) => cbr.target_bitrate * 1000i32, encoding_args::RateControl::VBR(vbr) => vbr.target_bitrate * 1000i32, - _ => 128i32, + _ => 128000i32, }, ); /* Video */ // Video Source Element let video_source = gst::ElementFactory::make("waylanddisplaysrc").build()?; - video_source.set_property("render-node", &gpu.render_path()); + video_source.set_property_from_str("render-node", gpu.render_path()); // Caps Filter Element (resolution, fps) let caps_filter = gst::ElementFactory::make("capsfilter").build()?; @@ -289,6 +305,7 @@ async fn main() -> Result<(), Box> { let webrtcsink = BaseWebRTCSink::with_signaller(Signallable::from(signaller.clone())); webrtcsink.set_property_from_str("stun-server", "stun://stun.l.google.com:19302"); webrtcsink.set_property_from_str("congestion-control", "disabled"); + webrtcsink.set_property("do-retransmission", false); // Add elements to the pipeline pipeline.add_many(&[ @@ -343,7 +360,9 @@ async fn main() -> Result<(), Box> { } // Optimize latency of pipeline - video_source.sync_state_with_parent().expect("failed to sync with parent"); + video_source + .sync_state_with_parent() + .expect("failed to sync with parent"); video_source.set_property("do-timestamp", &true); audio_source.set_property("do-timestamp", &true); pipeline.set_property("latency", &0u64); diff --git a/packages/server/src/nestrisink/imp.rs b/packages/server/src/nestrisink/imp.rs index 71a195e9..1510d64b 100644 --- a/packages/server/src/nestrisink/imp.rs +++ b/packages/server/src/nestrisink/imp.rs @@ -1,6 +1,6 @@ use crate::messages::{ - decode_message_as, encode_message, AnswerType, JoinerType, MessageAnswer, MessageBase, - MessageICE, MessageJoin, MessageSDP, + AnswerType, JoinerType, MessageAnswer, MessageBase, MessageICE, MessageJoin, MessageSDP, + decode_message_as, encode_message, }; use crate::proto::proto::proto_input::InputType::{ KeyDown, KeyUp, MouseKeyDown, MouseKeyUp, MouseMove, MouseMoveAbs, MouseWheel, @@ -10,7 +10,7 @@ use crate::websocket::NestriWebSocket; use glib::subclass::prelude::*; use gst::glib; use gst::prelude::*; -use gst_webrtc::{gst_sdp, WebRTCSDPType, WebRTCSessionDescription}; +use gst_webrtc::{WebRTCSDPType, WebRTCSessionDescription, gst_sdp}; use gstrswebrtc::signaller::{Signallable, SignallableImpl}; use prost::Message; use std::collections::HashSet; @@ -144,8 +144,9 @@ impl Signaller { &[ &"nestri-data-channel", &gst::Structure::builder("config") - .field("ordered", &false) + .field("ordered", &true) .field("max-retransmits", &0u32) + .field("priority", "high") .build(), ], ), @@ -337,12 +338,14 @@ impl ObjectSubclass for Signaller { impl ObjectImpl for Signaller { fn properties() -> &'static [glib::ParamSpec] { static PROPS: LazyLock> = LazyLock::new(|| { - vec![glib::ParamSpecBoolean::builder("manual-sdp-munging") - .nick("Manual SDP munging") - .blurb("Whether the signaller manages SDP munging itself") - .default_value(false) - .read_only() - .build()] + vec![ + glib::ParamSpecBoolean::builder("manual-sdp-munging") + .nick("Manual SDP munging") + .blurb("Whether the signaller manages SDP munging itself") + .default_value(false) + .read_only() + .build(), + ] }); PROPS.as_ref() diff --git a/packages/server/src/nestrisink/mod.rs b/packages/server/src/nestrisink/mod.rs index f182a15f..62958bff 100644 --- a/packages/server/src/nestrisink/mod.rs +++ b/packages/server/src/nestrisink/mod.rs @@ -1,8 +1,8 @@ -use std::sync::Arc; +use crate::websocket::NestriWebSocket; use gst::glib; use gst::subclass::prelude::*; use gstrswebrtc::signaller::Signallable; -use crate::websocket::NestriWebSocket; +use std::sync::Arc; mod imp; @@ -22,4 +22,4 @@ impl Default for NestriSignaller { fn default() -> Self { panic!("Cannot create NestriSignaller without NestriWebSocket"); } -} \ No newline at end of file +} diff --git a/packages/server/src/proto.rs b/packages/server/src/proto.rs index 3e1772e2..febacec6 100644 --- a/packages/server/src/proto.rs +++ b/packages/server/src/proto.rs @@ -1 +1 @@ -pub mod proto; \ No newline at end of file +pub mod proto; diff --git a/packages/server/src/proto/proto.rs b/packages/server/src/proto/proto.rs index 3c1e3d56..5c070b86 100644 --- a/packages/server/src/proto/proto.rs +++ b/packages/server/src/proto/proto.rs @@ -3,17 +3,17 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoTimestampEntry { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub stage: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub time: ::core::option::Option<::prost_types::Timestamp>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoLatencyTracker { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub sequence_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag="2")] + #[prost(message, repeated, tag = "2")] pub timestamps: ::prost::alloc::vec::Vec, } /// MouseMove message @@ -21,11 +21,11 @@ pub struct ProtoLatencyTracker { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseMove { /// Fixed value "MouseMove" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub x: i32, - #[prost(int32, tag="3")] + #[prost(int32, tag = "3")] pub y: i32, } /// MouseMoveAbs message @@ -33,11 +33,11 @@ pub struct ProtoMouseMove { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseMoveAbs { /// Fixed value "MouseMoveAbs" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub x: i32, - #[prost(int32, tag="3")] + #[prost(int32, tag = "3")] pub y: i32, } /// MouseWheel message @@ -45,11 +45,11 @@ pub struct ProtoMouseMoveAbs { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseWheel { /// Fixed value "MouseWheel" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub x: i32, - #[prost(int32, tag="3")] + #[prost(int32, tag = "3")] pub y: i32, } /// MouseKeyDown message @@ -57,9 +57,9 @@ pub struct ProtoMouseWheel { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseKeyDown { /// Fixed value "MouseKeyDown" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub key: i32, } /// MouseKeyUp message @@ -67,9 +67,9 @@ pub struct ProtoMouseKeyDown { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseKeyUp { /// Fixed value "MouseKeyUp" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub key: i32, } /// KeyDown message @@ -77,9 +77,9 @@ pub struct ProtoMouseKeyUp { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoKeyDown { /// Fixed value "KeyDown" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub key: i32, } /// KeyUp message @@ -87,53 +87,53 @@ pub struct ProtoKeyDown { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoKeyUp { /// Fixed value "KeyUp" - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag="2")] + #[prost(int32, tag = "2")] pub key: i32, } /// Union of all Input types #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoInput { - #[prost(oneof="proto_input::InputType", tags="1, 2, 3, 4, 5, 6, 7")] + #[prost(oneof = "proto_input::InputType", tags = "1, 2, 3, 4, 5, 6, 7")] pub input_type: ::core::option::Option, } /// Nested message and enum types in `ProtoInput`. pub mod proto_input { #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum InputType { - #[prost(message, tag="1")] + #[prost(message, tag = "1")] MouseMove(super::ProtoMouseMove), - #[prost(message, tag="2")] + #[prost(message, tag = "2")] MouseMoveAbs(super::ProtoMouseMoveAbs), - #[prost(message, tag="3")] + #[prost(message, tag = "3")] MouseWheel(super::ProtoMouseWheel), - #[prost(message, tag="4")] + #[prost(message, tag = "4")] MouseKeyDown(super::ProtoMouseKeyDown), - #[prost(message, tag="5")] + #[prost(message, tag = "5")] MouseKeyUp(super::ProtoMouseKeyUp), - #[prost(message, tag="6")] + #[prost(message, tag = "6")] KeyDown(super::ProtoKeyDown), - #[prost(message, tag="7")] + #[prost(message, tag = "7")] KeyUp(super::ProtoKeyUp), } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMessageBase { - #[prost(string, tag="1")] + #[prost(string, tag = "1")] pub payload_type: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub latency: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMessageInput { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub message_base: ::core::option::Option, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub data: ::core::option::Option, } // @@protoc_insertion_point(module) diff --git a/packages/server/src/websocket.rs b/packages/server/src/websocket.rs index e98d47a4..391eed0c 100644 --- a/packages/server/src/websocket.rs +++ b/packages/server/src/websocket.rs @@ -1,17 +1,17 @@ -use crate::messages::{decode_message, encode_message, MessageBase, MessageLog}; +use crate::messages::{MessageBase, MessageLog, decode_message, encode_message}; +use futures_util::StreamExt; use futures_util::sink::SinkExt; use futures_util::stream::{SplitSink, SplitStream}; -use futures_util::StreamExt; use log::{Level, Log, Metadata, Record}; use std::collections::HashMap; use std::error::Error; use std::sync::{Arc, RwLock}; use std::time::Duration; use tokio::net::TcpStream; -use tokio::sync::{mpsc, Mutex, Notify}; +use tokio::sync::{Mutex, Notify, mpsc}; use tokio::time::sleep; use tokio_tungstenite::tungstenite::{Message, Utf8Bytes}; -use tokio_tungstenite::{connect_async, MaybeTlsStream, WebSocketStream}; +use tokio_tungstenite::{MaybeTlsStream, WebSocketStream, connect_async}; type Callback = Box; type WSRead = SplitStream>>; @@ -95,7 +95,9 @@ impl NestriWebSocket { while let Some(message_result) = ws_read.next().await { match message_result { Ok(message) => { - let data = message.into_text().expect("failed to turn message into text"); + let data = message + .into_text() + .expect("failed to turn message into text"); let base_message = match decode_message(data.to_string()) { Ok(base_message) => base_message, Err(e) => {