@blockcast/mmt-container 0.3.0-main.36c5f6abe867 → 0.3.0-main.4c73d3ecc2db

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.
Files changed (167) hide show
  1. package/README.md +22 -8
  2. package/dist/browser-runtime.js +834 -903
  3. package/dist/browser-runtime.js.map +4 -4
  4. package/dist/carp-catalog.d.ts +22 -6
  5. package/dist/carp-catalog.d.ts.map +1 -1
  6. package/dist/carp-catalog.js +19 -6
  7. package/dist/carp-catalog.js.map +2 -2
  8. package/dist/catalog-fec-params.d.ts +68 -28
  9. package/dist/catalog-fec-params.d.ts.map +1 -1
  10. package/dist/catalog-fec-params.js +39 -11
  11. package/dist/catalog-fec-params.js.map +3 -3
  12. package/dist/catalog-network-source.js +0 -1
  13. package/dist/catalog-network-source.js.map +2 -2
  14. package/dist/fec-manager.d.ts +17 -11
  15. package/dist/fec-manager.d.ts.map +1 -1
  16. package/dist/fec-manager.js +106 -165
  17. package/dist/fec-manager.js.map +2 -2
  18. package/dist/fec-state.d.ts +20 -11
  19. package/dist/fec-state.d.ts.map +1 -1
  20. package/dist/fec-state.js +1 -2
  21. package/dist/fec-state.js.map +2 -2
  22. package/dist/fec-worker-setup.d.ts +9 -3
  23. package/dist/fec-worker-setup.d.ts.map +1 -1
  24. package/dist/fec-worker-setup.js +5 -7
  25. package/dist/fec-worker-setup.js.map +2 -2
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +4 -0
  29. package/dist/index.js.map +2 -2
  30. package/dist/iso-block-locator.js +0 -1
  31. package/dist/iso-block-locator.js.map +2 -2
  32. package/dist/mfu-reassembler.js +0 -1
  33. package/dist/mfu-reassembler.js.map +2 -2
  34. package/dist/mmtp-container-parser.d.ts +5 -0
  35. package/dist/mmtp-container-parser.d.ts.map +1 -1
  36. package/dist/mmtp-container-parser.js +22 -1
  37. package/dist/mmtp-container-parser.js.map +2 -2
  38. package/dist/mmtp-container-parser.no-modules.js +33 -4
  39. package/dist/mmtp-container-parser.no-modules.js.map +2 -2
  40. package/dist/mmtp-decode-pipeline.js +22 -1
  41. package/dist/mmtp-decode-pipeline.js.map +2 -2
  42. package/dist/mmtp-router.d.ts +29 -6
  43. package/dist/mmtp-router.d.ts.map +1 -1
  44. package/dist/mmtp-router.js +112 -197
  45. package/dist/mmtp-router.js.map +2 -2
  46. package/dist/multicast-input.js +0 -1
  47. package/dist/multicast-input.js.map +2 -2
  48. package/dist/multicast-manager.d.ts +32 -2
  49. package/dist/multicast-manager.d.ts.map +1 -1
  50. package/dist/multicast-manager.js +412 -370
  51. package/dist/multicast-manager.js.map +4 -4
  52. package/dist/multicast-transport.js +24 -3
  53. package/dist/multicast-transport.js.map +2 -2
  54. package/dist/multicast-unwrap.js +0 -1
  55. package/dist/multicast-unwrap.js.map +2 -2
  56. package/dist/no-modules.js +33 -4
  57. package/dist/no-modules.js.map +2 -2
  58. package/dist/repair-fetch.d.ts +28 -17
  59. package/dist/repair-fetch.d.ts.map +1 -1
  60. package/dist/repair-fetch.js +26 -16
  61. package/dist/repair-fetch.js.map +3 -3
  62. package/dist/repair-layers.d.ts +18 -7
  63. package/dist/repair-layers.d.ts.map +1 -1
  64. package/dist/repair-layers.js +11 -4
  65. package/dist/repair-layers.js.map +2 -2
  66. package/dist/signaling.js +0 -4
  67. package/dist/signaling.js.map +2 -2
  68. package/dist/timestamp-codec.js +0 -1
  69. package/dist/timestamp-codec.js.map +2 -2
  70. package/dist/wasm-mfu-reassembler.js +0 -1
  71. package/dist/wasm-mfu-reassembler.js.map +2 -2
  72. package/dist/wasm-mmtp-container-parser.js +22 -1
  73. package/dist/wasm-mmtp-container-parser.js.map +2 -2
  74. package/node_modules/@blockcast/fec-worker/README.md +6 -6
  75. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts +3 -19
  76. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts.map +1 -1
  77. package/node_modules/@blockcast/fec-worker/dist/block-order.js +3 -33
  78. package/node_modules/@blockcast/fec-worker/dist/block-order.js.map +1 -1
  79. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +2 -3
  80. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +1 -1
  81. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +2 -3
  82. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +1 -1
  83. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +31 -38
  84. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +1 -1
  85. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +22 -117
  86. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +2 -2
  87. package/node_modules/@blockcast/fec-worker/src/block-order.ts +3 -37
  88. package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +2 -3
  89. package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +31 -38
  90. package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +41 -157
  91. package/node_modules/@blockcast/mmt-base/README.md +2 -2
  92. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +7 -7
  93. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -1
  94. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +22 -18
  95. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -1
  96. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -29
  97. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -1
  98. package/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -54
  99. package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -1
  100. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +26 -24
  101. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -1
  102. package/node_modules/@blockcast/mmt-base/dist/signalling.js +16 -16
  103. package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -1
  104. package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +24 -24
  105. package/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -58
  106. package/node_modules/@blockcast/mmt-base/src/signalling.ts +27 -29
  107. package/node_modules/@blockcast/mmt-fec/README.md +4 -4
  108. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +19 -20
  109. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +1 -1
  110. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +26 -92
  111. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +1 -1
  112. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +16 -72
  113. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +1 -1
  114. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +17 -96
  115. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +1 -1
  116. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +1 -1
  117. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +1 -1
  118. package/node_modules/@blockcast/mmt-fec/dist/index.js +1 -1
  119. package/node_modules/@blockcast/mmt-fec/dist/index.js.map +1 -1
  120. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +2 -2
  121. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +7 -7
  122. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -1
  123. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +22 -18
  124. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -1
  125. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -29
  126. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -1
  127. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -54
  128. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -1
  129. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +26 -24
  130. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -1
  131. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js +16 -16
  132. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -1
  133. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +24 -24
  134. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -58
  135. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/signalling.ts +27 -29
  136. package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +30 -109
  137. package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +23 -108
  138. package/node_modules/@blockcast/mmt-fec/src/index.ts +0 -1
  139. package/package.json +6 -6
  140. package/schemas/catalog.schema.json +2 -2
  141. package/src/carp-catalog.ts +30 -9
  142. package/src/catalog-fec-params.ts +128 -54
  143. package/src/fec-manager.ts +156 -213
  144. package/src/fec-state.ts +20 -11
  145. package/src/fec-worker-setup.ts +15 -7
  146. package/src/index.ts +2 -0
  147. package/src/mmtp-container-parser.ts +26 -0
  148. package/src/mmtp-router.ts +124 -272
  149. package/src/multicast-manager.ts +137 -25
  150. package/src/repair-fetch.ts +36 -22
  151. package/src/repair-layers.ts +28 -8
  152. package/test-vectors/catalog/README.md +34 -17
  153. package/test-vectors/catalog/negative/fec-block-profile-retired.json +52 -0
  154. package/test-vectors/catalog/negative/fec-enhancement-repair-removed.json +1 -1
  155. package/test-vectors/catalog/negative/fec-repair-layer-geometry.json +1 -1
  156. package/test-vectors/catalog/negative/fec-repair-layer-missing-symbols.json +1 -1
  157. package/test-vectors/catalog/negative/fec-repair-multiple-depends.json +1 -1
  158. package/test-vectors/catalog/negative/fec-repair-overlay-with-layer.json +1 -1
  159. package/test-vectors/catalog/negative/fec-repair-priority-out-of-band.json +1 -1
  160. package/test-vectors/catalog/negative/fec-repair-source-symbols-without-scope.json +1 -1
  161. package/test-vectors/catalog/negative/multicast-network-source-empty.json +1 -1
  162. package/test-vectors/catalog/negative/raptorq-source-symbols-over-max.json +1 -1
  163. package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +1 -1
  164. package/test-vectors/catalog/positive/fec-layered-repair.json +2 -2
  165. package/test-vectors/catalog/positive/fec-multicast.json +2 -1
  166. package/test-vectors/catalog/positive/multicast-native-ssm-no-network-source.json +2 -1
  167. package/test-vectors/catalog-validation.json +40 -5
package/README.md CHANGED
@@ -180,12 +180,13 @@ type FecAlgorithm = "none" | "raptorq" | "reed-solomon"
180
180
 
181
181
  interface FecCatalogConfig {
182
182
  algorithm: FecAlgorithm // §3.1
183
- sourceSymbols: number // K (REQUIRED)
183
+ blockProfile?: "iso-ssbg1-v1" // REQUIRED unless algorithm is "none"; never defaulted (BLO-35597)
184
+ sourceSymbols: number // K (REQUIRED): K_max, the largest SSB_length of any block
184
185
  repairSymbols: number // P (REQUIRED)
185
186
  symbolSize: number // T, 8-byte aligned (REQUIRED)
186
187
  interleaveDepthMs?: number // FEC block span in MILLISECONDS, default 0 (single-group blocks)
187
188
  repairTrack: string // §6.1 — required
188
- mode?: "interleaved" | "object"
189
+ mode?: "interleaved" | "object" // extension; "object" (per-frame object blocks) is retired: @blockcast/mmt-fec refuses it
189
190
  uep?: { keyRatio: number; deltaRatio: number } // §9.1 — Unequal Error Protection
190
191
  deltaFailWindowBlocks?: number // D-11, base track only
191
192
  deltaProbeIntervalMs?: number // D-13, base track only
@@ -292,7 +293,8 @@ Codec-agnostic FEC decode service. Owns per-track decoder instances (sync WASM v
292
293
 
293
294
  ```ts
294
295
  interface FECManagerConfig {
295
- k?: number
296
+ blockProfile?: FecBlockProfile // "iso-ssbg1-v1"; required for every FEC track, validated with parseFecBlockProfile
297
+ k?: number // K_max (largest SSB_length), never a block stride
296
298
  symbolSize?: number // T (bytes per symbol). NOT repair count.
297
299
  interleaveDepthMs?: number // FEC block span in MILLISECONDS — see MIN_INTERLEAVE_DEPTH_MS in fec-manager.ts
298
300
  fps?: number
@@ -314,6 +316,15 @@ class FECManager {
314
316
 
315
317
  `FECManager.configure()` takes `symbolSize` (bytes per symbol, T). Repair count is a distinct parameter and must never be passed in its place.
316
318
 
319
+ FEC blocks follow one block profile, `iso-ssbg1-v1` (ISO/IEC 23008-1 Annex C ssbg_mode1, BLO-35597):
320
+
321
+ - A source symbol is `u16 length || packet || 00h` padding to T.
322
+ - A block is K' = SSB_length symbols keyed by its 32-bit SS_Start, and SS_ID increments by one per FEC source packet, wrapping at 2^32 (RFC 1982 serial arithmetic). Blocks are variable-length (SSB_length ≤ K), so K is an upper bound and never a stride: no block number is computed from an SS_ID.
323
+ - A source symbol is placed in a block only once a repair symbol states that block's (SS_Start, SSB_length); until then it is held. Repair ESI = SSB_length + RS_ID.
324
+ - The `sbn` in `getBlockStates()`, the block callbacks, and `RepairFetchRequest` is that SS_Start block key (the name is historical). The MoQ repair group id is the 62-bit wrap-epoch-extended SS_Start (`extSsStart` in `@blockcast/mmt-fec`), never the 32-bit key itself.
325
+
326
+ `blockProfile` is never defaulted and never inferred from the wire. The retired Blockcast-private token `k-padded-v1` (zero-padded K-symbol blocks) is refused wherever a profile is read: `parseFecBlockProfile` throws for it (and for an absent token), and `FECManager` track configuration, `setupFecWorkerForTrack`, and `wireRepairFetch` all validate through it.
327
+
317
328
  `interleaveDepthMs` is the full FEC block span in **milliseconds** per CARP §5.1, valid range 33 ms (interactive / gaming, `MIN_INTERLEAVE_DEPTH_MS`) to 10 000 ms (broadcast ATSC 3.0). `configure()` warns if a positive value below `MIN_INTERLEAVE_DEPTH_MS` (33) is passed — that is almost certainly a raw frame count, not milliseconds — and such sub-floor values never drive the block timeout (the established timeout is preserved instead of collapsing to ~0).
318
329
 
319
330
  ### Keyframe-protected repair (`./block-policy`, `./conceal-timeline`)
@@ -325,9 +336,10 @@ Every FEC block still gets in-band FEC decode. On top of that:
325
336
  DU-header sample position) against catalog geometry (framerate,
326
337
  `interleaveDepthMs`, keyframe interval). Geometry that cannot be derived
327
338
  exactly, or any violated invariant, runs the track `all-protected` (every
328
- video block `unknown`). Vanished blocks are materialised from SBN evidence.
329
- A frame split across ADJACENT blocks (a K-close) is expected; only source
330
- packets whose authored order and SBN order disagree (a round-robin
339
+ video block `unknown`). A block every symbol of which vanished is
340
+ materialised from the surrounding block evidence. A frame split across
341
+ ADJACENT blocks (a block closing at K symbols) is expected; only source
342
+ packets whose authored order and block order disagree (a round-robin
331
343
  interleave) trip `block-not-contiguous`. Pass the catalog track name to
332
344
  `configureTrackFec(packetId, config, catalogTrackName)` so ABR rungs that
333
345
  share a packetId each classify with their own framerate and GOP; a rung on
@@ -336,8 +348,10 @@ Every FEC block still gets in-band FEC decode. On top of that:
336
348
  and P1 (`audio`) immediately; P2 (`delta`) only while no P0/P1 is queued or
337
349
  in flight, earliest deadline first, preempted by any new P0/P1. No timers.
338
350
  - **FETCH priority (draft-ramadan-moq-fec §11.4.5).** The transport gets one
339
- `RepairFetchRequest { repairTrack, sbn, packetId, signal,
340
- subscriberPriority }` and puts `subscriberPriority` on the FETCH
351
+ `RepairFetchRequest { repairTrack, sbn, blockProfile, packetId, signal,
352
+ subscriberPriority }`, FETCHes the block's repair group (MoQ group id
353
+ `extSsStart(wrapEpoch, sbn)`, never `sbn` itself), and puts
354
+ `subscriberPriority` on the FETCH
341
355
  (`undefined` = omit the parameter; the publisher then uses 128,
342
356
  draft-ietf-moq-transport-16 §9.2.2.3). P0 requests carry
343
357
  `min(sourcePriority, 191)`; P1/P2 carry `max(repairPriority, 192)`. Both