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
6 changes: 6 additions & 0 deletions cpp/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Catalog references carry their epoch

`Video` and `Audio` gain `epoch`, the publisher instance their `broadcast` reference names, right after `broadcast`; positional initializers shift by one.
`BroadcastConsumer::resolve(reference)` becomes `resolve(reference, epoch)`; pass the rendition's `epoch` alongside its `broadcast`, or `std::nullopt` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, fail with `moq::Error::kMux` for a rendition whose broadcast is proven to serve another epoch.

### Finished tracks stay until the broadcast ends (#6157)

A finished track now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `BroadcastProducer::finish` lets go.
Expand Down
6 changes: 6 additions & 0 deletions dart/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Catalog references carry their epoch

`Video` and `Audio` renditions gain `epoch`, the publisher instance their `broadcast` reference names.
`BroadcastConsumer.resolve(reference:)` requires `epoch:` too; pass the rendition's `epoch` alongside its `broadcast`, or `null` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, throw for a rendition whose broadcast is proven to serve another epoch.

### Finished tracks stay until the broadcast ends (#6157)

A finished track now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `BroadcastProducer.finish()` lets go.
Expand Down
6 changes: 6 additions & 0 deletions dart/moq_ffi/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Catalog references carry their epoch

`MoqVideo` and `MoqAudio` gain `epoch`, the publisher instance their `broadcast` reference names.
`MoqBroadcastConsumer.resolve(reference:)` requires `epoch:` too; pass the rendition's `epoch` alongside, or `null` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, fail a rendition whose broadcast is proven to serve another epoch with `MuxMoqException`.

### Finished tracks stay until the broadcast ends (#6157)

A finished track, raw or media, now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `MoqBroadcastProducer.finish()` lets go, instead of unlisting when its producer finishes or is released.
Expand Down
46 changes: 41 additions & 5 deletions dart/moq_ffi/lib/src/moq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ class FfiConverterMoqJsonValue {
class MoqAudio {
final String? label;
final String? broadcast;
final String? epoch;
final String? track;
final String codec;
final Uint8List? description;
Expand All @@ -1106,6 +1107,7 @@ class MoqAudio {
MoqAudio({
this.label = null,
this.broadcast = null,
this.epoch = null,
this.track = null,
required this.codec,
this.description,
Expand Down Expand Up @@ -1135,6 +1137,11 @@ class FfiConverterMoqAudio {
);
final broadcast = broadcast_lifted.value;
new_offset += broadcast_lifted.bytesRead;
final epoch_lifted = FfiConverterOptionalString.read(
Uint8List.view(buf.buffer, new_offset),
);
final epoch = epoch_lifted.value;
new_offset += epoch_lifted.bytesRead;
final track_lifted = FfiConverterOptionalString.read(
Uint8List.view(buf.buffer, new_offset),
);
Expand Down Expand Up @@ -1184,6 +1191,7 @@ class FfiConverterMoqAudio {
MoqAudio(
label: label,
broadcast: broadcast,
epoch: epoch,
track: track,
codec: codec,
description: description,
Expand All @@ -1202,6 +1210,7 @@ class FfiConverterMoqAudio {
final total_length =
FfiConverterOptionalString.allocationSize(value.label) +
FfiConverterOptionalString.allocationSize(value.broadcast) +
FfiConverterOptionalString.allocationSize(value.epoch) +
FfiConverterOptionalString.allocationSize(value.track) +
FfiConverterString.allocationSize(value.codec) +
FfiConverterOptionalUint8List.allocationSize(value.description) +
Expand All @@ -1227,6 +1236,10 @@ class FfiConverterMoqAudio {
value.broadcast,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalString.write(
value.epoch,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalString.write(
value.track,
Uint8List.view(buf.buffer, new_offset),
Expand Down Expand Up @@ -1269,6 +1282,7 @@ class FfiConverterMoqAudio {
static int allocationSize(MoqAudio value) {
return FfiConverterOptionalString.allocationSize(value.label) +
FfiConverterOptionalString.allocationSize(value.broadcast) +
FfiConverterOptionalString.allocationSize(value.epoch) +
FfiConverterOptionalString.allocationSize(value.track) +
FfiConverterString.allocationSize(value.codec) +
FfiConverterOptionalUint8List.allocationSize(value.description) +
Expand Down Expand Up @@ -1966,6 +1980,7 @@ class FfiConverterMoqMediaTrackConfig {
class MoqVideo {
final String? label;
final String? broadcast;
final String? epoch;
final String? track;
final String codec;
final Uint8List? description;
Expand All @@ -1978,6 +1993,7 @@ class MoqVideo {
MoqVideo({
this.label = null,
this.broadcast = null,
this.epoch = null,
this.track = null,
required this.codec,
this.description,
Expand Down Expand Up @@ -2007,6 +2023,11 @@ class FfiConverterMoqVideo {
);
final broadcast = broadcast_lifted.value;
new_offset += broadcast_lifted.bytesRead;
final epoch_lifted = FfiConverterOptionalString.read(
Uint8List.view(buf.buffer, new_offset),
);
final epoch = epoch_lifted.value;
new_offset += epoch_lifted.bytesRead;
final track_lifted = FfiConverterOptionalString.read(
Uint8List.view(buf.buffer, new_offset),
);
Expand Down Expand Up @@ -2056,6 +2077,7 @@ class FfiConverterMoqVideo {
MoqVideo(
label: label,
broadcast: broadcast,
epoch: epoch,
track: track,
codec: codec,
description: description,
Expand All @@ -2074,6 +2096,7 @@ class FfiConverterMoqVideo {
final total_length =
FfiConverterOptionalString.allocationSize(value.label) +
FfiConverterOptionalString.allocationSize(value.broadcast) +
FfiConverterOptionalString.allocationSize(value.epoch) +
FfiConverterOptionalString.allocationSize(value.track) +
FfiConverterString.allocationSize(value.codec) +
FfiConverterOptionalUint8List.allocationSize(value.description) +
Expand All @@ -2099,6 +2122,10 @@ class FfiConverterMoqVideo {
value.broadcast,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalString.write(
value.epoch,
Uint8List.view(buf.buffer, new_offset),
);
new_offset += FfiConverterOptionalString.write(
value.track,
Uint8List.view(buf.buffer, new_offset),
Expand Down Expand Up @@ -2141,6 +2168,7 @@ class FfiConverterMoqVideo {
static int allocationSize(MoqVideo value) {
return FfiConverterOptionalString.allocationSize(value.label) +
FfiConverterOptionalString.allocationSize(value.broadcast) +
FfiConverterOptionalString.allocationSize(value.epoch) +
FfiConverterOptionalString.allocationSize(value.track) +
FfiConverterString.allocationSize(value.codec) +
FfiConverterOptionalUint8List.allocationSize(value.description) +
Expand Down Expand Up @@ -8332,7 +8360,10 @@ abstract class MoqBroadcastConsumerInterface {
required int sequence,
required MoqFetchGroupOptions? options,
});
Future<MoqBroadcastConsumer> resolve({required String? reference});
Future<MoqBroadcastConsumer> resolve({
required String? reference,
required String? epoch,
});
Future<MoqTrackConsumer> subscribeTrack({
required String name,
required MoqSubscription? subscription,
Expand Down Expand Up @@ -8395,11 +8426,15 @@ class MoqBroadcastConsumer implements MoqBroadcastConsumerInterface {
);
}

Future<MoqBroadcastConsumer> resolve({required String? reference}) {
Future<MoqBroadcastConsumer> resolve({
required String? reference,
required String? epoch,
}) {
return uniffiRustCallAsync(
() => uniffi_moq_ffi_fn_method_moqbroadcastconsumer_resolve(
uniffiClonePointer(),
FfiConverterOptionalString.lower(reference),
FfiConverterOptionalString.lower(epoch),
),
ffi_moq_ffi_rust_future_poll_u64,
ffi_moq_ffi_rust_future_complete_u64,
Expand Down Expand Up @@ -15994,12 +16029,13 @@ uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_group(
RustBuffer options,
);

@Native<Pointer<Void> Function(Pointer<Void>, RustBuffer)>(
@Native<Pointer<Void> Function(Pointer<Void>, RustBuffer, RustBuffer)>(
assetId: _uniffiAssetId,
)
external Pointer<Void> uniffi_moq_ffi_fn_method_moqbroadcastconsumer_resolve(
Pointer<Void> ptr,
RustBuffer reference,
RustBuffer epoch,
);

@Native<Pointer<Void> Function(Pointer<Void>, RustBuffer, RustBuffer)>(
Expand Down Expand Up @@ -19310,7 +19346,7 @@ void _checkApiChecksums() {
18633) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_resolve() != 62317) {
if (uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_resolve() != 33982) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_track() !=
Expand Down Expand Up @@ -19883,7 +19919,7 @@ void _checkApiChecksums() {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_constructor_moqmediatrackconsumer_subscribe() !=
62204) {
55638) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_constructor_moqmediatrackproducer_audio() !=
Expand Down
2 changes: 1 addition & 1 deletion dart/moq_ffi/test/leak_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void main() {
final consumer = MoqBroadcastProducer().consume();
final reference = 'x' * size;
Future<void> call() => expectLater(
consumer.resolve(reference: reference),
consumer.resolve(reference: reference, epoch: null),
throwsA(isA<MoqException>()),
);

Expand Down
7 changes: 7 additions & 0 deletions go/ffi/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

### Catalog references carry their epoch

`MoqVideo` and `MoqAudio` gain `Epoch *string`, the publisher instance their `Broadcast` reference names.
`MoqBroadcastConsumer.Resolve` takes the rendition's `epoch` after `reference`; pass it alongside, or `nil` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, fail a rendition whose broadcast is proven to serve another epoch with `Mux`.
Regenerate the bindings for the changed records and checksums.

### Finished tracks stay until the broadcast ends (#6157)

A finished track, raw or media, now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `MoqBroadcastProducer.Finish()` lets go, instead of unlisting when its producer finishes or is released.
Expand Down
6 changes: 6 additions & 0 deletions go/wrapper/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Catalog references carry their epoch

`ffi.MoqVideo` and `ffi.MoqAudio` gain `Epoch`, the publisher instance their `Broadcast` reference names.
`BroadcastConsumer.Resolve(ctx, reference)` becomes `Resolve(ctx, reference, epoch)`; pass the rendition's `Epoch` alongside its `Broadcast`, or `nil` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, error for a rendition whose broadcast is proven to serve another epoch.

### Finished tracks stay until the broadcast ends (#6157)

A finished track now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `BroadcastProducer.Finish()` lets go.
Expand Down
12 changes: 7 additions & 5 deletions go/wrapper/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ func (b *BroadcastConsumer) FetchGroup(

// Resolve returns the broadcast serving a catalog rendition, honoring its broadcast
// reference: ffi.MoqVideo.Broadcast / ffi.MoqAudio.Broadcast. A nil or empty reference names this
// broadcast, anything else names a sibling relative to it (e.g. "./source"). Call it on a
// rendition that carries one before SubscribeTrack or FetchGroup, which take a track name rather
// than a rendition: the rendition's Track, or its ID when nil. The rendition-based
// broadcast, anything else names a sibling relative to it (e.g. "./source"). epoch is the same
// rendition's Epoch: a broadcast proven to serve another instance errors instead of resolving,
// and a route without an epoch cannot prove one, so there it is best effort. Call it on a
// rendition that carries a reference before SubscribeTrack or FetchGroup, which take a track name
// rather than a rendition: the rendition's Track, or its ID when nil. The rendition-based
// media.NewTrackConsumer, media.FetchGroup, audio.Subscribe, and video.Subscribe resolve both themselves.
//
// Errors if this broadcast came from a local producer rather than an origin, since a
// standalone broadcast has no sibling to name.
func (b *BroadcastConsumer) Resolve(ctx context.Context, reference *string) (*BroadcastConsumer, error) {
inner, err := b.inner.Resolve(ctx, reference)
func (b *BroadcastConsumer) Resolve(ctx context.Context, reference *string, epoch *string) (*BroadcastConsumer, error) {
inner, err := b.inner.Resolve(ctx, reference, epoch)
if err != nil {
return nil, err
}
Expand Down
7 changes: 7 additions & 0 deletions kt/moq-ffi/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

### Catalog references carry their epoch

`MoqVideo` and `MoqAudio` gain `epoch`, the publisher instance their `broadcast` reference names; it defaults to `null`, so only positional construction changes.
`MoqBroadcastConsumer.resolve` takes the rendition's `epoch` after `reference`; pass it alongside, or `null` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, throw `MoqException.Mux` for a rendition whose broadcast is proven to serve another epoch.
Regenerate the bindings for the changed records and checksums.

### Finished tracks stay until the broadcast ends (#6157)

A finished track, raw or media, now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `MoqBroadcastProducer.finish()` lets go, instead of unlisting when its producer finishes or is released.
Expand Down
6 changes: 6 additions & 0 deletions kt/moq/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Catalog references carry their epoch

`Video` and `Audio` gain `epoch`, the publisher instance their `broadcast` reference names; it defaults to `null`, so only positional construction changes.
`BroadcastConsumer.resolve(reference)` becomes `resolve(reference, epoch)`; pass the rendition's `epoch` alongside its `broadcast`, or `null` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, throw `MoqException.Mux` for a rendition whose broadcast is proven to serve another epoch.

### Finished tracks stay until the broadcast ends (#6157)

A finished track now stays listed, with its catalog rendition and demand, until its broadcast ends or the new `BroadcastProducer.finish()` lets go.
Expand Down
7 changes: 7 additions & 0 deletions py/moq-ffi/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

### Catalog references carry their epoch

`MoqVideo` and `MoqAudio` gain `epoch`, the publisher instance their `broadcast` reference names; it defaults to `None`, so only positional construction changes.
`MoqBroadcastConsumer.resolve` takes the rendition's `epoch` after `reference`; pass it alongside, or `None` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, raise `MoqError.Mux` for a rendition whose broadcast is proven to serve another epoch.
Rebuild or reinstall the complete wheel so its generated Python code and native library match.

### Finished tracks stay until the broadcast ends (#6157)

A finished track, raw or media, now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `MoqBroadcastProducer.finish()` lets go, instead of unlisting when its producer finishes or is released.
Expand Down
6 changes: 6 additions & 0 deletions py/moq-rs/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### Catalog references carry their epoch

`Video` and `Audio` renditions gain `epoch`, the publisher instance their `broadcast` reference names.
`BroadcastConsumer.resolve(reference)` becomes `resolve(reference, epoch)`; pass the rendition's `epoch` alongside its `broadcast`, or `None` to resolve whichever instance answers.
Resolving, and the rendition-based consumers, raise for a rendition whose broadcast is proven to serve another epoch.

### Finished tracks stay until the broadcast ends (#6157)

A finished track now stays listed, with its catalog rendition and demand, until its broadcast closes or the new `BroadcastProducer.finish()` lets go.
Expand Down
17 changes: 10 additions & 7 deletions py/moq-rs/moq/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,22 @@ async def fetch_group(
"""
return GroupConsumer(await self._inner.fetch_group(name, sequence, options))

async def resolve(self, reference: str | None) -> "BroadcastConsumer":
async def resolve(self, reference: str | None, epoch: str | None) -> "BroadcastConsumer":
"""Resolve a catalog rendition's ``broadcast`` reference to the broadcast
serving its track.
``reference`` is ``catalog.video[name].broadcast`` /
``catalog.audio[name].broadcast``: ``None`` or empty names this broadcast,
anything else names a sibling relative to it (e.g. ``./source``). Call it on
a rendition that carries one before :meth:`subscribe_track` or :meth:`fetch_group`,
which take a track name rather than a rendition: the rendition's ``track``, or its
ID when unset. The rendition-based consumers in the media, audio, and video
namespaces resolve both themselves.
anything else names a sibling relative to it (e.g. ``./source``). ``epoch`` is
the same rendition's ``epoch``: a broadcast proven to serve another instance
raises instead of resolving, and a route without an epoch cannot prove one, so
there it is best effort. Call it on a rendition that carries a reference before
:meth:`subscribe_track` or :meth:`fetch_group`, which take a track name rather
than a rendition: the rendition's ``track``, or its ID when unset. The
rendition-based consumers in the media, audio, and video namespaces resolve
both themselves.
Raises if this broadcast came from a local producer rather than an origin,
since a standalone broadcast has no sibling to name.
"""
return BroadcastConsumer(await self._inner.resolve(reference))
return BroadcastConsumer(await self._inner.resolve(reference, epoch))
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ lite-07 stream type here.
- [Rust identity enforcement](/quest/m1/catalog-identity-rs.md) - `moq-mux` refuses a redefined rendition, and every Rust publisher mints a new rendition name for a decoder identity change and updates everything else in place
- [IETF takeover](/quest/m1/ietf-takeover.md) - carry the shared takeover contract through the negotiated IETF epoch extension
- [Identity and recovery guide](/quest/m1/identity-guide.md) - explain pinned catalogs, lazy jobs, takeover, restart and version compatibility
- [Reference epoch bindings](/quest/m1/reference-epoch-bindings.md) - the UniFFI bindings and C ABI expose and honor a catalog reference's optional `epoch`
- [Scope track priority](/quest/m1/track-priority-scope.md) - priority orders one owner's streams, sent and received, and a shared cluster session is fair across tenants
- [Session send target](/quest/m1/probe-target.md) - a session probes up to the sum of its publisher reservations through whichever sender its transport has
- [An evicted group is judged stale](/quest/m1/evicted-group-stale.md) - a handed-out group the cache evicted goes stale once its successor's arrival plus the budget passes, so its stalled stream resets
Expand Down
Loading
Loading