@blockcast/mmt-container 0.4.0-main.88b772ee21c8 → 0.4.0-main.8ecc3a90a461
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -12
- package/dist/browser-runtime.js +366 -260
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +51 -22
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +240 -191
- package/dist/carp-catalog.js.map +3 -3
- package/dist/catalog-fec-params.d.ts +1 -1
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +6 -13
- package/dist/catalog-fec-params.js.map +3 -3
- package/dist/catalog-network-source.js.map +1 -1
- package/dist/catalog-validator.d.ts +4 -3
- package/dist/catalog-validator.d.ts.map +1 -1
- package/dist/catalog-validator.js +0 -29
- package/dist/catalog-validator.js.map +3 -3
- package/dist/delivery-catalog.js +4 -12
- package/dist/delivery-catalog.js.map +4 -4
- package/dist/fec-manager.js.map +1 -1
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +14 -2
- package/dist/fec-state.js.map +3 -3
- package/dist/fec-worker-setup.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.js.map +1 -1
- package/dist/manifest-auth-plan.d.ts +26 -25
- package/dist/manifest-auth-plan.d.ts.map +1 -1
- package/dist/manifest-auth-plan.js +311 -1163
- package/dist/manifest-auth-plan.js.map +4 -4
- package/dist/mfu-reassembler.js.map +2 -2
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +495 -283
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-fec-session.d.ts +40 -4
- package/dist/mmtp-fec-session.d.ts.map +1 -1
- package/dist/mmtp-fec-session.js +58 -18
- package/dist/mmtp-fec-session.js.map +2 -2
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +17 -0
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-auth-catalog.d.ts +86 -92
- package/dist/multicast-auth-catalog.d.ts.map +1 -1
- package/dist/multicast-auth-catalog.js +327 -124
- package/dist/multicast-auth-catalog.js.map +3 -3
- package/dist/multicast-input.d.ts +25 -3
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +266 -13
- package/dist/multicast-input.js.map +3 -3
- package/dist/multicast-manager.d.ts +2 -2
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +24 -28
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.js +2 -10
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js.map +2 -2
- package/dist/no-modules.d.ts +1 -0
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +494 -282
- package/dist/no-modules.js.map +4 -4
- package/dist/repair-fetch.js.map +1 -1
- package/dist/repair-layers.js.map +1 -1
- package/dist/signaling.d.ts +2 -2
- package/dist/signaling.d.ts.map +1 -1
- package/dist/signaling.js +3 -3
- package/dist/signaling.js.map +2 -2
- package/dist/source-auth.js +22 -6
- package/dist/source-auth.js.map +2 -2
- package/dist/switching-set-alignment.d.ts +1 -1
- package/dist/switching-set-alignment.js.map +1 -1
- package/dist/timestamp-codec.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js.map +1 -1
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +5 -5
- package/schemas/catalog.schema.json +81 -28
- package/src/carp-catalog.ts +77 -39
- package/src/catalog-fec-params.ts +5 -2
- package/src/catalog-validator.ts +4 -11
- package/src/fec-state.ts +3 -2
- package/src/index.ts +5 -2
- package/src/manifest-auth-plan.ts +39 -91
- package/src/mmtp-fec-session.ts +99 -18
- package/src/mmtp-router.ts +25 -0
- package/src/multicast-auth-catalog.ts +131 -238
- package/src/multicast-input.ts +88 -37
- package/src/multicast-manager.ts +8 -12
- package/src/no-modules.ts +1 -0
- package/src/signaling.ts +2 -2
- package/src/switching-set-alignment.ts +1 -1
- package/test-vectors/catalog/README.md +38 -3
- package/test-vectors/catalog/negative/fec-iso-symbol-size-below-floor.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-iso-symbol-size-13.json +28 -0
- package/test-vectors/catalog/negative/fec-repair-overlay-source-symbols-zero.json +43 -0
- package/test-vectors/catalog/negative/fec-repair-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-source-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-symbol-size-zero.json +28 -0
- package/test-vectors/catalog/negative/multicast-auth-asm-missing-sender-address.json +77 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-first-epoch.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-kid.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-auth-without-object-auth.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-auth.json +49 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-bandwidth.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-port-equals-port.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-timer-out-of-range.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-out-of-range.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-sender-address-on-ssm.json +57 -0
- package/test-vectors/catalog/negative/multicast-auth-version-1.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-3.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-missing.json +55 -0
- package/test-vectors/catalog/negative/multicast-endpoint-foreign-namespace-track.json +44 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-amt.json +38 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-atsc3.json +38 -0
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +2 -2
- package/test-vectors/catalog/{negative/multicast-endpoint-missing-protocol-and-source.json → positive/multicast-asm-unprotected.json} +10 -5
- package/test-vectors/catalog/positive/multicast-auth-asm-sender.json +78 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +39 -38
- package/test-vectors/catalog/positive/multicast-draft01-4-1-example.json +81 -0
- package/test-vectors/catalog/positive/multicast-draft01-7-2-6-example.json +70 -0
- package/test-vectors/catalog/section-codes.json +23 -1
- package/test-vectors/catalog-multicast-auth-v1.json +38 -20
- package/test-vectors/catalog-validation.json +3 -2
- package/test-vectors/catalog-validator-public-api.mjs +14 -9
package/README.md
CHANGED
|
@@ -121,7 +121,7 @@ function parseAlFecMessage(buf: Uint8Array): AlFecMessage | null // every FEC
|
|
|
121
121
|
function parseMoqRepairFrame(buf: Uint8Array): MoqRepairFrame
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
Constants worth knowing: `MMTP_HEADER_SIZE = 12`, `MPU_HEADER_SIZE = 8`, `MFU_DU_HEADER_SIZE_TIMED = 14`, `PACKET_TYPE_MPU = 0x00`, `PACKET_TYPE_REPAIR = 0x03`, `ALFEC_MESSAGE_ID = 0x0203`, `FEC_CODE_RAPTORQ =
|
|
124
|
+
Constants worth knowing: `MMTP_HEADER_SIZE = 12`, `MPU_HEADER_SIZE = 8`, `MFU_DU_HEADER_SIZE_TIMED = 14`, `PACKET_TYPE_MPU = 0x00`, `PACKET_TYPE_REPAIR = 0x03`, `ALFEC_MESSAGE_ID = 0x0203`, `FEC_CODE_RAPTORQ = 3`, `FEC_CODE_REED_SOLOMON = 1`.
|
|
125
125
|
|
|
126
126
|
```ts
|
|
127
127
|
import { parseMMTPHeader, extractMFUPayload } from "@blockcast/mmt-base"
|
|
@@ -158,10 +158,12 @@ The constructor rejects non-null, non-finite, or non-positive deadlines. Reliabl
|
|
|
158
158
|
|
|
159
159
|
### CARP / CMSF catalog (`./carp-catalog`)
|
|
160
160
|
|
|
161
|
-
Validate the published catalog schema through the package API
|
|
162
|
-
the
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
Validate the published catalog schema through the package API, then run
|
|
162
|
+
`validateCmsfMmtpCatalog`: the multicast rules of draft-ramadan-moq-multicast-01
|
|
163
|
+
that JSON Schema cannot state (a repeated `kid` or `firstEpoch` in
|
|
164
|
+
`multicast.auth.keys`, a `manifestPort` that clashes with a port of its
|
|
165
|
+
`(S, G)`, a track declaring a foreign namespace) live only in the runtime
|
|
166
|
+
validator.
|
|
165
167
|
|
|
166
168
|
```ts
|
|
167
169
|
import schema from "@blockcast/mmt-container/catalog.schema.json" with { type: "json" }
|
|
@@ -173,7 +175,7 @@ if (!validateCatalog(catalog)) {
|
|
|
173
175
|
}
|
|
174
176
|
```
|
|
175
177
|
|
|
176
|
-
Implements `draft-law-ramadan-moq-carp-reliability` §3 (FEC), §4 (multicast endpoints), and `draft-ramadan-moq-mmt-
|
|
178
|
+
Implements `draft-law-ramadan-moq-carp-reliability` §3 (FEC), §4 (multicast endpoints), and `draft-ramadan-moq-mmt-01` §4.4.2 (track timing). Plain TypeScript interfaces with type guards — no Zod, no runtime schema dependency. Upstream Zod schemas should derive from these via `z.infer<>`.
|
|
177
179
|
|
|
178
180
|
```ts
|
|
179
181
|
type FecAlgorithm = "none" | "raptorq" | "reed-solomon"
|
|
@@ -187,7 +189,7 @@ interface FecCatalogConfig {
|
|
|
187
189
|
interleaveDepthMs?: number // FEC block span in MILLISECONDS, default 0 (single-group blocks)
|
|
188
190
|
repairTrack: string // §6.1 — required
|
|
189
191
|
mode?: "interleaved" | "object" // extension; "object" (per-frame object blocks) is retired: @blockcast/mmt-fec refuses it
|
|
190
|
-
uep?: { keyRatio: number; deltaRatio: number } //
|
|
192
|
+
uep?: { keyRatio: number; deltaRatio: number } // Unequal Error Protection — Blockcast extension, not in draft-ramadan-moq-fec-01
|
|
191
193
|
deltaFailWindowBlocks?: number // D-11, base track only
|
|
192
194
|
deltaProbeIntervalMs?: number // D-13, base track only
|
|
193
195
|
}
|
|
@@ -248,7 +250,9 @@ non-DRIAD AMT entry, so the manual one carries the relay while the DRIAD one
|
|
|
248
250
|
keeps the discovery request. An `atsc3` endpoint now
|
|
249
251
|
requires a `{type: "atsc3", …}` entry and throws `atsc3_requires_tuning`
|
|
250
252
|
without one: that entry carries the frequency, PLP, service id and SLS URI,
|
|
251
|
-
which is the only tuning information an ATSC3 receiver has
|
|
253
|
+
which is the only tuning information an ATSC3 receiver has (the SLS behind
|
|
254
|
+
`slsUri` describes the MMTP session, MP table included, per A/331:2026-04 7.2,
|
|
255
|
+
and nothing of this profile, so `manifestPort` and keys come from provisioning), and the schema
|
|
252
256
|
cannot enforce it because `networkSource` is optional there (a native join has
|
|
253
257
|
none). `version`, `validUntil` and `enabled` are still emitted and still
|
|
254
258
|
outside `$defs/multicast` (the BLO-3323 freshness model, tracked separately).
|
|
@@ -446,7 +450,7 @@ All string values pass through `sanitize()` (T-06-01) — commas, `\r`, `\n` are
|
|
|
446
450
|
|
|
447
451
|
### Multicast transport (`./multicast-transport`)
|
|
448
452
|
|
|
449
|
-
Thin wrapper around the lowercase `window.multicast` gateway. Calls `globalThis.multicast.subscribe({ group, source, port, consume: 'bytes' })`, listens for `"bytes"` events (`CustomEvent<ArrayBuffer>`) on the returned `EventTarget` subscription, pumps packets to a callback, runs a
|
|
453
|
+
Thin wrapper around the lowercase `window.multicast` gateway. Calls `globalThis.multicast.subscribe({ group, source, port, consume: 'bytes' })`, listens for `"bytes"` events (`CustomEvent<ArrayBuffer>`) on the returned `EventTarget` subscription, pumps packets to a callback, runs a silence watchdog over the catalog-derived failback window (`setFailbackWindowMs`), and fires `onTakeover` once both video and audio are confirmed receiving.
|
|
450
454
|
|
|
451
455
|
```ts
|
|
452
456
|
class MulticastTransport {
|
|
@@ -457,12 +461,21 @@ class MulticastTransport {
|
|
|
457
461
|
confirmVideo(): void
|
|
458
462
|
confirmAudio(): void
|
|
459
463
|
onTakeover(cb: () => void): void
|
|
460
|
-
onFailback(cb: () => void): void
|
|
464
|
+
onFailback(cb: (reason: MulticastFailbackReason) => void): void
|
|
465
|
+
setFailbackWindowMs(windowMs: number | null): void
|
|
461
466
|
dispose(): void
|
|
462
467
|
readonly stats: { packetsReceived: number; bytesReceived: number }
|
|
463
468
|
}
|
|
464
469
|
```
|
|
465
470
|
|
|
471
|
+
**Failover vocabulary.** draft-multicast-01 Section 6 "failover" (multicast to
|
|
472
|
+
unicast) is libmmt's *failback*: `onFailback`, `MulticastManager.onFailback`,
|
|
473
|
+
`failbackAll`, `MediaRouter.failbackToMoq`, `MulticastFailbackReason`, and CMCD
|
|
474
|
+
`x-bc-ct` `mc-to-uc`. libmmt's in-code *failover* (`track-session.ts`) is the
|
|
475
|
+
per-track hop along a track's transport chain. The return to multicast is the
|
|
476
|
+
draft's switch to multicast / join / switch back; CMCD `mc-start` is fired
|
|
477
|
+
host-side.
|
|
478
|
+
|
|
466
479
|
Direct Sockets is Chrome-IWA-only. Outside an IWA context `isAvailable()` returns false and join() warns + returns false. AMT tunneling and unicast fallback are handled by `@blockcast/mmt-transport`, not by this transport class.
|
|
467
480
|
|
|
468
481
|
## Track-role convention summary (Phase 14)
|
|
@@ -503,11 +516,11 @@ Roles are required by:
|
|
|
503
516
|
- **ISO/IEC 14496-12** — ISOBMFF (consumed for fMP4 box construction in `mmtp-to-cmaf.ts`)
|
|
504
517
|
- **draft-ietf-moq-catalogformat** — CMSF catalog (IETF MOQ WG)
|
|
505
518
|
- **draft-law-ramadan-moq-carp-reliability** — CARP §3 (FEC) + §4 (multicast endpoints) + §5.1 (interleave units) + §6.1 (repair track)
|
|
506
|
-
- **draft-ramadan-moq-mmt-
|
|
519
|
+
- **draft-ramadan-moq-mmt-01** — MMT-over-MoQ wire format (§4.4.2 group-duration signaling, §4 MoQ object mapping, §5 MFU mode)
|
|
507
520
|
- **draft-ramadan-moq-fec** — AL-FEC over MoQ (§5.3 FEC Source Info object extension 0x11: SS_ID(32), fixed 4 bytes)
|
|
508
521
|
- **RFC 6330** — RaptorQ Forward Error Correction (strict OTI codec in `@blockcast/mmt-fec`)
|
|
509
522
|
- **RFC 9559** — CMCD (used by `CmcdProducer`)
|
|
510
|
-
- **ATSC A/331** — Signaling, Delivery, Synchronization, Error Protection
|
|
523
|
+
- **ATSC A/331:2026-02 (informative for draft-fec-01 / draft-mmt-01; 7.2 SLS/MP table, 8.1.2.1 MMTP session, 8.1.2.5 AL-FEC) and A/331:2026-04 (normative for draft-multicast-01)** — Signaling, Delivery, Synchronization, Error Protection
|
|
511
524
|
|
|
512
525
|
## Related packages
|
|
513
526
|
|