From 7a686a344aff35b5f39bea0b930c791f6b98e4a4 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 18 Oct 2026 22:14:08 -0700 Subject: [PATCH 1/4] quest: claim m1/ffi-shape/stream-producer-name Co-Authored-By: Claude Opus 5.5 From bf29932635285922282beed1ce103b890390fa20 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 18 Oct 2026 22:26:58 -0700 Subject: [PATCH 2/4] feat(ffi)!: fold the container stream importer into ContainerProducer A container recovers its own framing, so MoqMediaContainerProducer already takes chunks split anywhere. MoqMediaContainerStreamProducer and MoqContainerStreamInit were the same importer minus cut/seek and the leading bytes; delete them from moq-ffi and every wrapper. Completes the ffi-shape epic, whose last child settled this name. Co-Authored-By: Claude Opus 5.5 --- cpp/moq/MIGRATE.md | 9 + cpp/moq/test/probe.cpp | 9 +- dart/moq/MIGRATE.md | 12 +- dart/moq/lib/media.dart | 6 - dart/moq/test/moq_test.dart | 10 - dart/moq_ffi/lib/src/moq.dart | 234 +----------------- doc/lib/cpp/index.md | 8 +- doc/lib/dart/index.md | 8 +- doc/lib/go/index.md | 6 +- doc/lib/kt/index.md | 8 +- doc/lib/layers.md | 4 +- doc/lib/py/index.md | 8 +- doc/lib/swift/index.md | 8 +- go/wrapper/MIGRATE.md | 11 +- go/wrapper/README.md | 9 +- go/wrapper/media/media.go | 41 +-- go/wrapper/media/media_test.go | 5 +- kt/moq/MIGRATE.md | 11 +- .../kotlin/dev/moq/media/Media.kt | 4 - .../kotlin/dev/moq/SmokeTest.kt | 3 - py/moq-rs/MIGRATE.md | 11 +- py/moq-rs/README.md | 4 +- py/moq-rs/docs/index.md | 2 - py/moq-rs/moq/media.py | 32 +-- py/moq-rs/tests/test_local.py | 4 - quest/m1/README.md | 1 - quest/m1/auth/bindings.md | 4 - quest/m1/auth/token-in-band.md | 3 +- quest/m1/c/README.md | 4 - quest/m1/c/package.md | 4 - quest/m1/compress/migrate.md | 2 +- quest/m1/ffi-shape/README.md | 91 ------- quest/m1/ffi-shape/stream-producer-name.md | 21 -- quest/m2/uniffi-namespaces.md | 5 +- rs/moq-ffi/MIGRATE.md | 11 +- rs/moq-ffi/src/media.rs | 131 ++-------- rs/moq-ffi/src/origin.rs | 12 +- swift/MIGRATE.md | 11 +- swift/Sources/Moq/Media.swift | 40 +-- swift/Tests/MoqTests/SmokeTests.swift | 1 - 40 files changed, 123 insertions(+), 685 deletions(-) delete mode 100644 quest/m1/ffi-shape/README.md delete mode 100644 quest/m1/ffi-shape/stream-producer-name.md diff --git a/cpp/moq/MIGRATE.md b/cpp/moq/MIGRATE.md index 63ce5456a5b..3911350659c 100644 --- a/cpp/moq/MIGRATE.md +++ b/cpp/moq/MIGRATE.md @@ -4,6 +4,15 @@ How to update your code for each breaking change, newest first. ## Unreleased +### Container byte streams use `MediaContainerProducer` (#PRNUM) + +`moq::MediaContainerStreamProducer` and `moq::ContainerStreamInit` are gone: a container recovers its own framing, so `moq::MediaContainerProducer` takes chunks split anywhere. +Pass empty `data` and write the stream through it. + +```cpp +auto stream = ok(moq::MediaContainerProducer::init(broadcast, {moq::ContainerFormat::kFmp4, {}})); +``` + ### Subscriptions carry group ranges (#5732) `Subscription::group_start` and `group_end` are replaced by `ranges`, a list of `Range` whose ends are an `Anchor` (an absolute group and frame, or a count of groups before the latest), and an optional `order`. diff --git a/cpp/moq/test/probe.cpp b/cpp/moq/test/probe.cpp index cc1086587e7..678b7118f3e 100644 --- a/cpp/moq/test/probe.cpp +++ b/cpp/moq/test/probe.cpp @@ -102,12 +102,9 @@ int main() { auto timebase_owner = ok(moq::BroadcastProducer::init(), "timebase owner"); auto timebase_other = ok(moq::BroadcastProducer::init(), "timebase other"); auto timebase = ok(moq::MediaTimebase::init(timebase_owner), "timebase"); - auto foreign_chunks = moq::MediaContainerProducer::init(timebase_other, {moq::ContainerFormat::kFmp4, {}, timebase}); - CHECK(!foreign_chunks); - CHECK(std::holds_alternative(foreign_chunks.error().get_variant())); - auto foreign_stream = moq::MediaContainerStreamProducer::init(timebase_other, {moq::ContainerFormat::kFmp4, timebase}); - CHECK(!foreign_stream); - CHECK(std::holds_alternative(foreign_stream.error().get_variant())); + auto foreign = moq::MediaContainerProducer::init(timebase_other, {moq::ContainerFormat::kFmp4, {}, timebase}); + CHECK(!foreign); + CHECK(std::holds_alternative(foreign.error().get_variant())); ok(timebase_owner->close(), "close timebase owner"); CHECK(!moq::MediaTimebase::init(timebase_owner)); ok(timebase_other->close(), "close timebase other"); diff --git a/dart/moq/MIGRATE.md b/dart/moq/MIGRATE.md index 965ea3b1cd6..3e3de47c639 100644 --- a/dart/moq/MIGRATE.md +++ b/dart/moq/MIGRATE.md @@ -92,11 +92,15 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. final audio = media.TrackProducer.audio(broadcast: broadcast, target: media.Named(null), init: init); ``` -### Container byte-stream importers take an init record +### Container byte streams use `media.ContainerProducer` (#PRNUM) -`media.ContainerStreamProducer` takes a `ContainerStreamInit` holding the format instead of a bare format. -Its optional `timebase`, also on `ContainerInit`, shares one source's offset across container imports. -Replace `format: ...` with `init: media.ContainerStreamInit(format: ...)`. +`publishContainerStream` has no separate importer: a container recovers its own framing, so `media.ContainerProducer` takes chunks split anywhere. +Pass empty `data` and write the stream through it. +`ContainerInit`'s optional `timebase` shares one source's offset across container imports. + +```dart +final stream = media.ContainerProducer(broadcast: broadcast, init: media.ContainerInit(format: media.ContainerFormat.fmp4, data: Uint8List(0))); +``` ### Timestamps are optional diff --git a/dart/moq/lib/media.dart b/dart/moq/lib/media.dart index 81a7aebd26f..8d391413190 100644 --- a/dart/moq/lib/media.dart +++ b/dart/moq/lib/media.dart @@ -12,9 +12,6 @@ typedef TrackStreamProducer = MoqMediaTrackStreamProducer; /// The write side of a container, which publishes each track it describes. typedef ContainerProducer = MoqMediaContainerProducer; -/// The write side of a container fed a raw byte stream. -typedef ContainerStreamProducer = MoqMediaContainerStreamProducer; - /// The read side of a media track: yields frames with codec metadata in decode order. typedef TrackConsumer = MoqMediaTrackConsumer; @@ -60,9 +57,6 @@ typedef ContainerFormat = MoqContainerFormat; /// A shared source timestamp offset that does not keep its broadcast open. typedef Timebase = MoqMediaTimebase; -/// A byte-stream container format and an optional shared source timebase. -typedef ContainerStreamInit = MoqContainerStreamInit; - /// A container format, its leading bytes, and an optional shared source timebase. typedef ContainerInit = MoqContainerInit; diff --git a/dart/moq/test/moq_test.dart b/dart/moq/test/moq_test.dart index 9a10f776e71..ea34e479247 100644 --- a/dart/moq/test/moq_test.dart +++ b/dart/moq/test/moq_test.dart @@ -34,16 +34,6 @@ void main() { ), throwsA(isA()), ); - expect( - () => moq_media.ContainerStreamProducer( - broadcast: other, - init: moq_media.ContainerStreamInit( - format: moq_media.ContainerFormat.fmp4, - timebase: timebase, - ), - ), - throwsA(isA()), - ); owner.close(); expect( () => moq_media.Timebase(broadcast: owner), diff --git a/dart/moq_ffi/lib/src/moq.dart b/dart/moq_ffi/lib/src/moq.dart index 3f990238d98..8d146fbdf64 100644 --- a/dart/moq_ffi/lib/src/moq.dart +++ b/dart/moq_ffi/lib/src/moq.dart @@ -1419,65 +1419,6 @@ class FfiConverterMoqContainerInit { } } -class MoqContainerStreamInit { - final MoqContainerFormat format; - final MoqMediaTimebase? timebase; - MoqContainerStreamInit({required this.format, this.timebase = null}); -} - -class FfiConverterMoqContainerStreamInit { - static MoqContainerStreamInit lift(RustBuffer buf) { - return FfiConverterMoqContainerStreamInit.read(buf.asUint8List()).value; - } - - static LiftRetVal read(Uint8List buf) { - int new_offset = buf.offsetInBytes; - final format_lifted = FfiConverterMoqContainerFormat.read( - Uint8List.view(buf.buffer, new_offset), - ); - final format = format_lifted.value; - new_offset += format_lifted.bytesRead; - final timebase_lifted = FfiConverterOptionalMoqMediaTimebase.read( - Uint8List.view(buf.buffer, new_offset), - ); - final timebase = timebase_lifted.value; - new_offset += timebase_lifted.bytesRead; - return LiftRetVal( - MoqContainerStreamInit(format: format, timebase: timebase), - new_offset - buf.offsetInBytes, - ); - } - - static RustBuffer lower(MoqContainerStreamInit value) { - final total_length = - FfiConverterMoqContainerFormat.allocationSize(value.format) + - FfiConverterOptionalMoqMediaTimebase.allocationSize(value.timebase) + - 0; - final buf = Uint8List(total_length); - write(value, buf); - return toRustBuffer(buf); - } - - static int write(MoqContainerStreamInit value, Uint8List buf) { - int new_offset = buf.offsetInBytes; - new_offset += FfiConverterMoqContainerFormat.write( - value.format, - Uint8List.view(buf.buffer, new_offset), - ); - new_offset += FfiConverterOptionalMoqMediaTimebase.write( - value.timebase, - Uint8List.view(buf.buffer, new_offset), - ); - return new_offset - buf.offsetInBytes; - } - - static int allocationSize(MoqContainerStreamInit value) { - return FfiConverterMoqContainerFormat.allocationSize(value.format) + - FfiConverterOptionalMoqMediaTimebase.allocationSize(value.timebase) + - 0; - } -} - class MoqDatagram { final int sequence; final int? timestampUs; @@ -9558,112 +9499,6 @@ class FfiConverterMoqMediaContainerProducer { } } -abstract class MoqMediaContainerStreamProducerInterface { - void finish(); - void write({required Uint8List payload}); -} - -final _MoqMediaContainerStreamProducerFinalizer = Finalizer>(( - ptr, -) { - rustCall( - (status) => - uniffi_moq_ffi_fn_free_moqmediacontainerstreamproducer(ptr, status), - ); -}); - -class MoqMediaContainerStreamProducer - implements MoqMediaContainerStreamProducerInterface { - late final Pointer _ptr; - bool _isDisposed = false; - MoqMediaContainerStreamProducer._(this._ptr) { - _MoqMediaContainerStreamProducerFinalizer.attach(this, _ptr, detach: this); - } - MoqMediaContainerStreamProducer({ - required MoqBroadcastProducer broadcast, - required MoqContainerStreamInit init, - }) : _ptr = rustCall( - (status) => - uniffi_moq_ffi_fn_constructor_moqmediacontainerstreamproducer_new( - FfiConverterMoqBroadcastProducer.lower(broadcast), - FfiConverterMoqContainerStreamInit.lower(init), - status, - ), - moqExceptionErrorHandler, - ) { - _MoqMediaContainerStreamProducerFinalizer.attach(this, _ptr, detach: this); - } - factory MoqMediaContainerStreamProducer.lift(Pointer ptr) { - return MoqMediaContainerStreamProducer._(ptr); - } - Pointer uniffiClonePointer() { - if (_isDisposed) { - throw StateError("Object has already been disposed"); - } - return rustCall( - (status) => - uniffi_moq_ffi_fn_clone_moqmediacontainerstreamproducer(_ptr, status), - ); - } - - void dispose() { - if (_isDisposed) { - return; - } - _isDisposed = true; - _MoqMediaContainerStreamProducerFinalizer.detach(this); - rustCall( - (status) => - uniffi_moq_ffi_fn_free_moqmediacontainerstreamproducer(_ptr, status), - ); - } - - void finish() { - return rustCall((status) { - uniffi_moq_ffi_fn_method_moqmediacontainerstreamproducer_finish( - uniffiClonePointer(), - status, - ); - }, moqExceptionErrorHandler); - } - - void write({required Uint8List payload}) { - return rustCall((status) { - uniffi_moq_ffi_fn_method_moqmediacontainerstreamproducer_write( - uniffiClonePointer(), - FfiConverterUint8List.lower(payload), - status, - ); - }, moqExceptionErrorHandler); - } -} - -class FfiConverterMoqMediaContainerStreamProducer { - static MoqMediaContainerStreamProducer lift(Pointer ptr) { - return MoqMediaContainerStreamProducer.lift(ptr); - } - - static Pointer lower(MoqMediaContainerStreamProducer value) { - return value.uniffiClonePointer(); - } - - static int allocationSize(MoqMediaContainerStreamProducer value) { - return 8; - } - - static LiftRetVal read(Uint8List buf) { - final handle = buf.buffer.asByteData(buf.offsetInBytes).getInt64(0); - final pointer = Pointer.fromAddress(handle); - return LiftRetVal(MoqMediaContainerStreamProducer.lift(pointer), 8); - } - - static int write(MoqMediaContainerStreamProducer value, Uint8List buf) { - final handle = lower(value); - buf.buffer.asByteData(buf.offsetInBytes).setInt64(0, handle.address); - return 8; - } -} - abstract class MoqMediaGroupConsumerInterface { void cancel(); Future next(); @@ -16014,49 +15849,6 @@ external void uniffi_moq_ffi_fn_method_moqmediacontainerproducer_write( Pointer uniffiStatus, ); -@Native Function(Pointer, Pointer)>( - assetId: _uniffiAssetId, -) -external Pointer uniffi_moq_ffi_fn_clone_moqmediacontainerstreamproducer( - Pointer handle, - Pointer uniffiStatus, -); - -@Native, Pointer)>( - assetId: _uniffiAssetId, -) -external void uniffi_moq_ffi_fn_free_moqmediacontainerstreamproducer( - Pointer handle, - Pointer uniffiStatus, -); - -@Native< - Pointer Function(Pointer, RustBuffer, Pointer) ->(assetId: _uniffiAssetId) -external Pointer -uniffi_moq_ffi_fn_constructor_moqmediacontainerstreamproducer_new( - Pointer broadcast, - RustBuffer init, - Pointer uniffiStatus, -); - -@Native, Pointer)>( - assetId: _uniffiAssetId, -) -external void uniffi_moq_ffi_fn_method_moqmediacontainerstreamproducer_finish( - Pointer ptr, - Pointer uniffiStatus, -); - -@Native, RustBuffer, Pointer)>( - assetId: _uniffiAssetId, -) -external void uniffi_moq_ffi_fn_method_moqmediacontainerstreamproducer_write( - Pointer ptr, - RustBuffer payload, - Pointer uniffiStatus, -); - @Native Function(Pointer, Pointer)>( assetId: _uniffiAssetId, ) @@ -18076,14 +17868,6 @@ external int uniffi_moq_ffi_checksum_method_moqmediacontainerproducer_seek(); @Native(assetId: _uniffiAssetId) external int uniffi_moq_ffi_checksum_method_moqmediacontainerproducer_write(); -@Native(assetId: _uniffiAssetId) -external int -uniffi_moq_ffi_checksum_method_moqmediacontainerstreamproducer_finish(); - -@Native(assetId: _uniffiAssetId) -external int -uniffi_moq_ffi_checksum_method_moqmediacontainerstreamproducer_write(); - @Native(assetId: _uniffiAssetId) external int uniffi_moq_ffi_checksum_method_moqmediagroupconsumer_cancel(); @@ -18461,10 +18245,6 @@ external int uniffi_moq_ffi_checksum_constructor_moqmediacatalogproducer_new(); external int uniffi_moq_ffi_checksum_constructor_moqmediacontainerproducer_new(); -@Native(assetId: _uniffiAssetId) -external int -uniffi_moq_ffi_checksum_constructor_moqmediacontainerstreamproducer_new(); - @Native(assetId: _uniffiAssetId) external int uniffi_moq_ffi_checksum_constructor_moqmediagroupconsumer_fetch(); @@ -18745,15 +18525,7 @@ void _checkApiChecksums() { throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); } if (uniffi_moq_ffi_checksum_method_moqmediacontainerproducer_write() != - 44490) { - throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); - } - if (uniffi_moq_ffi_checksum_method_moqmediacontainerstreamproducer_finish() != - 29671) { - throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); - } - if (uniffi_moq_ffi_checksum_method_moqmediacontainerstreamproducer_write() != - 13648) { + 17951) { throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); } if (uniffi_moq_ffi_checksum_method_moqmediagroupconsumer_cancel() != 4852) { @@ -19148,10 +18920,6 @@ void _checkApiChecksums() { 41369) { throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); } - if (uniffi_moq_ffi_checksum_constructor_moqmediacontainerstreamproducer_new() != - 54958) { - throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); - } if (uniffi_moq_ffi_checksum_constructor_moqmediagroupconsumer_fetch() != 32566) { throw UniffiInternalError.panicked("UniFFI API checksum mismatch"); diff --git a/doc/lib/cpp/index.md b/doc/lib/cpp/index.md index 3447337708c..9e7a9fdd1f6 100644 --- a/doc/lib/cpp/index.md +++ b/doc/lib/cpp/index.md @@ -105,10 +105,10 @@ when its session does. `MediaTrackConsumer` reads in decode order. For arrival-order reads, decode each group from `TrackConsumer::recv_group` with `moq::MediaGroupConsumer::init(group, container)`; frames carry container media time as they land. -Share `moq::MediaTimebase::init(broadcast)` through container init records when several -imports use one source timeline. `MediaContainerStreamProducer::init` takes -`ContainerStreamInit`; omitting its timebase keeps an independent offset. A timebase -belongs to its broadcast and does not keep it open. +Share `moq::MediaTimebase::init(broadcast)` through `ContainerInit` when several imports +use one source timeline; omitting it keeps an independent offset. A timebase belongs to +its broadcast and does not keep it open. `MediaContainerProducer` takes chunks split +anywhere, so a raw byte stream needs no other importer. ```cpp // Publish encoded frames, or raw pixels with the codec inside the binding. diff --git a/doc/lib/dart/index.md b/doc/lib/dart/index.md index c797e547eaa..91326288472 100644 --- a/doc/lib/dart/index.md +++ b/doc/lib/dart/index.md @@ -23,10 +23,10 @@ Raw tracks with a `null` timescale are untimed on both publish and receive. Whole-frame media writes require caller time; container imports keep their own timeline handling. Timed raw/data tracks require caller-supplied timestamps. Use `CatalogProducer.now()` to stamp a locally created event on the broadcast clock; reading it fixes that clock for later media producers. -Share `media.Timebase(broadcast: ...)` through container init records when several -imports use one source timeline. `ContainerStreamProducer` takes `ContainerStreamInit`; -omitting its timebase keeps an independent offset. A timebase belongs to its broadcast -and does not keep it open. +Share `media.Timebase(broadcast: ...)` through `ContainerInit` when several imports use +one source timeline; omitting it keeps an independent offset. A timebase belongs to its +broadcast and does not keep it open. `ContainerProducer` takes chunks split anywhere, +so a raw byte stream needs no other importer. `media.CatalogConsumer.subscribe`, `media.TrackConsumer.subscribe`, and `media.GroupConsumer.fetch` construct the read side from a broadcast; the last two take a catalog `media.Rendition` and follow its broadcast and track themselves. For arrival-order reads, decode each group from diff --git a/doc/lib/go/index.md b/doc/lib/go/index.md index ed9ba32e6f3..e960e656e10 100644 --- a/doc/lib/go/index.md +++ b/doc/lib/go/index.md @@ -24,10 +24,10 @@ and the JSON producers take a final `*time.Duration` timestamp argument (`nil` f Whole-frame media writes require caller time; container imports keep their own timeline handling. Timed raw/data tracks require caller-supplied timestamps. Use `CatalogProducer.Now()` to stamp a locally created event on the broadcast clock; reading it fixes that clock for later media producers. -Share `media.NewTimebase(broadcast)` through container init records when several imports -use one source timeline. `NewContainerStreamProducer` takes `ContainerStreamInit`; -omitting its timebase keeps an independent offset. Timebases belong to one broadcast +Share `media.NewTimebase(broadcast)` through `ContainerInit` when several imports use one +source timeline; omitting it keeps an independent offset. Timebases belong to one broadcast and do not keep it open; release the handle with `Close` on the calling goroutine. +`NewContainerProducer` takes chunks split anywhere, so a raw byte stream needs no other importer. For arrival-order reads, decode each group from `moq.TrackConsumer.RecvGroup` with `media.NewGroupConsumer`; frames carry container media time as they land. `media.FetchGroup` fetches and decodes one past group. diff --git a/doc/lib/kt/index.md b/doc/lib/kt/index.md index 581c0f5a6a3..2f147a60fae 100644 --- a/doc/lib/kt/index.md +++ b/doc/lib/kt/index.md @@ -22,10 +22,10 @@ Raw tracks with a `null` timescale are untimed on both publish and receive. Whole-frame media writes require caller time; container imports keep their own timeline handling. Timed raw/data tracks require caller-supplied timestamps. Use `CatalogProducer.now()` to stamp a locally created event on the broadcast clock; reading it fixes that clock for later media producers. -Share `Timebase(broadcast)` through container init records when several imports use -one source timeline. `ContainerStreamProducer` takes `ContainerStreamInit`; omitting -its timebase keeps an independent offset. A timebase belongs to its broadcast and -does not keep it open. +Share `Timebase(broadcast)` through `ContainerInit` when several imports use one source +timeline; omitting it keeps an independent offset. A timebase belongs to its broadcast +and does not keep it open. `ContainerProducer` takes chunks split anywhere, so a raw +byte stream needs no other importer. Construct readers with `CatalogConsumer.subscribe`, `TrackConsumer.subscribe`, or `GroupConsumer.fetch`; the last two take a catalog `Rendition` and follow its broadcast and track themselves. For arrival-order reads, decode each group from diff --git a/doc/lib/layers.md b/doc/lib/layers.md index 8c6b3326679..8221c0dfcda 100644 --- a/doc/lib/layers.md +++ b/doc/lib/layers.md @@ -46,8 +46,8 @@ Sessions, origins, broadcasts, tracks, and groups: `Client`, `Server`, The catalog, encoded-media imports, and container-decoded reads, merging Rust's hang and moq-mux: `CatalogProducer`, `CatalogConsumer`, `Timebase`, -`TrackProducer`, `TrackStreamProducer`, `ContainerProducer`, -`ContainerStreamProducer`, `TrackConsumer`, and `GroupConsumer`. +`TrackProducer`, `TrackStreamProducer`, `ContainerProducer`, `TrackConsumer`, +and `GroupConsumer`. | Language | Module | Example | | --- | --- | --- | diff --git a/doc/lib/py/index.md b/doc/lib/py/index.md index fb21d81ace4..172383272cd 100644 --- a/doc/lib/py/index.md +++ b/doc/lib/py/index.md @@ -17,10 +17,10 @@ x64. Use `Named(name)` or `Requested(request)` as the target for `TrackProducer.audio` / `.video`. `CatalogProducer(broadcast)` holds the broadcast weakly and owns catalog properties and sections; its writes fail with `Error.Closed` after the broadcast closes or is released. -Share `media.Timebase(broadcast)` through container init records when several imports -use one source timeline. `ContainerStreamProducer` takes `ContainerStreamInit`; -omitting its timebase keeps an independent offset. A timebase belongs to its broadcast -and does not keep it open. +Share `media.Timebase(broadcast)` through `ContainerInit` when several imports use one +source timeline; omitting it keeps an independent offset. A timebase belongs to its +broadcast and does not keep it open. `ContainerProducer` takes chunks split anywhere, +so a raw byte stream needs no other importer. `MediaFrame.timestamp`, media writes, and `flush` use `datetime.timedelta`. A missing data timestamp stays untimed; the library never substitutes zero or now. Raw tracks with a `None` timescale are untimed on both publish and receive. diff --git a/doc/lib/swift/index.md b/doc/lib/swift/index.md index cba77507d7d..759bd464dba 100644 --- a/doc/lib/swift/index.md +++ b/doc/lib/swift/index.md @@ -23,10 +23,10 @@ Raw tracks with a `nil` timescale are untimed on both publish and receive. Whole-frame media writes require caller time; container imports keep their own timeline handling. Timed raw/data tracks require caller-supplied timestamps. Use `Media.CatalogProducer.now()` to stamp a locally created event on the broadcast clock; reading it fixes that clock for later media producers. -Share `Media.Timebase(broadcast:)` through container init records when several imports -use one source timeline. `ContainerStreamProducer` takes `ContainerStreamInit`; -omitting its timebase keeps an independent offset. A timebase belongs to its broadcast -and does not keep it open. +Share `Media.Timebase(broadcast:)` through `ContainerInit` when several imports use one +source timeline; omitting it keeps an independent offset. A timebase belongs to its +broadcast and does not keep it open. `ContainerProducer` takes chunks split anywhere, +so a raw byte stream needs no other importer. For arrival-order reads, decode each group from `TrackConsumer.recvGroup()` with `Media.GroupConsumer(group:container:)`; frames carry container media time as they land. diff --git a/go/wrapper/MIGRATE.md b/go/wrapper/MIGRATE.md index 8689478554b..eb71e8cb9e1 100644 --- a/go/wrapper/MIGRATE.md +++ b/go/wrapper/MIGRATE.md @@ -95,10 +95,15 @@ JSON and opaque data tracks live in `moq.dev/moq/json` and `moq.dev/moq/flate`, audio, err := media.NewAudioTrackProducer(broadcast, media.Named{}, media.AudioInit{Format: media.AudioFormatOpus, Data: opusHead}) ``` -### Container byte-stream importers take an init record +### Container byte streams use `media.NewContainerProducer` (#PRNUM) -`media.NewContainerStreamProducer` takes a `ContainerStreamInit` holding the format instead of a bare format. -Its optional `Timebase`, also on `ContainerInit`, shares one source's offset across container imports. +`BroadcastProducer.PublishContainerStream` has no separate importer: a container recovers its own framing, so `media.NewContainerProducer` takes chunks split anywhere. +Leave `Data` empty and write the stream through it. +`ContainerInit`'s optional `Timebase` shares one source's offset across container imports. + +```go +stream, err := media.NewContainerProducer(broadcast, media.ContainerInit{Format: media.ContainerFormatFmp4}) +``` ### Durations are `time.Duration` diff --git a/go/wrapper/README.md b/go/wrapper/README.md index 92ad1462753..f109e62cb54 100644 --- a/go/wrapper/README.md +++ b/go/wrapper/README.md @@ -78,11 +78,10 @@ Media lives in `moq.dev/moq/media`. `NewAudioTrackProducer` / `NewVideoTrackProd take a broadcast, a `Named` or `Requested` target, and an `AudioInit` / `VideoInit`. A `Named` target chooses a track name or lets the importer derive one; a `Requested` target takes over a subscriber's pending request. A duplicate name fails. -`VideoInit.Hint` seeds fields the bitstream cannot supply. `NewContainerProducer` / -`NewContainerStreamProducer` demux whole chunks or a byte stream into their own tracks, -using `ContainerInit` or `ContainerStreamInit`. Share `NewTimebase(broadcast)` in these -records for containers on one source timeline; omitting it gives each an independent -offset. Timebases belong to one broadcast and do not keep it open. Call `Close` to +`VideoInit.Hint` seeds fields the bitstream cannot supply. `NewContainerProducer` demuxes +a container from chunks split anywhere, such as a byte stream, into its own tracks. +Share `NewTimebase(broadcast)` in its `ContainerInit` for containers on one source +timeline; omitting it gives each an independent offset. Timebases belong to one broadcast and do not keep it open. Call `Close` to release the timebase handle on the calling goroutine. `NewCatalogProducer` holds its broadcast weakly and owns catalog properties and sections. `NewCatalogConsumer`, `NewTrackConsumer`, and `FetchGroup` read diff --git a/go/wrapper/media/media.go b/go/wrapper/media/media.go index 2b18ce0b516..16124e6677e 100644 --- a/go/wrapper/media/media.go +++ b/go/wrapper/media/media.go @@ -83,14 +83,6 @@ type ContainerInit struct { Timebase *Timebase } -// ContainerStreamInit describes a byte-stream container and an optional shared timebase. -type ContainerStreamInit struct { - // Format selects the container parser. - Format ContainerFormat - // Timebase shares a source offset, or nil for an independent offset. - Timebase *Timebase -} - // MediaFrame is a container-decoded payload, presentation timestamp, and keyframe flag. type MediaFrame struct { Payload []byte @@ -205,7 +197,7 @@ func NewVideoTrackStreamProducer(broadcast *moq.BroadcastProducer, target Target return &TrackStreamProducer{inner: inner}, nil } -// NewContainerProducer imports complete container chunks. +// NewContainerProducer imports a container from chunks split anywhere, such as a byte stream. func NewContainerProducer(broadcast *moq.BroadcastProducer, init ContainerInit) (*ContainerProducer, error) { var timebase **ffi.MoqMediaTimebase if init.Timebase != nil { @@ -218,19 +210,6 @@ func NewContainerProducer(broadcast *moq.BroadcastProducer, init ContainerInit) return &ContainerProducer{inner: inner}, nil } -// NewContainerStreamProducer imports a container byte stream. -func NewContainerStreamProducer(broadcast *moq.BroadcastProducer, init ContainerStreamInit) (*ContainerStreamProducer, error) { - var timebase **ffi.MoqMediaTimebase - if init.Timebase != nil { - timebase = &init.Timebase.inner - } - inner, err := ffi.NewMoqMediaContainerStreamProducer(bridge.BroadcastProducer(broadcast), ffi.MoqContainerStreamInit{Format: init.Format, Timebase: timebase}) - if err != nil { - return nil, err - } - return &ContainerStreamProducer{inner: inner}, nil -} - // NewCatalogConsumer subscribes to broadcast's catalog snapshots. func NewCatalogConsumer(ctx context.Context, broadcast *moq.BroadcastConsumer) (*CatalogConsumer, error) { inner, err := ffi.MoqMediaCatalogConsumerSubscribe(ctx, bridge.BroadcastConsumer(broadcast)) @@ -428,7 +407,7 @@ type ContainerProducer struct { inner *ffi.MoqMediaContainerProducer } -// Write pushes a whole chunk of container bytes. +// Write pushes container bytes; the container recovers its own framing. func (c *ContainerProducer) Write(payload []byte) error { return c.inner.Write(payload) } @@ -450,22 +429,6 @@ func (c *ContainerProducer) Finish() error { return c.inner.Finish() } -// ContainerStreamProducer publishes a container fed by a raw byte stream, which -// recovers its own framing. -type ContainerStreamProducer struct { - inner *ffi.MoqMediaContainerStreamProducer -} - -// Write pushes raw container bytes; chunk boundaries don't matter. -func (c *ContainerStreamProducer) Write(payload []byte) error { - return c.inner.Write(payload) -} - -// Finish finishes every track this container publishes. -func (c *ContainerStreamProducer) Finish() error { - return c.inner.Finish() -} - // TrackStreamProducer feeds a raw encoder byte stream; whole frames are emitted // as they complete. type TrackStreamProducer struct { diff --git a/go/wrapper/media/media_test.go b/go/wrapper/media/media_test.go index 58a0ffa8a88..84713fa0c90 100644 --- a/go/wrapper/media/media_test.go +++ b/go/wrapper/media/media_test.go @@ -59,10 +59,7 @@ func TestContainerTimebaseBelongsToOneBroadcast(t *testing.T) { } defer timebase.Close() if _, err := media.NewContainerProducer(other, media.ContainerInit{Format: media.ContainerFormatFmp4, Timebase: timebase}); !errors.Is(err, moq.ErrCodec) { - t.Fatalf("foreign chunk timebase: %v", err) - } - if _, err := media.NewContainerStreamProducer(other, media.ContainerStreamInit{Format: media.ContainerFormatFmp4, Timebase: timebase}); !errors.Is(err, moq.ErrCodec) { - t.Fatalf("foreign stream timebase: %v", err) + t.Fatalf("foreign timebase: %v", err) } if err := owner.Close(); err != nil { t.Fatal(err) diff --git a/kt/moq/MIGRATE.md b/kt/moq/MIGRATE.md index 2552722b9e0..f0c4db02068 100644 --- a/kt/moq/MIGRATE.md +++ b/kt/moq/MIGRATE.md @@ -104,10 +104,15 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. val audio = dev.moq.media.TrackProducer.audio(broadcast, Named(null), AudioInit(format = AudioFormat.OPUS, data = opusHead)) ``` -### Container byte-stream importers take an init record +### Container byte streams use `ContainerProducer` (#PRNUM) -`ContainerStreamProducer` takes a `ContainerStreamInit` holding the format instead of a bare format. -Its optional `timebase`, also on `ContainerInit`, shares one source's offset across container imports. +`BroadcastProducer.publishContainerStream` has no separate importer: a container recovers its own framing, so `dev.moq.media.ContainerProducer` takes chunks split anywhere. +Pass empty `data` and write the stream through it. +`ContainerInit`'s optional `timebase` shares one source's offset across container imports. + +```kotlin +val stream = ContainerProducer(broadcast, ContainerInit(ContainerFormat.FMP4, byteArrayOf(), null)) +``` ### Timestamps are optional diff --git a/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/media/Media.kt b/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/media/Media.kt index a76c9c30717..3c4fa65779b 100644 --- a/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/media/Media.kt +++ b/kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/media/Media.kt @@ -19,8 +19,6 @@ typealias TrackProducer = uniffi.moq.MoqMediaTrackProducer typealias TrackStreamProducer = uniffi.moq.MoqMediaTrackStreamProducer /** The write side of a container, which publishes each track it describes. */ typealias ContainerProducer = uniffi.moq.MoqMediaContainerProducer -/** The write side of a container fed a raw byte stream. */ -typealias ContainerStreamProducer = uniffi.moq.MoqMediaContainerStreamProducer /** The read side of a media track: yields frames with codec metadata in decode order. */ typealias TrackConsumer = uniffi.moq.MoqMediaTrackConsumer /** A finite fetched media group: yields container-decoded frames until the group ends. */ @@ -49,8 +47,6 @@ typealias AudioInit = uniffi.moq.MoqAudioInit typealias VideoInit = uniffi.moq.MoqVideoInit /** A shared source timestamp offset that does not keep its broadcast open. */ typealias Timebase = uniffi.moq.MoqMediaTimebase -/** A byte-stream container format and an optional shared source timebase. */ -typealias ContainerStreamInit = uniffi.moq.MoqContainerStreamInit /** A container format, its leading bytes, and an optional shared source timebase. */ typealias ContainerInit = uniffi.moq.MoqContainerInit /** The catalog description of an audio track: codec, sample rate, channels, whether it is enabled, and container. */ diff --git a/kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt b/kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt index 1b22b33f62f..21137ddfa6a 100644 --- a/kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt +++ b/kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt @@ -72,9 +72,6 @@ class SmokeTest { assertFailsWith { ContainerProducer(other, ContainerInit(ContainerFormat.FMP4, byteArrayOf(), timebase)) } - assertFailsWith { - ContainerStreamProducer(other, ContainerStreamInit(ContainerFormat.FMP4, timebase)) - } owner.end() assertFailsWith { Timebase(owner) } } diff --git a/py/moq-rs/MIGRATE.md b/py/moq-rs/MIGRATE.md index 980942e7d1e..9ead72bf8d4 100644 --- a/py/moq-rs/MIGRATE.md +++ b/py/moq-rs/MIGRATE.md @@ -96,10 +96,15 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. audio = moq.media.TrackProducer.audio(broadcast, moq.media.AudioInit(format=moq.media.AudioFormat.OPUS, data=opus_head)) ``` -### Container byte-stream importers take an init record +### Container byte streams use `moq.media.ContainerProducer` (#PRNUM) -Wrap the format passed to `moq.media.ContainerStreamProducer` in a `moq.media.ContainerStreamInit`. -Its optional `timebase`, also on `ContainerInit`, shares one source's offset across container imports. +`BroadcastProducer.publish_container_stream` has no separate importer: a container recovers its own framing, so `moq.media.ContainerProducer` takes chunks split anywhere. +Pass empty `data` and write the stream through it. +`ContainerInit`'s optional `timebase` shares one source's offset across container imports. + +```python +stream = moq.media.ContainerProducer(broadcast, moq.media.ContainerInit(moq.media.ContainerFormat.FMP4, b"")) +``` ### Durations are `timedelta` diff --git a/py/moq-rs/README.md b/py/moq-rs/README.md index c6c6b93da10..54d3f611be6 100644 --- a/py/moq-rs/README.md +++ b/py/moq-rs/README.md @@ -184,8 +184,8 @@ client = moq.Client( A `Named(name)` target chooses a name; `Named()` derives a unique name from the format. `Requested(request)` takes over a pending subscriber request, whose name is already fixed. - `media.TrackStreamProducer.video(...)` infers video frame boundaries from a byte stream. -- `media.ContainerProducer(broadcast, ContainerInit(...))` demuxes complete container chunks; - `media.ContainerStreamProducer(broadcast, ContainerStreamInit(...))` recovers framing from a byte stream. +- `media.ContainerProducer(broadcast, ContainerInit(...))` demuxes a container from chunks split anywhere, + so it also takes a raw byte stream. Share `media.Timebase(broadcast)` in the init records for containers on one source timeline; omitting it gives each container an independent offset. Timebases belong to one broadcast and do not keep it open. diff --git a/py/moq-rs/docs/index.md b/py/moq-rs/docs/index.md index 99ecfc34f6d..5e32dc7a299 100644 --- a/py/moq-rs/docs/index.md +++ b/py/moq-rs/docs/index.md @@ -120,9 +120,7 @@ Every importer takes a broadcast; single-track imports choose a `Named` or `Requ TrackProducer TrackStreamProducer ContainerProducer - ContainerStreamProducer ContainerInit - ContainerStreamInit Timebase TrackConsumer GroupConsumer diff --git a/py/moq-rs/moq/media.py b/py/moq-rs/moq/media.py index 171b7ee42a8..a160de938f2 100644 --- a/py/moq-rs/moq/media.py +++ b/py/moq-rs/moq/media.py @@ -23,12 +23,10 @@ ) from moq_ffi import ( MoqContainerInit, - MoqContainerStreamInit, MoqError, MoqMediaCatalogConsumer, MoqMediaCatalogProducer, MoqMediaContainerProducer, - MoqMediaContainerStreamProducer, MoqMediaFrame, MoqMediaGroupConfig, MoqMediaGroupConsumer, @@ -79,17 +77,6 @@ def _ffi(self) -> MoqContainerInit: ) -@dataclass(frozen=True) -class ContainerStreamInit: - """A byte-stream container format and an optional shared source timebase.""" - - format: ContainerFormat - timebase: Timebase | None = field(default=None, kw_only=True) - - def _ffi(self) -> MoqContainerStreamInit: - return MoqContainerStreamInit(format=self.format, timebase=self.timebase._inner if self.timebase else None) - - @dataclass(frozen=True) class Named: """Publish a new track with a chosen name, or a format-derived unique name.""" @@ -226,7 +213,7 @@ def __init__(self, broadcast: BroadcastProducer, init: ContainerInit) -> None: self._inner = MoqMediaContainerProducer(broadcast._inner, init._ffi()) def write(self, payload: bytes) -> None: - """Write a whole chunk of container bytes.""" + """Write container bytes; the container recovers its own framing, so chunks may split anywhere.""" self._inner.write(payload) def cut(self) -> None: @@ -247,21 +234,6 @@ def finish(self) -> None: self._inner.finish() -class ContainerStreamProducer: - """Publish a container fed by a raw byte stream, which recovers its own framing.""" - - def __init__(self, broadcast: BroadcastProducer, init: ContainerStreamInit) -> None: - self._inner = MoqMediaContainerStreamProducer(broadcast._inner, init._ffi()) - - def write(self, payload: bytes) -> None: - """Push raw container bytes; chunk boundaries don't matter.""" - self._inner.write(payload) - - def finish(self) -> None: - """Finish every track this container publishes.""" - self._inner.finish() - - class TrackStreamProducer: """Wraps MoqMediaTrackStreamProducer: feed a raw byte stream (e.g. Annex-B H.264) and let the importer infer frame boundaries. @@ -464,7 +436,6 @@ async def catalog(broadcast: BroadcastConsumer) -> Catalog: "TrackProducer", "TrackStreamProducer", "ContainerProducer", - "ContainerStreamProducer", "TrackConsumer", "GroupConsumer", "Audio", @@ -480,7 +451,6 @@ async def catalog(broadcast: BroadcastConsumer) -> Catalog: "AudioInit", "VideoInit", "ContainerInit", - "ContainerStreamInit", "Timebase", "catalog", ] diff --git a/py/moq-rs/tests/test_local.py b/py/moq-rs/tests/test_local.py index c8bbdc650ed..d0792df5ac1 100644 --- a/py/moq-rs/tests/test_local.py +++ b/py/moq-rs/tests/test_local.py @@ -1579,10 +1579,6 @@ def test_container_timebase_belongs_to_one_broadcast(): moq.media.ContainerProducer( other, moq.media.ContainerInit(moq.media.ContainerFormat.FMP4, b"", timebase=timebase) ) - with pytest.raises(moq.Error.Codec, match="another broadcast"): - moq.media.ContainerStreamProducer( - other, moq.media.ContainerStreamInit(moq.media.ContainerFormat.FMP4, timebase=timebase) - ) owner.close() with pytest.raises(moq.Error.Closed): moq.media.Timebase(owner) diff --git a/quest/m1/README.md b/quest/m1/README.md index e80ea6efb2c..1fb1394c7dc 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -64,7 +64,6 @@ lands before the cut. - [Compressed tracks](/quest/m1/compress/README.md) - a track flagged `compress` is DEFLATEd per group by moq-net, forwarded compressed, and inflated once on the relay for peers that cannot signal it; `catalog.json.z` and moq-flate go away - [Moxygen minimal interop](/quest/m1/smoke-moxygen.md) - waiting on Moxygen to send a registered filter type, then the smoke lane stops hiding its failure - [Claim answer epochs](/quest/m1/claim-answer-epochs.md) - a claim answers each output by publishing it at its exact path under its own epoch, so a restarted output never reaches a returning reader as the old one's cache -- [FFI shape](/quest/m1/ffi-shape/README.md) - the bindings mirror Rust's layers: net at the root, then media, json, flate, audio, and video namespaces built from the handle below - [SUBSCRIBE_DROP](/quest/m1/subscribe-drop.md) - every stream group in a lite subscription arrives or is dropped by name, and lite-07 drops its stream count for it - [Subscribe ranges](/quest/m1/subscribe-ranges/README.md) - a lite-07 SUBSCRIBE asks for past and live ranges with absolute or relative ends, in either order, and replaces FETCH; merged ranges never starve a subscriber; relays fill misses by range, including over moq-transport - [More tests under load](/quest/m1/test-flakes-2/README.md) - the second round of load-only failures, one quest per flake, fixed at the cause diff --git a/quest/m1/auth/bindings.md b/quest/m1/auth/bindings.md index 8395c24771b..6b22c26950e 100644 --- a/quest/m1/auth/bindings.md +++ b/quest/m1/auth/bindings.md @@ -43,7 +43,3 @@ export the experimental Rust request hook through the bindings here. Additive. Decided in the 2026-09-30 audit: libmoq is frozen, so the C surface comes from moq-ffi rather than new `moq_session_auth_*` calls. - -## Required - -- [FFI shape](/quest/m1/ffi-shape/README.md) - reshapes the moq-ffi session and wrappers this edits, so the wrappers break once diff --git a/quest/m1/auth/token-in-band.md b/quest/m1/auth/token-in-band.md index c6ffe22c3c2..f6ed65ecb35 100644 --- a/quest/m1/auth/token-in-band.md +++ b/quest/m1/auth/token-in-band.md @@ -25,7 +25,7 @@ already carries the full pattern grant. how cluster dial targets keep their per-peer credential, and per-dial extras use the session's `auth().add()` once connected. moq-ffi gains a `tokens` field on the `MoqClientConfig` record that - [FFI shape](/quest/m1/ffi-shape/README.md) (#4697) puts in place of every + the FFI shape (#4697) put in place of every `MoqClient` setter, mirroring `moq_tokio::connect::Config`, not a new `set_tokens` setter (mirrored in the wrappers, and reaching the generated C and C++ bindings and OBS through the generated C++) and `js/net`'s `connect` @@ -81,6 +81,5 @@ Additive. ## Required -- [FFI shape](/quest/m1/ffi-shape/README.md) - puts the `MoqClientConfig` record in place that `tokens` extends, so the wrappers break once - [Bindings](/quest/m1/auth/bindings.md) - supplies the client surface the new token setters sit beside diff --git a/quest/m1/c/README.md b/quest/m1/c/README.md index debcba5abae..ed703acd670 100644 --- a/quest/m1/c/README.md +++ b/quest/m1/c/README.md @@ -54,7 +54,3 @@ That change owns its C tests and `MIGRATE.md` entries; other API reshaping stays - [moq-c package](/quest/m1/c/package.md) - the generated header ships as `moq-c` 0.8.0 with `moq::c`, pkg-config, and a release workflow - [C consumers](/quest/m1/c/consumers.md) - the C interop client and `doc/lib/c` samples move onto the generated API - -## Related - -- [FFI shape](/quest/m1/ffi-shape/README.md) - reshapes moq-ffi, which the generated C then follows for free diff --git a/quest/m1/c/package.md b/quest/m1/c/package.md index 310b6ed4159..f263341e818 100644 --- a/quest/m1/c/package.md +++ b/quest/m1/c/package.md @@ -31,7 +31,3 @@ under the same names. - The Cross-Package Sync rows that name the hand-written `rs/moq-c` (as the target of `rs/moq-ffi` changes, and its `moq.h` C ABI) point at the generated package instead; update `AGENTS.md` in this quest. - -## Required - -- [FFI shape](/quest/m1/ffi-shape/README.md) - moq-c 0.8.0 ships the reshaped moq-ffi, so C breaks once diff --git a/quest/m1/compress/migrate.md b/quest/m1/compress/migrate.md index cbe866cd333..ada8ad631ea 100644 --- a/quest/m1/compress/migrate.md +++ b/quest/m1/compress/migrate.md @@ -31,7 +31,7 @@ See the [epic](/quest/m1/compress/README.md) for the decisions. compress by default (maintainer, 2026-10-17: "always useful"): the default lives where a track is created: moq-mux's JSON helpers and the docs' JSON examples set `compress: true`. `Producer::new(track, config)` keeps - wrapping a caller-built track, per [FFI shape](/quest/m1/ffi-shape/README.md), + wrapping a caller-built track, per `rs/moq-ffi/AGENTS.md`'s layers, and its docs say to set `compress` on that `Info`. Delete `rs/moq-mux/src/binary.rs` and its users; opaque bytes are a plain track. - Delete `rs/moq-flate`, `js/flate`, `rs/hang/src/catalog/compression.rs`, diff --git a/quest/m1/ffi-shape/README.md b/quest/m1/ffi-shape/README.md deleted file mode 100644 index 440fff5bfc3..00000000000 --- a/quest/m1/ffi-shape/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# The bindings mirror Rust's layers - -## Goal - -A binding consumer finds each layer where Rust keeps it: moq-net at the root, -and `media`, `json`, `flate`, `audio`, and `video` as their own namespaces, each type -constructed from the lower-layer handle it wraps. `BroadcastProducer` and -`BroadcastConsumer` stop carrying every layer's verbs, and every moq-ffi type -and verb maps to a Rust one. A docs page shows the layers in each language. - -## Plan - -The line landed on `main` in #4519 (2026-10-09) with its json/flate, net, -media, and request-accept children, and the remaining children PR straight to -`main`. Decided by the maintainer, 2026-10-09: - -- Children PR directly to `main`, so moving a binding layer does not require - hand-porting concurrent moq-ffi changes onto a separate line branch. -- The bindings still break once per release, not once per merge: binding - releases (moq-ffi and the Python, Go, Swift, Kotlin, Dart, and C++ - packages) wait until the codec namespace reshape merges - (confirmed as a hard release gate in the 2026-10-10 audit), joining the - named error fields and the broadcast-epoch renames (`connects()`, - `reanchor()`) already on `main`. Codecs ranks first below for that reason. - Dart is published (`moq` 0.1.0, `moq_ffi` 0.4.x), so - its renames get the same upgrade notes as the others. -- The C++ package (#4079) landed first, so #4519 ported `cpp/moq`, `cpp/obs`, - and the C++ interop client. C++ is one flat `moq::` namespace of the - generated types, with moq-ffi's `Moq` prefix stripped (`moq::MediaTrackConsumer`): - uniffi-bindgen-cpp renders one namespace per crate, so a `media::` namespace - would need the generator to map a name prefix to a namespace. - -Settled shape: - -- Groups by role, not crate: the root is moq-net (client, server, session, - origin, broadcast, track, group); `media` merges hang and moq-mux, since a - binding never sees that split (catalog, import producers, container - consumers); `json`, `flate`, `audio`, and `video` own their producers and - consumers. `flate` holds the opaque snapshot and stream tracks, named after - the `moq-flate` crate, until - [One compressed track per name](/quest/m1/compress/migrate.md) deletes it. -- A layer reuses the net noun it decodes, and its namespace tells them apart: - `media.TrackConsumer` and `media.GroupConsumer` read what - `media.TrackProducer` writes, a level above the raw `TrackConsumer` and - `GroupConsumer` (decided 2026-10-13 on #5356, replacing the 5-word - `MoqMediaContainerGroupConsumer`). -- A layer's type is constructed from the handles its Rust constructor takes, - not reached through an accessor on the broadcast: JSON wraps a track - (`moq_json::snapshot::Producer::new(track, config)`), so it also works on a - track accepted from a request; the codecs take the broadcast and its - catalog. JSON and flate producers take the broadcast too, whose catalog - advertises the track, as `moq_mux::catalog::Producer::json_snapshot` does. Sketch, not a contract: `json.SnapshotProducer(track, config)`, - `video.Producer(broadcast, catalog, config)` for Rust's - `encode::Producer`, and the codec-only `video.Encoder(config)` for - `encode::Encoder` (decided 2026-10-06, see - the codec namespace reshape). -- UniFFI 0.32 allows one namespace per crate, so moq-ffi groups by type and - the wrappers supply real namespaces in each language's idiom: Python - submodules, Go subpackages (`moq.dev/moq/json`, aliased on import next to - `encoding/json`), Kotlin packages, Dart libraries, Swift caseless-enum - namespaces. A per-layer crate split, reopened 2026-10-13 to move the - namespaces below the wrappers, was spiked and rejected (#5460): UniFFI - 0.32 keys a crate's types by bare name, so `media.GroupConsumer` cannot - take the net `GroupConsumer` it wraps. Python drops the media type - silently; every other generator refuses. Distinct Rust names renamed - back per language work only in Python and Go: Kotlin, Swift, Dart, and - C++ shadow or misplace the external type, and generated C refuses - external types. Revisit once - [namespaced external types](/quest/m2/uniffi-namespaces.md) fixes - [mozilla/uniffi-rs#3026](https://github.com/mozilla/uniffi-rs/issues/3026) - in the moq-dev/uniffi fork. -- `demand()` is the one way to watch subscribers; producers drop their - `name`/`is_used`/`used`/`unused` duplicates. -- moq-ffi and its generated consumers, including `cpp/obs` (above). The - hand-written moq-c is out of scope: the - [generated C](/quest/m1/c/README.md) and C++ - bindings inherit this shape from moq-ffi, so reshaping the hand-written C - ABI would break C users twice. The narrow - [claim-epoch correctness exception](/quest/m1/claim-answer-epochs.md) does - not expand this layer reshaping to the hand-written ABI. -- `rs/moq-ffi/AGENTS.md` records the per-language namespace pattern `json` - set. - -Each child reshapes one group end to end: moq-ffi, all five wrappers, the -C++ package and `cpp/obs`, the `doc/lib` samples per the cross-package table, -and its entries under `## Unreleased` in each affected package's `MIGRATE.md`. Each -runs `just test interop --all`. - -## Required - -- [Stream importer name](/quest/m1/ffi-shape/stream-producer-name.md) - the maintainer settles `media.ContainerStreamProducer`'s name before the binding release diff --git a/quest/m1/ffi-shape/stream-producer-name.md b/quest/m1/ffi-shape/stream-producer-name.md deleted file mode 100644 index c3cba9c5c29..00000000000 --- a/quest/m1/ffi-shape/stream-producer-name.md +++ /dev/null @@ -1,21 +0,0 @@ -# [S] Name the container stream importer by role - -## Goal - -The maintainer decides whether the import-side -`MoqMediaContainerStreamProducer` (`media.ContainerStreamProducer` in the -wrappers) is named by role, and any rename lands before the binding release -that the codec namespace reshape gates, so the bindings break once. - -## Plan - -Still open from #5356, which renamed the per-track consumers to -`media.TrackConsumer` and `media.GroupConsumer`. "Container" here means an -importer that recovers framing from a raw byte stream and may publish several -tracks, unlike those per-track consumers. The rejected crate split (#5460) -had owned this review. - -Ask with 2-3 candidate names and a recommendation. A rename touches moq-ffi, -every wrapper, `cpp/moq`'s alias list, the `doc/lib` samples, and the -`## Unreleased` of each affected `MIGRATE.md`; keeping the name deletes this -quest. diff --git a/quest/m2/uniffi-namespaces.md b/quest/m2/uniffi-namespaces.md index fdf7eee9dcf..e8c945ac712 100644 --- a/quest/m2/uniffi-namespaces.md +++ b/quest/m2/uniffi-namespaces.md @@ -22,9 +22,8 @@ in the fork instead of waiting for upstream. - Reuse the two-crate spike harness from #5460 as the regression: both layers export `GroupConsumer` and `Frame`, and every generator compiles and runs the consumer. -- Re-running the per-layer crate split decision is a follow-up once this - lands. [FFI shape](/quest/m1/ffi-shape/README.md) points here as its - revisit condition. +- Re-running the per-layer crate split decision (rejected in #5460) is a + follow-up once this lands. Public API: none in moq until the crate split is re-decided. Wire: none. diff --git a/rs/moq-ffi/MIGRATE.md b/rs/moq-ffi/MIGRATE.md index e75eb72a719..81011f4069e 100644 --- a/rs/moq-ffi/MIGRATE.md +++ b/rs/moq-ffi/MIGRATE.md @@ -111,10 +111,15 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. let audio = MoqMediaTrackProducer::audio(&broadcast, MoqMediaTarget::Named { name: None }, init)?; ``` -### Container byte-stream importers take an init record +### Container byte streams use the container producer (#PRNUM) -`MoqMediaContainerStreamProducer` takes a `MoqContainerStreamInit` holding the format instead of a bare format. -Its optional `timebase`, also on `MoqContainerInit`, shares one source's offset across container imports; leave it unset for independent offsets. +`MoqContainerStreamProducer` (from `publish_container_stream`) has no replacement type: a container recovers its own framing, so `MoqMediaContainerProducer` takes chunks split anywhere. +Construct it with empty `data` and write the stream through it. +`MoqContainerInit`'s optional `timebase` shares one source's offset across container imports; leave it unset for independent offsets. + +```rust +let stream = MoqMediaContainerProducer::new(&broadcast, MoqContainerInit { format, data: Vec::new(), timebase: None })?; +``` ### Error payloads are named diff --git a/rs/moq-ffi/src/media.rs b/rs/moq-ffi/src/media.rs index d080bf65734..23e05fc6534 100644 --- a/rs/moq-ffi/src/media.rs +++ b/rs/moq-ffi/src/media.rs @@ -387,16 +387,6 @@ pub struct MoqContainerInit { pub timebase: Option>, } -/// A byte-stream container format and an optional shared source timebase. -#[derive(Clone, uniffi::Record)] -pub struct MoqContainerStreamInit { - /// The container format. - pub format: MoqContainerFormat, - /// A shared source timebase, or absent for an independent offset. - #[uniffi(default = None)] - pub timebase: Option>, -} - impl From for moq_mux::catalog::VideoHint { fn from(hint: MoqVideoHint) -> Self { let mut out = moq_mux::catalog::VideoHint::default(); @@ -728,7 +718,7 @@ struct MediaProducer { demand: moq_net::track::Demand, } -/// A whole-chunk importer for a container, which may publish several tracks. +/// An importer for a container, which may publish several tracks. struct ContainerProducer { import: moq_mux::import::Container, } @@ -738,25 +728,13 @@ struct MediaStreamProducer { import: Box, } -/// A byte-stream importer for a container, which recovers its own framing. -struct ContainerStreamProducer { - import: moq_mux::import::ContainerStream, -} - -/// Imports complete container chunks into a broadcast. +/// Imports a container into a broadcast, from chunks split anywhere such as a raw byte stream. #[derive(uniffi::Object)] pub struct MoqMediaContainerProducer { driver: crate::ffi::Background, inner: std::sync::Mutex>, } -/// Imports a container byte stream into a broadcast. -#[derive(uniffi::Object)] -pub struct MoqMediaContainerStreamProducer { - driver: crate::ffi::Background, - inner: std::sync::Mutex>, -} - /// Imports complete encoded frames onto one track. #[derive(uniffi::Object)] pub struct MoqMediaTrackProducer { @@ -879,31 +857,6 @@ impl MoqMediaTrackStreamProducer { } } -#[uniffi::export] -impl MoqMediaContainerStreamProducer { - /// Construct an importer from this broadcast. - /// - /// A supplied timebase must belong to this broadcast; absence gives it an independent offset. - #[uniffi::constructor] - pub fn new( - broadcast: &MoqBroadcastProducer, - init: MoqContainerStreamInit, - ) -> Result, MoqError> { - let _guard = crate::ffi::enter(); - let (target, reserved, driver) = reserve_container(broadcast, init.timebase.as_deref())?; - let import = moq_mux::import::ContainerStream::new(target, reserved, init.format.into()).map_err(|err| { - MoqError::Codec { - reason: format!("init failed: {err}"), - } - })?; - - Ok(Arc::new(MoqMediaContainerStreamProducer { - driver, - inner: std::sync::Mutex::new(Some(ContainerStreamProducer { import })), - })) - } -} - impl MoqMediaTrackProducer { /// Wrap a single-codec importer, capturing the demand handle its track exposes. fn from_import(import: moq_mux::import::Track) -> Arc { @@ -1019,7 +972,8 @@ impl MoqMediaTrackProducer { #[uniffi::export] impl MoqMediaContainerProducer { - /// Write a whole chunk of the container. + /// Write the next container bytes. The container recovers its own framing, so a chunk may split + /// anywhere. /// /// No timestamp: a container carries its tracks' timing itself, and the importer reads it out /// rather than taking the caller's word for it. @@ -1128,41 +1082,6 @@ impl MoqMediaTrackStreamProducer { } } -#[uniffi::export] -impl MoqMediaContainerStreamProducer { - /// Push raw container bytes. The importer recovers its own framing, so callers can write - /// arbitrary chunks. - pub fn write(&self, payload: Vec) -> Result<(), MoqError> { - self.driver.check()?; - let result = (|| { - let _guard = crate::ffi::enter(); - let mut guard = self.inner.lock().unwrap(); - let container = guard.as_mut().ok_or(MoqError::Closed)?; - container.import.decode(&payload).map_err(|err| MoqError::Codec { - reason: format!("decode failed: {err}"), - })?; - Ok(()) - })(); - self.driver.check()?; - result - } - - /// Finish every track this container publishes. - pub fn finish(&self) -> Result<(), MoqError> { - let result = (|| { - let _guard = crate::ffi::enter(); - let mut guard = self.inner.lock().unwrap(); - let mut container = guard.take().ok_or(MoqError::Closed)?; - container.import.finish().map_err(|err| MoqError::Codec { - reason: format!("finish failed: {err}"), - })?; - Ok(()) - })(); - self.driver.check()?; - result - } -} - /// Reserve the named track, or a unique one named after the format. fn reserve_track( broadcast: &moq_net::broadcast::Producer, @@ -1582,23 +1501,15 @@ mod timebase_tests { }, ) .unwrap(); - let stream = MoqMediaContainerStreamProducer::new( + let audio_chunks = MoqMediaContainerProducer::new( &broadcast, - MoqContainerStreamInit { + MoqContainerInit { format: MoqContainerFormat::Fmp4, + data: audio_init.to_vec(), timebase, }, ) .unwrap(); - stream - .inner - .lock() - .unwrap() - .as_mut() - .unwrap() - .import - .decode(&audio_init) - .unwrap(); tokio::time::advance(Duration::from_secs(1)).await; let first = clock.now().as_micros(); // Drive the private importers on the paused clock, without entering the unpaused FFI worker. @@ -1612,7 +1523,7 @@ mod timebase_tests { .decode(&fragment(&source, 3600, 1)) .unwrap(); tokio::time::advance(Duration::from_secs(5)).await; - stream + audio_chunks .inner .lock() .unwrap() @@ -1644,7 +1555,7 @@ mod timebase_tests { readers.push(moq_mux::container::Consumer::new(track, container)); } chunks.finish().unwrap(); - stream.finish().unwrap(); + audio_chunks.finish().unwrap(); let mut times = HashMap::new(); for mut media in readers { while let Some(read) = media.read().await.unwrap() { @@ -1670,18 +1581,14 @@ mod timebase_tests { assert!(matches!(MoqMediaContainerProducer::new(&other, MoqContainerInit { format: MoqContainerFormat::Fmp4, data: Vec::new(), timebase: Some(timebase.clone()), }), Err(MoqError::Codec { reason }) if reason.contains("another broadcast"))); - assert!( - matches!(MoqMediaContainerStreamProducer::new(&other, MoqContainerStreamInit { - format: MoqContainerFormat::Fmp4, timebase: Some(timebase.clone()), - }), Err(MoqError::Codec { reason }) if reason.contains("another broadcast")) - ); owner.close().unwrap(); assert!(matches!(MoqMediaTimebase::new(owner.clone()), Err(MoqError::Closed))); assert!(matches!( - MoqMediaContainerStreamProducer::new( + MoqMediaContainerProducer::new( &owner, - MoqContainerStreamInit { + MoqContainerInit { format: MoqContainerFormat::Fmp4, + data: Vec::new(), timebase: Some(timebase), } ), @@ -1712,17 +1619,8 @@ mod timebase_tests { }, ) .unwrap(); - let stream = MoqMediaContainerStreamProducer::new( - &broadcast, - MoqContainerStreamInit { - format: MoqContainerFormat::Fmp4, - timebase: Some(MoqMediaTimebase::new(broadcast.clone()).unwrap()), - }, - ) - .unwrap(); assert!(broadcast.with_state(|state| Ok(state.timebases.is_empty())).unwrap()); chunks.finish().unwrap(); - stream.finish().unwrap(); } #[tokio::test(start_paused = true)] @@ -1786,10 +1684,11 @@ mod timebase_tests { .map(|_| MoqMediaTimebase::new(owner.clone()).unwrap()) .collect(); let reserve = || { - let importer = MoqMediaContainerStreamProducer::new( + let importer = MoqMediaContainerProducer::new( &owner, - MoqContainerStreamInit { + MoqContainerInit { format: MoqContainerFormat::Fmp4, + data: Vec::new(), timebase: Some(std::hint::black_box(timebases.last().unwrap()).clone()), }, ) diff --git a/rs/moq-ffi/src/origin.rs b/rs/moq-ffi/src/origin.rs index 79ca3a595a5..7afe7aae2e5 100644 --- a/rs/moq-ffi/src/origin.rs +++ b/rs/moq-ffi/src/origin.rs @@ -736,8 +736,7 @@ mod supervision_tests { #[tokio::test] async fn container_importers_keep_the_origin_failure_after_other_owners_are_released() { use crate::media::{ - MoqContainerFormat, MoqContainerInit, MoqContainerStreamInit, MoqMediaContainerProducer, - MoqMediaContainerStreamProducer, MoqMediaTimebase, + MoqContainerFormat, MoqContainerInit, MoqMediaContainerProducer, MoqMediaTimebase, }; let (inner, completion, trigger) = crate::ffi::panicking_origin(); let origin = MoqOriginProducer::from_inner(Origin { @@ -756,10 +755,11 @@ mod supervision_tests { }, ) .unwrap(); - let stream = MoqMediaContainerStreamProducer::new( + let independent = MoqMediaContainerProducer::new( &broadcast, - MoqContainerStreamInit { + MoqContainerInit { format: MoqContainerFormat::Ts, + data: Vec::new(), timebase: None, }, ) @@ -773,9 +773,9 @@ mod supervision_tests { assert!(matches!(completion.finished().await, Err(MoqError::Task { .. }))); drop(completion); assert!(matches!(container.cut(), Err(MoqError::Task { .. }))); - assert!(matches!(stream.write(Vec::new()), Err(MoqError::Task { .. }))); + assert!(matches!(independent.write(Vec::new()), Err(MoqError::Task { .. }))); assert!(matches!(container.finish(), Err(MoqError::Task { .. }))); - assert!(matches!(stream.finish(), Err(MoqError::Task { .. }))); + assert!(matches!(independent.finish(), Err(MoqError::Task { .. }))); } #[tokio::test] diff --git a/swift/MIGRATE.md b/swift/MIGRATE.md index 9227b0b2d5e..48ce23385ee 100644 --- a/swift/MIGRATE.md +++ b/swift/MIGRATE.md @@ -106,10 +106,15 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. let audio = try Media.TrackProducer.audio(broadcast: broadcast, initData: Media.AudioInit(format: .opus, data: opusHead)) ``` -### Container byte-stream importers take an init record +### Container byte streams use `Media.ContainerProducer` (#PRNUM) -`Media.ContainerStreamProducer` takes a `Media.ContainerStreamInit` holding the format instead of a bare format. -Its optional `timebase`, also on `Media.ContainerInit`, shares one source's offset across container imports. +`BroadcastProducer.publishContainerStream` has no separate importer: a container recovers its own framing, so `Media.ContainerProducer` takes chunks split anywhere. +Pass empty `data` and write the stream through it. +`Media.ContainerInit`'s optional `timebase` shares one source's offset across container imports. + +```swift +let stream = try Media.ContainerProducer(broadcast: broadcast, initData: Media.ContainerInit(format: .fmp4, data: Data())) +``` ### Timestamps are optional diff --git a/swift/Sources/Moq/Media.swift b/swift/Sources/Moq/Media.swift index af0496eced1..ca86c5b8fe6 100644 --- a/swift/Sources/Moq/Media.swift +++ b/swift/Sources/Moq/Media.swift @@ -70,19 +70,6 @@ public enum Media { } var ffi: MoqContainerInit { MoqContainerInit(format: format, data: data, timebase: timebase?.ffi) } } - /// A byte-stream container format and an optional shared source timebase. - public struct ContainerStreamInit: Sendable { - /// The container format. - public var format: ContainerFormat - /// A shared source timebase, or nil for an independent offset. - public var timebase: Timebase? - /// Configure a container byte stream's source timeline. - public init(format: ContainerFormat, timebase: Timebase? = nil) { - self.format = format - self.timebase = timebase - } - var ffi: MoqContainerStreamInit { MoqContainerStreamInit(format: format, timebase: timebase?.ffi) } - } /// A catalog rendition: its ID (catalog key) and its video or audio config. public typealias Rendition = MoqRendition /// A catalog rendition and live delivery options. @@ -290,7 +277,7 @@ public enum Media { public final class ContainerProducer: Sendable { let ffi: MoqMediaContainerProducer - /// Import complete container chunks into this broadcast. + /// Import a container into this broadcast, from chunks split anywhere. public convenience init(broadcast: BroadcastProducer, initData: ContainerInit) throws { self.init(try MoqMediaContainerProducer(broadcast: broadcast.ffi, init: initData.ffi)) } @@ -298,7 +285,7 @@ public enum Media { self.ffi = ffi } - /// Write a whole chunk of container bytes. + /// Write container bytes; the container recovers its own framing. /// /// No timestamp: a container carries its tracks' timing itself, and the importer reads it out /// rather than taking the caller's word for it. @@ -325,29 +312,6 @@ public enum Media { } } - /// Write side of a container fed a raw byte stream, which recovers its own framing. - public final class ContainerStreamProducer: Sendable { - let ffi: MoqMediaContainerStreamProducer - - /// Import a container byte stream into this broadcast. - public convenience init(broadcast: BroadcastProducer, initData: ContainerStreamInit) throws { - self.init(try MoqMediaContainerStreamProducer(broadcast: broadcast.ffi, init: initData.ffi)) - } - init(_ ffi: MoqMediaContainerStreamProducer) { - self.ffi = ffi - } - - /// Push raw container bytes; chunk boundaries don't matter. - public func write(_ payload: Data) throws { - try ffi.write(payload: payload) - } - - /// Finish every track this container publishes. - public func finish() throws { - try ffi.finish() - } - } - /// Write side of a media track fed a raw byte stream with inferred frame boundaries. public final class TrackStreamProducer: Sendable { let ffi: MoqMediaTrackStreamProducer diff --git a/swift/Tests/MoqTests/SmokeTests.swift b/swift/Tests/MoqTests/SmokeTests.swift index 88dd732a0fc..a6d9f38ad8d 100644 --- a/swift/Tests/MoqTests/SmokeTests.swift +++ b/swift/Tests/MoqTests/SmokeTests.swift @@ -14,7 +14,6 @@ final class SmokeTests: XCTestCase { let other = try BroadcastProducer() let timebase = try Media.Timebase(broadcast: owner) XCTAssertThrowsError(try Media.ContainerProducer(broadcast: other, initData: Media.ContainerInit(format: .fmp4, data: Data(), timebase: timebase))) - XCTAssertThrowsError(try Media.ContainerStreamProducer(broadcast: other, initData: Media.ContainerStreamInit(format: .fmp4, timebase: timebase))) try owner.close() XCTAssertThrowsError(try Media.Timebase(broadcast: owner)) try other.close() From ad6200355a79e73f55fce1e1b805ec8827275a6c Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 18 Oct 2026 22:32:30 -0700 Subject: [PATCH 3/4] style: rustfmt Co-Authored-By: Claude Opus 5.5 --- rs/moq-ffi/src/origin.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rs/moq-ffi/src/origin.rs b/rs/moq-ffi/src/origin.rs index 7afe7aae2e5..d98f8f58f02 100644 --- a/rs/moq-ffi/src/origin.rs +++ b/rs/moq-ffi/src/origin.rs @@ -735,9 +735,7 @@ mod supervision_tests { #[tokio::test] async fn container_importers_keep_the_origin_failure_after_other_owners_are_released() { - use crate::media::{ - MoqContainerFormat, MoqContainerInit, MoqMediaContainerProducer, MoqMediaTimebase, - }; + use crate::media::{MoqContainerFormat, MoqContainerInit, MoqMediaContainerProducer, MoqMediaTimebase}; let (inner, completion, trigger) = crate::ffi::panicking_origin(); let origin = MoqOriginProducer::from_inner(Origin { inner, From 71c58636f740cd7956f0fdc1648d1d9c831d3c01 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 18 Oct 2026 23:13:52 -0700 Subject: [PATCH 4/4] docs: link #5919 in the migration notes Co-Authored-By: Claude Opus 5.5 --- cpp/moq/MIGRATE.md | 2 +- dart/moq/MIGRATE.md | 2 +- go/wrapper/MIGRATE.md | 2 +- kt/moq/MIGRATE.md | 2 +- py/moq-rs/MIGRATE.md | 2 +- rs/moq-ffi/MIGRATE.md | 2 +- swift/MIGRATE.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/moq/MIGRATE.md b/cpp/moq/MIGRATE.md index 3911350659c..754757af35e 100644 --- a/cpp/moq/MIGRATE.md +++ b/cpp/moq/MIGRATE.md @@ -4,7 +4,7 @@ How to update your code for each breaking change, newest first. ## Unreleased -### Container byte streams use `MediaContainerProducer` (#PRNUM) +### Container byte streams use `MediaContainerProducer` (#5919) `moq::MediaContainerStreamProducer` and `moq::ContainerStreamInit` are gone: a container recovers its own framing, so `moq::MediaContainerProducer` takes chunks split anywhere. Pass empty `data` and write the stream through it. diff --git a/dart/moq/MIGRATE.md b/dart/moq/MIGRATE.md index 3e3de47c639..7de2ff0e16e 100644 --- a/dart/moq/MIGRATE.md +++ b/dart/moq/MIGRATE.md @@ -92,7 +92,7 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. final audio = media.TrackProducer.audio(broadcast: broadcast, target: media.Named(null), init: init); ``` -### Container byte streams use `media.ContainerProducer` (#PRNUM) +### Container byte streams use `media.ContainerProducer` (#5919) `publishContainerStream` has no separate importer: a container recovers its own framing, so `media.ContainerProducer` takes chunks split anywhere. Pass empty `data` and write the stream through it. diff --git a/go/wrapper/MIGRATE.md b/go/wrapper/MIGRATE.md index eb71e8cb9e1..30120acb29b 100644 --- a/go/wrapper/MIGRATE.md +++ b/go/wrapper/MIGRATE.md @@ -95,7 +95,7 @@ JSON and opaque data tracks live in `moq.dev/moq/json` and `moq.dev/moq/flate`, audio, err := media.NewAudioTrackProducer(broadcast, media.Named{}, media.AudioInit{Format: media.AudioFormatOpus, Data: opusHead}) ``` -### Container byte streams use `media.NewContainerProducer` (#PRNUM) +### Container byte streams use `media.NewContainerProducer` (#5919) `BroadcastProducer.PublishContainerStream` has no separate importer: a container recovers its own framing, so `media.NewContainerProducer` takes chunks split anywhere. Leave `Data` empty and write the stream through it. diff --git a/kt/moq/MIGRATE.md b/kt/moq/MIGRATE.md index f0c4db02068..51d5172632e 100644 --- a/kt/moq/MIGRATE.md +++ b/kt/moq/MIGRATE.md @@ -104,7 +104,7 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. val audio = dev.moq.media.TrackProducer.audio(broadcast, Named(null), AudioInit(format = AudioFormat.OPUS, data = opusHead)) ``` -### Container byte streams use `ContainerProducer` (#PRNUM) +### Container byte streams use `ContainerProducer` (#5919) `BroadcastProducer.publishContainerStream` has no separate importer: a container recovers its own framing, so `dev.moq.media.ContainerProducer` takes chunks split anywhere. Pass empty `data` and write the stream through it. diff --git a/py/moq-rs/MIGRATE.md b/py/moq-rs/MIGRATE.md index 9ead72bf8d4..9bb799c644d 100644 --- a/py/moq-rs/MIGRATE.md +++ b/py/moq-rs/MIGRATE.md @@ -96,7 +96,7 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. audio = moq.media.TrackProducer.audio(broadcast, moq.media.AudioInit(format=moq.media.AudioFormat.OPUS, data=opus_head)) ``` -### Container byte streams use `moq.media.ContainerProducer` (#PRNUM) +### Container byte streams use `moq.media.ContainerProducer` (#5919) `BroadcastProducer.publish_container_stream` has no separate importer: a container recovers its own framing, so `moq.media.ContainerProducer` takes chunks split anywhere. Pass empty `data` and write the stream through it. diff --git a/rs/moq-ffi/MIGRATE.md b/rs/moq-ffi/MIGRATE.md index 81011f4069e..dbf0316e726 100644 --- a/rs/moq-ffi/MIGRATE.md +++ b/rs/moq-ffi/MIGRATE.md @@ -111,7 +111,7 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. let audio = MoqMediaTrackProducer::audio(&broadcast, MoqMediaTarget::Named { name: None }, init)?; ``` -### Container byte streams use the container producer (#PRNUM) +### Container byte streams use the container producer (#5919) `MoqContainerStreamProducer` (from `publish_container_stream`) has no replacement type: a container recovers its own framing, so `MoqMediaContainerProducer` takes chunks split anywhere. Construct it with empty `data` and write the stream through it. diff --git a/swift/MIGRATE.md b/swift/MIGRATE.md index 48ce23385ee..5057b4ee909 100644 --- a/swift/MIGRATE.md +++ b/swift/MIGRATE.md @@ -106,7 +106,7 @@ Producers drop `name`, `used`, and `unused`; read them through `demand()`. let audio = try Media.TrackProducer.audio(broadcast: broadcast, initData: Media.AudioInit(format: .opus, data: opusHead)) ``` -### Container byte streams use `Media.ContainerProducer` (#PRNUM) +### Container byte streams use `Media.ContainerProducer` (#5919) `BroadcastProducer.publishContainerStream` has no separate importer: a container recovers its own framing, so `Media.ContainerProducer` takes chunks split anywhere. Pass empty `data` and write the stream through it.