Skip to content

Commit 1d389f5

Browse files
kixelateddependabot[bot]claude
authored
build(deps): bump the cargo group (with code fixes for rand/rubato/rcgen) (#1603)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 796181c commit 1d389f5

14 files changed

Lines changed: 235 additions & 304 deletions

File tree

Cargo.lock

Lines changed: 183 additions & 275 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ moq-mux = { version = "0.5", path = "rs/moq-mux" }
5252
moq-native = { version = "0.16", path = "rs/moq-native", default-features = false }
5353
moq-net = { version = "0.1", path = "rs/moq-net" }
5454
moq-token = { version = "0.6", path = "rs/moq-token" }
55-
qmux = { version = "0.0.7", default-features = false }
55+
qmux = { version = "0.0.8", default-features = false }
5656

5757
serde = { version = "1", features = ["derive"] }
5858
tokio = "1.48"
5959
web-async = { version = "0.1.3", features = ["tracing"] }
6060
web-transport-iroh = "0.5"
61-
web-transport-noq = "0.0.3"
61+
web-transport-noq = "0.1.1"
6262
web-transport-proto = "0.6"
63-
web-transport-quiche = "0.2"
63+
web-transport-quiche = "0.4"
6464
web-transport-quinn = "0.11"
6565
web-transport-trait = "0.3.4"
6666

rs/moq-audio/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ bytes = "1"
2020
hang = { workspace = true }
2121
moq-mux = { workspace = true }
2222
moq-net = { workspace = true }
23-
rubato = "0.16"
23+
# We only use the sinc resampler (Async::new_sinc), so skip the default
24+
# fft_resampler feature and its RustFFT/realfft dependencies.
25+
rubato = { version = "3.0", default-features = false }
2426
thiserror = "2"
2527
# Pure-Rust transpilation of libopus 1.3.1. No CMake toolchain, no C
2628
# linker hackery, and crucially still maintained, unlike the

rs/moq-audio/src/resample.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44
//! producer/consumer doesn't have to convert to planar on every call.
55
//! Currently sample-rate only; channel up/downmix is rejected upstream.
66
7+
use rubato::audioadapter_buffers::direct::SequentialSliceOfVecs;
78
use rubato::{
8-
Resampler as RubatoTrait, SincFixedIn, SincInterpolationParameters, SincInterpolationType, WindowFunction,
9+
Async, FixedAsync, Resampler as RubatoTrait, SincInterpolationParameters, SincInterpolationType, WindowFunction,
910
};
1011

1112
use crate::AudioError;
1213

1314
/// Sample-rate converter over interleaved `f32` PCM.
1415
pub struct Resampler {
15-
resampler: SincFixedIn<f32>,
16+
resampler: Async<f32>,
1617
chunk_frames: usize,
1718
channels: usize,
1819
input_planar: Vec<Vec<f32>>,
1920
output_planar: Vec<Vec<f32>>,
21+
output_frames_max: usize,
2022
pending: Vec<f32>,
2123
}
2224

@@ -39,23 +41,26 @@ impl Resampler {
3941
oversampling_factor: 128,
4042
window: WindowFunction::BlackmanHarris2,
4143
};
42-
let resampler = SincFixedIn::<f32>::new(
44+
let resampler = Async::<f32>::new_sinc(
4345
output_rate as f64 / input_rate as f64,
4446
1.0,
45-
params,
47+
&params,
4648
chunk_frames,
4749
channels as usize,
50+
FixedAsync::Input,
4851
)?;
4952

5053
let input_planar = (0..channels as usize).map(|_| vec![0.0f32; chunk_frames]).collect();
51-
let output_planar = resampler.output_buffer_allocate(true);
54+
let output_frames_max = resampler.output_frames_max();
55+
let output_planar = vec![vec![0.0f32; output_frames_max]; channels as usize];
5256

5357
Ok(Self {
5458
resampler,
5559
chunk_frames,
5660
channels: channels as usize,
5761
input_planar,
5862
output_planar,
63+
output_frames_max,
5964
pending: Vec::new(),
6065
})
6166
}
@@ -83,9 +88,12 @@ impl Resampler {
8388
}
8489
}
8590

86-
let (_, produced) =
87-
self.resampler
88-
.process_into_buffer(&self.input_planar, &mut self.output_planar, None)?;
91+
let input = SequentialSliceOfVecs::new(&self.input_planar, self.channels, self.chunk_frames)
92+
.expect("resampler input buffer dimensions");
93+
let mut output =
94+
SequentialSliceOfVecs::new_mut(&mut self.output_planar, self.channels, self.output_frames_max)
95+
.expect("resampler output buffer dimensions");
96+
let (_, produced) = self.resampler.process_into_buffer(&input, &mut output, None)?;
8997

9098
let prev_len = out.len();
9199
out.resize(prev_len + produced * self.channels, 0.0);

rs/moq-native/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ moq-net = { workspace = true, features = ["serde"] }
4141
parking_lot = { version = "0.12", features = ["deadlock_detection"] }
4242
qmux = { workspace = true, features = ["wss", "tls"], optional = true }
4343
quinn = { version = "0.11", default-features = false, features = ["platform-verifier", "runtime-tokio", "bloom"], optional = true }
44-
rand = "0.9.2"
44+
rand = "0.10.1"
4545
rcgen = { version = "0.14", default-features = false, optional = true }
4646
reqwest = { version = "0.12", default-features = false, optional = true }
4747
rustls = "0.23"
@@ -68,5 +68,5 @@ tracing-android = { version = "0.2", optional = true }
6868
[dev-dependencies]
6969
bytes = "1"
7070
chrono = "0.4"
71-
toml = "0.9"
71+
toml = "1.1"
7272
tracing-test = "0.2"

rs/moq-native/src/noq.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ impl NoqServer {
209209
nonce_len,
210210
"using QUIC-LB compatible connection ID generation"
211211
);
212-
endpoint_config.cid_generator(move || Box::new(ServerIdGenerator::new(server_id.clone(), nonce_len)));
212+
endpoint_config.cid_generator(Arc::new(move || {
213+
Box::new(ServerIdGenerator::new(server_id.clone(), nonce_len))
214+
}));
213215
}
214216

215217
let socket = std::net::UdpSocket::bind(listen).context("failed to bind UDP socket")?;
@@ -272,14 +274,17 @@ impl NoqRequest {
272274
let alpn = String::from_utf8(alpn).context("failed to decode ALPN")?;
273275
let host = handshake.server_name.unwrap_or_default();
274276

275-
tracing::debug!(%host, ip = %conn.remote_address(), %alpn, "accepting");
277+
// The established Connection no longer exposes a single peer address (noq 1.0
278+
// supports multipath), so capture it from the Connecting before awaiting.
279+
let remote = conn.remote_address();
280+
tracing::debug!(%host, ip = %remote, %alpn, "accepting");
276281

277282
// Wait for the QUIC connection to be established.
278283
let conn = conn.await.context("failed to establish QUIC connection")?;
279284

280285
let span = tracing::Span::current();
281286
span.record("id", conn.stable_id());
282-
tracing::debug!(%host, ip = %conn.remote_address(), %alpn, "accepted");
287+
tracing::debug!(%host, ip = %remote, %alpn, "accepted");
283288

284289
match alpn.as_str() {
285290
web_transport_noq::ALPN => {
@@ -367,7 +372,7 @@ impl ServerIdGenerator {
367372

368373
impl noq::ConnectionIdGenerator for ServerIdGenerator {
369374
fn generate_cid(&mut self) -> noq::ConnectionId {
370-
use rand::Rng;
375+
use rand::RngExt;
371376
let cid_len = self.cid_len();
372377
let mut cid = Vec::with_capacity(cid_len);
373378
// First byte has "self-encoded length" of server ID + nonce

rs/moq-native/src/quiche.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ impl QuicheClient {
7878
let conn = builder
7979
.connect(&host, port)
8080
.await
81-
.context("failed to connect to quiche server")?;
81+
.context("failed to connect to quiche server")?
82+
.established()
83+
.await
84+
.context("failed to establish quiche connection")?;
8285
let session = web_transport_quiche::Connection::connect(conn, request)
8386
.await
8487
.context("failed to connect to quiche server")?;
@@ -89,7 +92,10 @@ impl QuicheClient {
8992
let conn = builder
9093
.connect(&host, port)
9194
.await
92-
.context("failed to connect to quiche server")?;
95+
.context("failed to connect to quiche server")?
96+
.established()
97+
.await
98+
.context("failed to establish quiche connection")?;
9399

94100
let alpn = conn.alpn().context("missing ALPN")?;
95101
let alpn = std::str::from_utf8(&alpn).context("failed to decode ALPN")?;

rs/moq-native/src/quinn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ impl ServerIdGenerator {
403403

404404
impl quinn::ConnectionIdGenerator for ServerIdGenerator {
405405
fn generate_cid(&mut self) -> quinn::ConnectionId {
406-
use rand::Rng;
406+
use rand::RngExt;
407407
let cid_len = self.cid_len();
408408
let mut cid = Vec::with_capacity(cid_len);
409409
// First byte has "self-encoded length" of server ID + nonce

rs/moq-net/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bytes = "1"
2121
futures = "0.3"
2222
kio = { workspace = true }
2323
num_enum = "0.7"
24-
rand = "0.9.2"
24+
rand = "0.10.1"
2525
serde = { workspace = true, features = ["rc"] }
2626
serde_json = "1"
2727
thiserror = "2"

rs/moq-net/src/model/origin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
task::Poll,
66
};
77

8-
use rand::Rng;
8+
use rand::RngExt;
99
use web_async::Lock;
1010

1111
use super::BroadcastConsumer;

0 commit comments

Comments
 (0)