Skip to content
9 changes: 4 additions & 5 deletions doc/lib/rs/moq-audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ without stalling the mix.
Without a subscriber the encoder keeps raw PCM
up to the track's `max_age`, then encodes the part of that history within the
subscribers' max delay before continuing live when someone subscribes. With an unlimited `max_age` it keeps at most 30 seconds
(about 11.5 MB for 48 kHz stereo f32). Set `encode::Capture::on_demand` to false
to encode continuously instead. Stopping an encoder leaves the shared capture running, and the
history it retained stays on the track until it is subscribed or expires; a device failure keeps
it the same way before the encoder returns the error. Its consumer can be swapped without
changing the track subscribers know. Opus packs 20 ms per packet by default,
(about 11.5 MB for 48 kHz stereo f32). Set `encode::Capture::retain` to false
to encode continuously instead. Dropping an encoder leaves the shared capture running. A device
failure keeps the retained history on the track until it is subscribed or expires, then the
encoder returns the error. Opus packs 20 ms per packet by default,
or 10 ms with a shorter `frame_duration`. Groups carry at least 20 ms by default,
so 10 ms packets pair up. `encode::Options::join`
changes that minimum; a join shorter than a packet puts every packet in its own
Expand Down
11 changes: 7 additions & 4 deletions doc/lib/rs/moq-video.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ feature (vendored C++); the published bindings and binaries enable it. H.265 is
hardware-only, AV1 decodes through NVDEC and MediaCodec, and VP8 and VP9
decode in software through the opt-in `vpx` feature.

`encode::publish_capture` advertises the track up front, then keeps the camera
open and encoding whether or not anyone subscribes, so a late viewer can fetch
the recent past. Set `encode::Capture::on_demand` to open the camera only while
someone subscribes, at the cost of that past. A viewer who joins
`encode::publish_capture` advertises the track up front and returns a
`Publication` that reports its status, plus the `Driver` that captures. Running
the driver keeps the camera open and encoding whether or not anyone subscribes,
so a late viewer can fetch the recent past. Set `encode::Capture::on_demand` to
open the camera only while someone subscribes, at the cost of that past. Either
way the driver first opens the camera once to learn its mode, which can raise a
permission prompt before anyone subscribes. A viewer who joins
once the current group's deltas outweigh twice its keyframe gets a fresh
keyframe, so `encode::Config::join` is only the longest a group runs. Through a moq-lite
relay, only the join that opens the relay's upstream subscription counts. A
Expand Down
1 change: 0 additions & 1 deletion quest/m2/api-shape/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Rejected in planning:
- [Transports take shared types](/quest/m2/api-shape/transport.md) - moq-uring takes a congestion factory and rustls configs, and the tokio server request stops exposing its QUIC internals
- [Crates re-export no whole crate](/quest/m2/api-shape/reexports.md) - no moq crate re-exports a whole crate, moq's own included, so a dependency bump is no moq break, and moq-mux's container `Guard` gets a name
- [Media crates' small surface fixes](/quest/m2/api-shape/media.md) - exporters, the container consumer, catalog color range, rate grant, moq-stats, JSON, and MSF each have one path and one name
- [Native media's small surface fixes](/quest/m2/api-shape/native.md) - audio encode internals go private, `on_demand` has one meaning, and video and render setters fold into their constructors
- [Apps' small surface fixes](/quest/m2/api-shape/apps.md) - the relay, gateways, moq-hls, moq-cli, and moq-boy drop dead or unreachable surface and gain role names
- [JS packages' small surface fixes](/quest/m2/api-shape/js.md) - track info, connection, qmux, watch, publish, ui, video, boy, and auth exports each have one path and one name
- [Bindings' small surface fixes](/quest/m2/api-shape/bindings.md) - Go's read cancel, JSON producer construction, and the Python wheel's test module
31 changes: 0 additions & 31 deletions quest/m2/api-shape/native.md

This file was deleted.

7 changes: 4 additions & 3 deletions quest/m3/video-publish-grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ Decided 2026-11-05 (maintainer, on moq-dev/studio's /quest-plan): m3, since the

moq-net already exposes the grant (`bandwidth::Reservation::rate`, also in
moq-ffi), but `encode::publish_capture` (`rs/moq-video/src/encode/producer.rs`)
holds the reservation privately in its capture loop and returns nothing. The
only figure a caller sees is the target reported through the catalog stats.
holds the reservation privately in its capture loop, and the `Publication`
handle it returns reports only its lifecycle state. The only figure a caller
sees is the target reported through the catalog stats.

Consumer: the studio's encode-control rungs and Health panel
([moq-dev/studio#25](https://github.com/moq-dev/studio/pull/25)). Recommendation: return a handle from the publish
call that carries the grant, rather than a callback.

Changed 2026-11-07 (maintainer, /quest-plan from the API sweep of open PRs and remaining quests): [api-shape/native](/quest/m2/api-shape/native.md) makes `publish_capture` return a handle in both crates before the cut, so `grant()` is an additive method on it.
Changed 2026-11-07 (maintainer, /quest-plan from the API sweep of open PRs and remaining quests): `publish_capture` returns an `encode::Publication` handle in both moq-video and moq-audio before the cut, so `grant()` is an additive method on it.
10 changes: 9 additions & 1 deletion rs/moq-audio/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ How to update your code for each breaking change, newest first.

## Unreleased

### `Bus::channel` is `Bus::live`

The bus has two kinds of source: a live one on its own clock, whose ring
absorbs jitter and drift, and a positioned one on the bus's clock, whose every
write names its bus position. `Bus::channel` and `bus::Channel` are renamed
`Bus::live` and `bus::Live` to pair with `Bus::positioned` and
`bus::Positioned`. Their behavior is unchanged: rename the calls and the type.

### Playback fills a declared silence with comfort noise

`Sink::end()` declares that the audio written so far is followed by a silence
Expand Down Expand Up @@ -88,7 +96,7 @@ Device channel counts above stereo are now consistently `Layout::Discrete`:
a microphone array does not declare surround-speaker positions. A stereo bus
refuses those inputs instead of guessing a surround downmix. Request mono or
stereo through `capture::Config::channels` when the device supports it, or map
the known channels explicitly before writing a `Bus::channel`. The encoder refuses
the known channels explicitly before writing a `Bus::live`. The encoder refuses
them too: `encode::Control::new` fails for such a consumer, since its default
stereo config (and Opus in any config) cannot take a discrete layout. Publish a
microphone array only when it delivers mono or stereo, or with an
Expand Down
20 changes: 0 additions & 20 deletions rs/moq-audio/src/capture/fanout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,6 @@ pub struct Consumer {
}

impl Consumer {
pub(crate) fn poll_failed(&self, waiter: &kio::Waiter) -> Poll<Error> {
ready!(self.state.poll_closed(waiter));
Poll::Ready(
self.state
.read()
.failure
.clone()
.unwrap_or_else(|| Error::Capture("audio capture stopped".into())),
)
}

/// The shared failure, if capture has already ended, without waiting.
pub(crate) fn failure(&self) -> Option<Error> {
self.state.read().failure.clone()
}

pub(crate) fn skip_to_live(&mut self) {
self.next = self.state.read().next;
}

/// The PCM format shared by every consumer of this capture.
pub fn input(&self) -> &Input {
&self.input
Expand Down
Loading
Loading