Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions doc/bin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ Playback starts at the newest group and trails the live edge by `--delay`. The
default, `auto`, sizes the buffer to how unevenly audio arrives, with the same
[algorithm](/concept/audio-jitter) as the browser player. A duration fixes the
delay and is also how long a stalled group is waited on before it is skipped.
Audio and video play from one clock and stay in sync while both arrive on time;
a track that stalls plays late and catches up by playing faster, rather than
holding the other one back.
Each role follows the catalog, switching rendition when the publisher retires
the one playing. With `--video off`, `--metrics <PATH>` writes a JSON line every
250 ms with the playhead, the delay, and every gap and stall the speaker hit, in
Expand Down
5 changes: 3 additions & 2 deletions doc/lib/rs/moq-mux.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ description: Container import and export

Turns existing container formats into [hang](/concept/hang) broadcasts and
back. This is what `moq import` / `export` and the gateways are built on.
Native players also use its `timeline` to present a broadcast's audio and video
on one clock: audio drives the anchor while it plays, and video follows it.
Native players also use its `sync` to present a broadcast's tracks on one clock,
anchored on the earliest arrival any track has seen. Tracks stay together in the
steady state, and one that stalls plays late instead of holding the others.
The caller supplies the jitter target, decoders, and output devices; a presenter
can select the newest due picture without waiting and repeat it during a stall.

Expand Down
1 change: 0 additions & 1 deletion quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ quests that require them.
- [No sentinel values in public API](/quest/m2/no-sentinels.md) - receive windows, cache durations, reconnect timeouts, and the FFI test clock use `Option` instead of a huge value or zero
- [moq-video takes devices, not environment variables](/quest/m2/video-devices.md) - VA-API and V4L2 device paths are config fields, and `moq_video::ENV` never ships
- [Gateways share one ingest config and one rate cap](/quest/m2/gateway-ingest.md) - `moq_mux::Ingest` replaces 18 per-gateway setters, and the live rate cap moves to `moq_net::bandwidth`
- [Native playout sync keeps tracks decoupled](/quest/m2/mux-sync.md) - `moq_mux::timeline` becomes `moq_mux::sync`, and one slow track no longer stalls or moves another
- [JS time values are types, not numbers](/quest/m2/js-time-types.md) - every public JS duration and instant is a `Clock.Duration` or `Clock.Instant` object, so a unit mistake fails to compile
- [Small API fixes before the cut](/quest/m2/api-shape/README.md) - one path and one spelling per item, names by role, and no dead or wrong-role public surface across net, transport, media, native, apps, JS, and bindings
- [Public constructors spawn nothing, or say why](/quest/m2/spawn-constructors.md) - each public library entry point that spawns returns a driver its caller polls, or is listed as kept
Expand Down
3 changes: 1 addition & 2 deletions quest/m2/api-shape/media.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Added 2026-11-07 (maintainer, /quest-plan from the 2026-11-07 API sweep of open

Found by the 2026-11-07 API shape audit (media formats); see the
[epic](/quest/m2/api-shape/README.md). The playout clock is
[mux-sync](/quest/m2/mux-sync.md).
Check the
`moq_mux::sync`, already reshaped. Check the
`ts::Follower` and `ts::Release` collision too, and rename whichever name
the PR shows is ambiguous.
38 changes: 0 additions & 38 deletions quest/m2/mux-sync.md

This file was deleted.

2 changes: 1 addition & 1 deletion rs/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ codspeed:
--features moq-audio/bus,moq-net/fuzz,moq-quic/fuzz \
--bench tasks --bench waiter --bench bus --bench protect --bench codec --bench table \
--bench catalog --bench containers --bench decode_clock --bench export --bench jitter \
--bench parameter_sets --bench timeline --bench ts_programs --bench ts_schedule --bench ts_video \
--bench parameter_sets --bench sync --bench ts_programs --bench ts_schedule --bench ts_video \
--bench announce --bench auth --bench bandwidth --bench canonical --bench frame --bench interests \
--bench priority --bench retirement --bench schedule --bench stats --bench synced --bench tail \
--bench tracks --bench varint --bench viewers --bench matching \
Expand Down
6 changes: 3 additions & 3 deletions rs/moq-cli/src/play/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const DELAY_MAX: Duration = Duration::from_secs(10);
/// lateness the estimate can represent.
const AUTO_MAX_DELAY: Duration = Duration::from_secs(2);

/// How far video alone trails the live edge under `auto`. The estimate is
/// audio's; video follows the speaker whenever there is one.
/// How far playback trails the live edge under `auto` while audio holds no
/// estimate, as when there is none: video has no estimator of its own.
const AUTO_VIDEO_DELAY: Duration = Duration::from_millis(100);

/// How far playback trails the live edge.
Expand Down Expand Up @@ -112,7 +112,7 @@ impl Args {
self.fixed_delay().unwrap_or(AUTO_MAX_DELAY)
}

/// How far video trails the live edge while no speaker is setting the pace.
/// How far playback trails the live edge while no audio estimate sets it.
pub(super) fn video_delay(&self) -> Duration {
self.fixed_delay().unwrap_or(AUTO_VIDEO_DELAY)
}
Expand Down
7 changes: 5 additions & 2 deletions rs/moq-cli/src/play/headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ use super::args::Args;
use super::media::Media;
use super::metrics::Metrics;
use super::output::Output;
use super::timeline::Playhead;
use super::window::Event;
use moq_mux::timeline::Producer as Presentation;
use moq_mux::sync::Producer as Presentation;

/// The speaker and the run loop's events, plus `--metrics`' observer feed.
#[derive(Clone)]
Expand Down Expand Up @@ -52,9 +53,10 @@ pub(crate) async fn run(
) -> anyhow::Result<()> {
let (events, mut received) = mpsc::unbounded_channel();
let presentation = Presentation::new(args.video_delay());
let playhead = Playhead::default();
let (mut metrics, observe) = match &args.metrics {
Some(path) => {
let (metrics, observe) = Metrics::create(path, presentation.consume())?;
let (metrics, observe) = Metrics::create(path, presentation.consume(), playhead.clone())?;
(Some(metrics), Some(observe))
}
None => (None, None),
Expand All @@ -65,6 +67,7 @@ pub(crate) async fn run(
origin,
broadcast,
presentation,
playhead,
args,
video: Arc::new(Mutex::new(VecDeque::new())),
drained: Arc::new(Notify::new()),
Expand Down
Loading
Loading