@blockcast/mmt-container 2.2.0-main.7a01a10f6629 → 2.2.0-main.986a21fc9782

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 (96) hide show
  1. package/README.md +29 -17
  2. package/dist/browser-runtime.js +1000 -213
  3. package/dist/browser-runtime.js.map +4 -4
  4. package/dist/carp-catalog.js.map +1 -1
  5. package/dist/catalog-fec-params.d.ts +17 -1
  6. package/dist/catalog-fec-params.d.ts.map +1 -1
  7. package/dist/catalog-fec-params.js +15 -0
  8. package/dist/catalog-fec-params.js.map +2 -2
  9. package/dist/catalog-network-source.js.map +1 -1
  10. package/dist/cmcd-producer.d.ts +60 -47
  11. package/dist/cmcd-producer.d.ts.map +1 -1
  12. package/dist/cmcd-producer.js +138 -109
  13. package/dist/cmcd-producer.js.map +2 -2
  14. package/dist/delivery-catalog.js +26 -16
  15. package/dist/delivery-catalog.js.map +2 -2
  16. package/dist/delta-fallback-config.js.map +1 -1
  17. package/dist/fec-manager.d.ts +33 -1
  18. package/dist/fec-manager.d.ts.map +1 -1
  19. package/dist/fec-manager.js +222 -6
  20. package/dist/fec-manager.js.map +2 -2
  21. package/dist/fec-state.js.map +1 -1
  22. package/dist/fec-worker-setup.d.ts +1 -1
  23. package/dist/fec-worker-setup.js +1 -1
  24. package/dist/fec-worker-setup.js.map +1 -1
  25. package/dist/held-layer-admission.js.map +1 -1
  26. package/dist/index.d.ts +5 -4
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +9 -1
  29. package/dist/index.js.map +2 -2
  30. package/dist/iso-block-locator.d.ts +9 -0
  31. package/dist/iso-block-locator.d.ts.map +1 -1
  32. package/dist/iso-block-locator.js +17 -0
  33. package/dist/iso-block-locator.js.map +2 -2
  34. package/dist/iso-bmff-timing.d.ts +10 -1
  35. package/dist/iso-bmff-timing.d.ts.map +1 -1
  36. package/dist/iso-bmff-timing.js +36 -2
  37. package/dist/iso-bmff-timing.js.map +2 -2
  38. package/dist/media-router.js.map +1 -1
  39. package/dist/mfu-reassembler.js +12 -19
  40. package/dist/mfu-reassembler.js.map +2 -2
  41. package/dist/mmtp-container-parser.d.ts +58 -10
  42. package/dist/mmtp-container-parser.d.ts.map +1 -1
  43. package/dist/mmtp-container-parser.js +105 -34
  44. package/dist/mmtp-container-parser.js.map +2 -2
  45. package/dist/mmtp-container-parser.no-modules.js +229 -51
  46. package/dist/mmtp-container-parser.no-modules.js.map +3 -3
  47. package/dist/mmtp-decode-pipeline.js +104 -34
  48. package/dist/mmtp-decode-pipeline.js.map +2 -2
  49. package/dist/mmtp-fec-session.d.ts +41 -3
  50. package/dist/mmtp-fec-session.d.ts.map +1 -1
  51. package/dist/mmtp-fec-session.js +118 -13
  52. package/dist/mmtp-fec-session.js.map +3 -3
  53. package/dist/mmtp-router.d.ts +18 -1
  54. package/dist/mmtp-router.d.ts.map +1 -1
  55. package/dist/mmtp-router.js +323 -64
  56. package/dist/mmtp-router.js.map +2 -2
  57. package/dist/multicast-auth-catalog.js.map +1 -1
  58. package/dist/multicast-input.js.map +1 -1
  59. package/dist/multicast-manager.d.ts +2 -0
  60. package/dist/multicast-manager.d.ts.map +1 -1
  61. package/dist/multicast-manager.js +546 -70
  62. package/dist/multicast-manager.js.map +2 -2
  63. package/dist/multicast-transport.js +26 -16
  64. package/dist/multicast-transport.js.map +2 -2
  65. package/dist/multicast-unwrap.js +12 -19
  66. package/dist/multicast-unwrap.js.map +2 -2
  67. package/dist/no-modules.js +222 -48
  68. package/dist/no-modules.js.map +3 -3
  69. package/dist/repair-fetch.js.map +1 -1
  70. package/dist/repair-layer-subscriptions.d.ts +82 -0
  71. package/dist/repair-layer-subscriptions.d.ts.map +1 -0
  72. package/dist/repair-layer-subscriptions.js +192 -0
  73. package/dist/repair-layer-subscriptions.js.map +7 -0
  74. package/dist/signaling.js.map +1 -1
  75. package/dist/timestamp-codec.js +12 -19
  76. package/dist/timestamp-codec.js.map +2 -2
  77. package/dist/track-session.d.ts +1 -1
  78. package/dist/track-session.js.map +1 -1
  79. package/dist/wasm-mfu-reassembler.js.map +1 -1
  80. package/dist/wasm-mmtp-container-parser.js +104 -34
  81. package/dist/wasm-mmtp-container-parser.js.map +2 -2
  82. package/package.json +8 -5
  83. package/schemas/catalog.schema.json +4 -0
  84. package/src/catalog-fec-params.ts +36 -1
  85. package/src/cmcd-producer.ts +189 -179
  86. package/src/fec-manager.ts +277 -6
  87. package/src/fec-worker-setup.ts +2 -2
  88. package/src/index.ts +18 -2
  89. package/src/iso-block-locator.ts +19 -0
  90. package/src/iso-bmff-timing.ts +40 -1
  91. package/src/mmtp-container-parser.ts +125 -19
  92. package/src/mmtp-fec-session.ts +115 -15
  93. package/src/mmtp-router.ts +350 -13
  94. package/src/multicast-manager.ts +3 -0
  95. package/src/repair-layer-subscriptions.ts +261 -0
  96. package/src/track-session.ts +1 -1
package/README.md CHANGED
@@ -74,7 +74,7 @@ The package exposes a wide subpath surface so consumers can tree-shake aggressiv
74
74
  | `./multicast-unwrap` | Container-aware MMTP dispatch (LOC vs raw MMTP) |
75
75
  | `./signaling` | Packet-type classifier (`isSignalingPacket`, `isSourcePacket`, `classifyPacket`) |
76
76
  | `./mmtp-container-parser` | `MmtpContainerParser` (the unified, transport-agnostic parser) |
77
- | `./cmcd-producer` | `CmcdProducer` — RFC 9559 CMCD with `x-bc-*` vendor keys |
77
+ | `./cmcd-producer` | `CmcdProducer` — CMCD v2 Event-mode reports (CTA-5004-B) with `com.blockcast-*` custom keys |
78
78
  | `./cmaf-block-assembler` | `CmafBlockAssembler` — assembles one CMAF segment per FEC source block |
79
79
  | `./cmaf-group-batcher` | `CmafGroupBatcher` — MoQ group → CMAF segment batcher |
80
80
  | `./carp-catalog` | CARP / CMSF catalog types, track-role parser, switching-set validator, track-timing |
@@ -425,36 +425,47 @@ Per-track timestamp rebase (`#videoBaseTs` / `#audioBaseTs` at `mmtp-to-cmaf.ts:
425
425
 
426
426
  ### CMCD producer (`./cmcd-producer`)
427
427
 
428
- Transport-agnostic CMCD (Common Media Client Data) telemetry per **RFC 9559**. Maps `FecTrackStats` snapshots and `TransportSnapshot` state to `x-bc-*` vendor keys (proto tags 70-99). Does NOT call `fetch()` or write to QUIC — emits via two callbacks (`onCmcdParams` for MoQ SUBSCRIBE params; `onCmcdPost` for HTTP POST query strings).
428
+ CMCD v2 Event-mode reports (**CTA-5004-B** §2.2) for a player. Maps `FecTrackStats` snapshots, repair lifecycle events and `TransportSnapshot` state to newline-separated `application/cmcd` records (§3.3). Each record is an RFC 8941 dictionary with keys in alphabetical order and carries `v=2`, `ts`, `e`, `sn` and `sid`. Does NOT call `fetch()`: the player POSTs the body handed to `onCmcdPost` with `Content-Type: application/cmcd`.
429
429
 
430
430
  ```ts
431
431
  class CmcdProducer {
432
- constructor(opts: CmcdProducerOptions)
432
+ constructor(opts: { onCmcdPost?: (body: string) => void; intervalMs?: number; sessionId?: string; now?: () => number })
433
433
  updateTransport(snapshot: TransportSnapshot): void
434
434
  updatePlayMode(mode: "full" | "base-only" | "single-track"): void
435
435
  updateDeltaFailRate(rate: number): void
436
+ updateFecFailClosed(reason: FecFailClosedReason): void
437
+ updateManifestVerification(stats: ManifestVerificationStats): void
436
438
  incrementSwitchMiscount(): void
439
+ onRepairLifecycle(event: RepairLifecycleEvent): void
437
440
  emitSwitchDrift(driftUs: number): void
438
441
  onSnapshot(data: SnapshotData): void
442
+ onTransportSnapshot(data: TransportOnlySnapshotData): void
439
443
  onTransition(event: TransportTransitionEvent): void
440
444
  }
441
445
  ```
442
446
 
443
- Vendor keys emitted (BLO-1044):
447
+ Reports:
444
448
 
445
- | Key | Source | Notes |
449
+ | `e` | When | Carries |
450
+ |-----|------|---------|
451
+ | `t` | heartbeat, every `intervalMs` (default 30 s), driven by snapshots | Table 1 keys only |
452
+ | `ce`, `cen="com.blockcast-fec"` | with each `t` | the `com.blockcast-*` counters below |
453
+ | `e` | FEC fails closed (fec-01 6.3.9), once per reason | `ec` = reason code |
454
+ | `ce`, `cen="com.blockcast-ct"` | transport transition | `-ct` (`mc-start` / `mc-to-uc` / `amt-start`), transport keys |
455
+ | `ce`, `cen="com.blockcast-switch-drift"` | `emitSwitchDrift()` | `-sdu` |
456
+
457
+ Custom keys ride only `e=ce` (§2.2 admits only Table 1 keys on Event reports; the Table 1 `cen` row admits a custom key-value pair). Values are STRING or TOKEN of at most 64 characters (§4.1); numbers go out as strings, and a longer value is omitted. A value that is unknown is omitted, never sent as zero (§3). Counters are absolute since session start.
458
+
459
+ | Key (`com.blockcast-`) | Source | Value |
446
460
  |-----|--------|-------|
447
- | `x-bc-fec-algo` | FEC config | `none` / `raptorq` / `reed-solomon` |
448
- | `x-bc-fec-k`, `x-bc-fec-p` | FEC config | source / repair counts |
449
- | `x-bc-fec-recovery` | `recoveryRate` | Block-level recovery, 4 decimal places |
450
- | `x-bc-transport` | `TransportSnapshot.transport` | `native` / `amt` / `moq` |
451
- | `x-bc-multicast-group`, `x-bc-multicast-source`, `x-bc-amt-relay` | endpoint | Omitted when null |
452
- | `x-bc-play-mode` | Phase 14 D-12 | `full` / `base-only` / `single-track` |
453
- | `x-bc-delta-fail-rate` | Phase 14 D-15 | 0..1, omitted on single-track |
454
- | `x-bc-switch-miscount`, `x-bc-switch-drift-us` | switching-set drift | One-shot for drift |
455
- | `x-bc-ct` | transport transition | `mc-start` / `mc-to-uc` / `amt-start` |
456
-
457
- All string values pass through `sanitize()` (T-06-01) — commas, `\r`, `\n` are stripped to prevent header injection.
461
+ | `fa`, `fk`, `fp` | FEC config | algorithm; K; P as joined |
462
+ | `pr`, `pl`, `pu` | `FecTrackStats` | source packets received; missing before FEC; still missing after FEC |
463
+ | `fbf` | `FecTrackStats.blocksFailed` | failed blocks |
464
+ | `fbr`, `fbq`, `fbfk` | repair lifecycle (video blocks) | recovered in band; recovered by repair FETCH; failed keyframe-class. Absent until `onRepairLifecycle` is fed |
465
+ | `tr`, `sg`, `ar` | `TransportSnapshot` | `ssm` / `amt` / `moq`; `"<group>@<source>"`; AMT relay |
466
+ | `pm`, `dfr` | play mode | `full` / `base-only` / `single-track`; delta fail rate, 3 decimals |
467
+ | `ffc`, `ffl` | FEC fail-closed | reason code; held layer |
468
+ | `sm`, `mv`, `mf` | switching set, source auth | miscount; manifests verified; verification failures |
458
469
 
459
470
  ### Multicast transport (`./multicast-transport`)
460
471
 
@@ -527,7 +538,8 @@ Roles are required by:
527
538
  - **draft-ramadan-moq-mmt-01** — MMT-over-MoQ wire format (§4.4.2 group-duration signaling, §4 MoQ object mapping, §5 MFU mode)
528
539
  - **draft-ramadan-moq-fec** — AL-FEC over MoQ (§5.3 FEC Source Info object extension 0x11: SS_ID(32), fixed 4 bytes)
529
540
  - **RFC 6330** — RaptorQ Forward Error Correction (strict OTI codec in `@blockcast/mmt-fec`)
530
- - **RFC 9559** — CMCD (used by `CmcdProducer`)
541
+ - **CTA-5004-B** — CMCD v2 (used by `CmcdProducer`, Event mode)
542
+ - **RFC 8941** — Structured Field Values (CMCD record encoding)
531
543
  - **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
532
544
 
533
545
  ## Related packages