Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9a55300
chore(quest): claim quest/m2/intra-refresh/join-earlier-group.md
kixelated Oct 30, 2026
85e770a
feat(mux): let a max-delay decoder join a group before a live edge th…
kixelated Oct 30, 2026
9603246
docs(mux): drop the private link from with_lookback
kixelated Oct 30, 2026
5e2588a
fix(mux): end the lookback wait when the anchor ages out or the buffe…
kixelated Oct 30, 2026
98a27f3
fix(mux): read the lookback anchor's start after looking ahead
kixelated Oct 30, 2026
2276467
feat(mux)!: a warmup widens the start, replacing the lookback opt-in
kixelated Oct 30, 2026
af63fd4
style: format
kixelated Oct 30, 2026
db00792
test: let mid-stream join tests start without waiting for earlier groups
kixelated Oct 30, 2026
f6a8f03
fix(mux): carve the warmup before the retention clamp, and keep the c…
kixelated Oct 30, 2026
8170013
feat(mux)!: a Delay's min, not the max delay, sets the start's reach
kixelated Oct 30, 2026
cdb12cb
feat(video,audio,ffi,c)!: a Delay replaces the max delay and fixed pl…
kixelated Oct 30, 2026
908ae9a
feat(bindings)!: decoder outputs take a Delay record
kixelated Oct 30, 2026
a36fe3e
feat(hang,watch)!: Container.Consumer takes a delay, and players star…
kixelated Oct 30, 2026
d227b34
docs: Delay migration notes, docs, and the dual-decoder quest
kixelated Oct 30, 2026
ffe2c27
Merge remote-tracking branch 'origin/main' into consumer-min-delay
kixelated Oct 30, 2026
1bd5f09
test(hang): an unlimited consumer leaves its subscription unlimited
kixelated Oct 30, 2026
588e0b3
style: format
kixelated Oct 30, 2026
3a3de6b
test(mux): pin that a local range leaves the start reaching back
kixelated Oct 30, 2026
8f612b2
fix(hang): keep the covering group until the reader reaches the start…
kixelated Oct 31, 2026
98cf123
fix(mux): tolerate the warmup in the skip until the reader warms
kixelated Oct 31, 2026
0ee066d
Merge origin/main into quest/m2/intra-refresh/join-earlier-group
kixelated Oct 31, 2026
b95e552
fix(hang): an age skip that ends the start keeps the start's target
kixelated Oct 31, 2026
ebe3df5
Merge origin/main: moq play's dual decoder takes Delay, null for an u…
kixelated Nov 1, 2026
e0aaadc
test: start-reach tests time out on the ambient clock
kixelated Nov 1, 2026
d00528e
Merge origin/main: start-reach timers and tests on kio::clock
kixelated Nov 1, 2026
35a6c13
quest land: merge tested base
Nov 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cpp/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

### Decoder outputs take a `moq::Delay` ([#7311](https://github.com/moq-dev/moq/pull/7311))

`moq::AudioDecoderOutput` replaces `max_delay` and the playout `delay` with `std::optional<moq::Delay> delay` and `bool estimate = true`.
`moq::VideoDecoderOutput::max_delay` is `std::optional<moq::Delay> delay`.
`moq::Delay{min, max}`: `max` (`std::nullopt` for no limit) is the old `max_delay`, and `min` is the playout delay, where a cold join starts.
A fixed audio playout delay `d` is `delay = moq::Delay{d, max}` with `estimate = false`.

### Paths with an empty segment are refused ([#6648](https://github.com/moq-dev/moq/pull/6648))

Publishing, serving, or requesting a broadcast at a path with a leading, trailing, or doubled `/` fails instead of collapsing it. Pass the canonical path, such as `room/cam`.
Expand Down
2 changes: 1 addition & 1 deletion cpp/moq/test/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void audio_roundtrip() {
decoded.format = moq::AudioSampleFormat::kF32;
// The track's whole retention: reading starts only after finish, and the budget ages
// groups by wall clock, so a stalled host would otherwise skip the start.
decoded.max_delay = std::chrono::seconds(30);
decoded.delay = moq::Delay{std::chrono::seconds(0), std::chrono::seconds(30)};
auto consumer = ok(moq::AudioConsumer::subscribe(receiver, "tone", snapshot->audio.at("tone"), decoded).get(), "audio consumer");
for (size_t packet = 0; packet < 8; packet++) {
std::vector<uint8_t> data(960 * 2 * sizeof(float));
Expand Down
2 changes: 1 addition & 1 deletion cpp/obs/test/moq-audio-encoder-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void CheckSubscriberDecodes(const char *preset, size_t channels)
moq::AudioDecoderOutput output{moq::AudioSampleFormat::kF32};
output.channels = static_cast<uint32_t>(channels);
// The packets are written faster than real time, so let none be skipped as stale.
output.max_delay = std::chrono::seconds(10);
output.delay = moq::Delay{std::chrono::seconds(0), std::chrono::seconds(10)};
auto audio = TestOk(moq::AudioConsumer::subscribe(consumer, name, rendition, output).get(), "audio consumer");

const int count = 50;
Expand Down
7 changes: 7 additions & 0 deletions dart/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Decoder outputs take a `Delay` ([#7311](https://github.com/moq-dev/moq/pull/7311))

`audio.DecoderOutput` replaces `maxDelay` and the playout `delay: Duration?` with `delay: media.Delay?` and `estimate: bool = true`.
`video.DecoderOutput.maxDelay` is `delay: media.Delay?`.
`Delay(min: ..., max: ...)`: `max` (null for no limit) is the old `maxDelay`, and `min` is the playout delay, where a cold join starts.
A fixed audio playout delay `d` is `delay: Delay(min: d, max: ...)` with `estimate: false`.

### Compression moves to the track

`package:moq/flate.dart` is removed: publish opaque bytes on a `TrackProducer`.
Expand Down
3 changes: 3 additions & 0 deletions dart/moq/lib/media.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ typedef ContainerInit = MoqContainerInit;
/// A width and height pair, in pixels.
typedef Dimensions = MoqDimensions;

/// How far behind the live edge a decoder plays: `min` is the playout delay and where a cold join starts, and `max`, null for no limit, is how far a stalled group may fall behind before it is skipped. `min` stays on the consumer; a `min` past `max` starts at `max`.
typedef Delay = MoqDelay;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

/// Where an audio or video decoder starts on a track that already holds groups: `latest` for a live player.
typedef DecodeStart = MoqDecodeStart;

Expand Down
2 changes: 1 addition & 1 deletion dart/moq/lib/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef EncoderInput = MoqVideoEncoderInput;
/// The codec, bitrate, group mode, and backend preference.
typedef EncoderOutput = MoqVideoEncoderOutput;

/// What a [Consumer] delivers: an optional resize, a max delay, and whether to keep the decoder's surface (macOS and iOS).
/// What a [Consumer] delivers: an optional resize, a delay, and whether to keep the decoder's surface (macOS and iOS).
typedef DecoderOutput = MoqVideoDecoderOutput;

/// One raw picture with its presentation timestamp.
Expand Down
6 changes: 5 additions & 1 deletion dart/moq/test/moq_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,11 @@ void main() {

final fixedOutput = moq_audio.DecoderOutput(
format: moq_audio.SampleFormat.f32,
delay: const Duration(milliseconds: 80),
delay: moq_media.Delay(
min: Duration(milliseconds: 80),
max: Duration.zero,
),
estimate: false,
);
final fixed = await moq_audio.Consumer.subscribe(
broadcast: consumer,
Expand Down
162 changes: 133 additions & 29 deletions dart/moq_ffi/lib/src/moq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class MoqAudioDecoderOutput {
final MoqAudioSampleFormat format;
final int? sampleRate;
final int? channels;
final Duration? maxDelay;
final Duration? delay;
final MoqDelay? delay;
final bool estimate;
final MoqDecodeStart? start;
MoqAudioDecoderOutput({
required this.format,
this.sampleRate = null,
this.channels = null,
this.maxDelay = null,
this.delay = null,
this.estimate = true,
this.start = null,
});
}
Expand All @@ -51,16 +51,16 @@ class FfiConverterMoqAudioDecoderOutput {
);
final channels = channels_lifted.value;
new_offset += channels_lifted.bytesRead;
final maxDelay_lifted = FfiConverterOptionalDuration.read(
Uint8List.view(buf.buffer, new_offset),
);
final maxDelay = maxDelay_lifted.value;
new_offset += maxDelay_lifted.bytesRead;
final delay_lifted = FfiConverterOptionalDuration.read(
final delay_lifted = FfiConverterOptionalMoqDelay.read(
Uint8List.view(buf.buffer, new_offset),
);
final delay = delay_lifted.value;
new_offset += delay_lifted.bytesRead;
final estimate_lifted = FfiConverterBool.read(
Uint8List.view(buf.buffer, new_offset),
);
final estimate = estimate_lifted.value;
new_offset += estimate_lifted.bytesRead;
final start_lifted = FfiConverterOptionalMoqDecodeStart.read(
Uint8List.view(buf.buffer, new_offset),
);
Expand All @@ -71,8 +71,8 @@ class FfiConverterMoqAudioDecoderOutput {
format: format,
sampleRate: sampleRate,
channels: channels,
maxDelay: maxDelay,
delay: delay,
estimate: estimate,
start: start,
),
new_offset - buf.offsetInBytes,
Expand All @@ -84,8 +84,8 @@ class FfiConverterMoqAudioDecoderOutput {
FfiConverterMoqAudioSampleFormat.allocationSize(value.format) +
FfiConverterOptionalUInt32.allocationSize(value.sampleRate) +
FfiConverterOptionalUInt32.allocationSize(value.channels) +
FfiConverterOptionalDuration.allocationSize(value.maxDelay) +
FfiConverterOptionalDuration.allocationSize(value.delay) +
FfiConverterOptionalMoqDelay.allocationSize(value.delay) +
FfiConverterBool.allocationSize(value.estimate) +
FfiConverterOptionalMoqDecodeStart.allocationSize(value.start) +
0;
final buf = Uint8List(total_length);
Expand All @@ -107,12 +107,12 @@ class FfiConverterMoqAudioDecoderOutput {
value.channels,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalDuration.write(
value.maxDelay,
new_offset += FfiConverterOptionalMoqDelay.write(
value.delay,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalDuration.write(
value.delay,
new_offset += FfiConverterBool.write(
value.estimate,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalMoqDecodeStart.write(
Expand All @@ -126,8 +126,8 @@ class FfiConverterMoqAudioDecoderOutput {
return FfiConverterMoqAudioSampleFormat.allocationSize(value.format) +
FfiConverterOptionalUInt32.allocationSize(value.sampleRate) +
FfiConverterOptionalUInt32.allocationSize(value.channels) +
FfiConverterOptionalDuration.allocationSize(value.maxDelay) +
FfiConverterOptionalDuration.allocationSize(value.delay) +
FfiConverterOptionalMoqDelay.allocationSize(value.delay) +
FfiConverterBool.allocationSize(value.estimate) +
FfiConverterOptionalMoqDecodeStart.allocationSize(value.start) +
0;
}
Expand Down Expand Up @@ -1711,6 +1711,65 @@ class FfiConverterMoqDatagram {
}
}

class MoqDelay {
final Duration min;
final Duration? max;
MoqDelay({required this.min, this.max});
}

class FfiConverterMoqDelay {
static MoqDelay lift(RustBuffer buf) {
return FfiConverterMoqDelay.read(buf.asUint8List()).value;
}

static LiftRetVal<MoqDelay> read(Uint8List buf) {
int new_offset = buf.offsetInBytes;
final min_lifted = FfiConverterDuration.read(
Uint8List.view(buf.buffer, new_offset),
);
final min = min_lifted.value;
new_offset += min_lifted.bytesRead;
final max_lifted = FfiConverterOptionalDuration.read(
Uint8List.view(buf.buffer, new_offset),
);
final max = max_lifted.value;
new_offset += max_lifted.bytesRead;
return LiftRetVal(
MoqDelay(min: min, max: max),
new_offset - buf.offsetInBytes,
);
}

static RustBuffer lower(MoqDelay value) {
final total_length =
FfiConverterDuration.allocationSize(value.min) +
FfiConverterOptionalDuration.allocationSize(value.max) +
0;
final buf = Uint8List(total_length);
write(value, buf);
return toRustBuffer(buf);
}

static int write(MoqDelay value, Uint8List buf) {
int new_offset = buf.offsetInBytes;
new_offset += FfiConverterDuration.write(
value.min,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalDuration.write(
value.max,
Uint8List.view(buf.buffer, new_offset),
);
return new_offset - buf.offsetInBytes;
}

static int allocationSize(MoqDelay value) {
return FfiConverterDuration.allocationSize(value.min) +
FfiConverterOptionalDuration.allocationSize(value.max) +
0;
}
}

class MoqDimensions {
final int width;
final int height;
Expand Down Expand Up @@ -4196,12 +4255,12 @@ class FfiConverterMoqWebSocketConfig {

class MoqVideoDecoderOutput {
final MoqDimensions? resize;
final Duration? maxDelay;
final MoqDelay? delay;
final bool surface;
final MoqDecodeStart? start;
MoqVideoDecoderOutput({
this.resize = null,
this.maxDelay = null,
this.delay = null,
this.surface = false,
this.start = null,
});
Expand All @@ -4219,11 +4278,11 @@ class FfiConverterMoqVideoDecoderOutput {
);
final resize = resize_lifted.value;
new_offset += resize_lifted.bytesRead;
final maxDelay_lifted = FfiConverterOptionalDuration.read(
final delay_lifted = FfiConverterOptionalMoqDelay.read(
Uint8List.view(buf.buffer, new_offset),
);
final maxDelay = maxDelay_lifted.value;
new_offset += maxDelay_lifted.bytesRead;
final delay = delay_lifted.value;
new_offset += delay_lifted.bytesRead;
final surface_lifted = FfiConverterBool.read(
Uint8List.view(buf.buffer, new_offset),
);
Expand All @@ -4237,7 +4296,7 @@ class FfiConverterMoqVideoDecoderOutput {
return LiftRetVal(
MoqVideoDecoderOutput(
resize: resize,
maxDelay: maxDelay,
delay: delay,
surface: surface,
start: start,
),
Expand All @@ -4248,7 +4307,7 @@ class FfiConverterMoqVideoDecoderOutput {
static RustBuffer lower(MoqVideoDecoderOutput value) {
final total_length =
FfiConverterOptionalMoqDimensions.allocationSize(value.resize) +
FfiConverterOptionalDuration.allocationSize(value.maxDelay) +
FfiConverterOptionalMoqDelay.allocationSize(value.delay) +
FfiConverterBool.allocationSize(value.surface) +
FfiConverterOptionalMoqDecodeStart.allocationSize(value.start) +
0;
Expand All @@ -4263,8 +4322,8 @@ class FfiConverterMoqVideoDecoderOutput {
value.resize,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalDuration.write(
value.maxDelay,
new_offset += FfiConverterOptionalMoqDelay.write(
value.delay,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterBool.write(
Expand All @@ -4280,7 +4339,7 @@ class FfiConverterMoqVideoDecoderOutput {

static int allocationSize(MoqVideoDecoderOutput value) {
return FfiConverterOptionalMoqDimensions.allocationSize(value.resize) +
FfiConverterOptionalDuration.allocationSize(value.maxDelay) +
FfiConverterOptionalMoqDelay.allocationSize(value.delay) +
FfiConverterBool.allocationSize(value.surface) +
FfiConverterOptionalMoqDecodeStart.allocationSize(value.start) +
0;
Expand Down Expand Up @@ -15459,6 +15518,51 @@ class FfiConverterOptionalMoqDecodeStart {
}
}

class FfiConverterOptionalMoqDelay {
static MoqDelay? lift(RustBuffer buf) {
return FfiConverterOptionalMoqDelay.read(buf.asUint8List()).value;
}

static LiftRetVal<MoqDelay?> read(Uint8List buf) {
if (ByteData.view(buf.buffer, buf.offsetInBytes).getInt8(0) == 0) {
return LiftRetVal(null, 1);
}
final result = FfiConverterMoqDelay.read(
Uint8List.view(buf.buffer, buf.offsetInBytes + 1),
);
return LiftRetVal<MoqDelay?>(result.value, result.bytesRead + 1);
}

static int allocationSize([MoqDelay? value]) {
if (value == null) {
return 1;
}
return FfiConverterMoqDelay.allocationSize(value) + 1;
}

static RustBuffer lower(MoqDelay? value) {
if (value == null) {
return toRustBuffer(Uint8List.fromList([0]));
}
final buf = Uint8List(FfiConverterOptionalMoqDelay.allocationSize(value));
FfiConverterOptionalMoqDelay.write(value, buf);
return toRustBuffer(buf);
}

static int write(MoqDelay? value, Uint8List buf) {
if (value == null) {
buf[0] = 0;
return 1;
}
buf[0] = 1;
return FfiConverterMoqDelay.write(
value,
Uint8List.view(buf.buffer, buf.offsetInBytes + 1),
) +
1;
}
}

class FfiConverterOptionalMoqDimensions {
static MoqDimensions? lift(RustBuffer buf) {
return FfiConverterOptionalMoqDimensions.read(buf.asUint8List()).value;
Expand Down Expand Up @@ -20937,7 +21041,7 @@ void _checkApiChecksums() {
if (uniffi_moq_ffi_checksum_method_moqaudioconsumer_cancel() != 62285) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqaudioconsumer_delay() != 48052) {
if (uniffi_moq_ffi_checksum_method_moqaudioconsumer_delay() != 18211) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqaudioconsumer_next() != 7650) {
Expand Down
8 changes: 5 additions & 3 deletions doc/concept/audio-jitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,11 @@ or one beyond the track's retention window, is an error at configuration time.
Supported or refused, not warned about and continued.

In the browser this is the numeric `delay` setting; natively it is
`decode::Options::delay`, where `None` selects the estimator. The two spell the
same thing the same way on purpose. It is distinct from `max_delay`, which is the
live-edge skip budget and not a buffer.
`decode::Options::delay.min` with `decode::Options::estimate` set to `false`.
`estimate` defaults to `true`, which runs the estimator instead and never goes
below that `min`. The two spell the same thing the same way on purpose. It is
distinct from `delay.max`, which is the live-edge skip budget and not a buffer.
The same `min` is where a cold join starts.

## Constants

Expand Down
2 changes: 1 addition & 1 deletion doc/lib/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ how it looks in that language:
- **Connection stats** and **errors** that tell an auth rejection (don't retry) from a shutdown or a transport failure.
- **Authorization in band**: read the grant the relay sent back (the patterns this side may publish and subscribe to, and when it lapses), and present a fresh token before the current one expires, without reconnecting. It needs `moq-lite-07-wip`, which is opt-in, or moq-transport draft-18+ with the [MoQ Auth extension](/draft/moq-auth).

C's audio decoder neither takes nor reports a playout delay, and C has no in-band authorization.
C's audio decoder takes a playout delay only as the floor `moq_delay.min_us` under its estimate, and reports none; C has no in-band authorization.

## Upgrading

Expand Down
Loading