@blockcast/mmt-container 0.3.0 → 0.4.0-main.1e94b11199ea
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 +33 -16
- package/dist/browser-runtime.js +14816 -14254
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +24 -19
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +32 -14
- package/dist/carp-catalog.js.map +4 -4
- package/dist/catalog-fec-params.d.ts +88 -28
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +60 -23
- package/dist/catalog-fec-params.js.map +4 -4
- package/dist/catalog-network-source.js +1 -7
- package/dist/catalog-network-source.js.map +4 -4
- package/dist/cmaf-block-assembler.d.ts +0 -2
- package/dist/cmaf-block-assembler.d.ts.map +1 -1
- package/dist/cmaf-block-assembler.js +0 -1
- package/dist/cmaf-block-assembler.js.map +2 -2
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js +0 -4
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.d.ts +124 -0
- package/dist/delivery-catalog.d.ts.map +1 -0
- package/dist/delivery-catalog.js +1857 -0
- package/dist/delivery-catalog.js.map +7 -0
- package/dist/delta-fallback-config.d.ts +42 -0
- package/dist/delta-fallback-config.d.ts.map +1 -0
- package/dist/delta-fallback-config.js +59 -0
- package/dist/delta-fallback-config.js.map +7 -0
- package/dist/fec-manager.d.ts +52 -30
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +338 -293
- package/dist/fec-manager.js.map +4 -4
- package/dist/fec-state.d.ts +19 -31
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +4 -10
- package/dist/fec-state.js.map +4 -4
- package/dist/fec-worker-setup.d.ts +18 -14
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +81 -96
- package/dist/fec-worker-setup.js.map +4 -4
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.js +1 -7
- package/dist/iso-block-locator.js.map +4 -4
- package/dist/media-router.d.ts +20 -8
- package/dist/media-router.d.ts.map +1 -1
- package/dist/media-router.js +46 -21
- package/dist/media-router.js.map +2 -2
- package/dist/mfu-reassembler.js +24 -30
- package/dist/mfu-reassembler.js.map +4 -4
- package/dist/mmtp-container-parser.d.ts +14 -11
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +126 -99
- package/dist/mmtp-container-parser.js.map +4 -4
- package/dist/mmtp-container-parser.no-modules.js +154 -108
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +126 -99
- package/dist/mmtp-decode-pipeline.js.map +4 -4
- package/dist/mmtp-router.d.ts +51 -29
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +260 -326
- package/dist/mmtp-router.js.map +4 -4
- package/dist/multicast-input.js +1 -7
- package/dist/multicast-input.js.map +4 -4
- package/dist/multicast-manager.d.ts +72 -6
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +882 -673
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +1 -1
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +44 -26
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +29 -35
- package/dist/multicast-unwrap.js.map +4 -4
- package/dist/no-modules.js +150 -106
- package/dist/no-modules.js.map +4 -4
- package/dist/repair-fetch.d.ts +116 -21
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +114 -34
- package/dist/repair-fetch.js.map +4 -4
- package/dist/repair-layers.d.ts +18 -7
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +12 -10
- package/dist/repair-layers.js.map +4 -4
- package/dist/signaling.js +2 -11
- package/dist/signaling.js.map +4 -4
- package/dist/timestamp-codec.js +24 -30
- package/dist/timestamp-codec.js.map +4 -4
- package/dist/track-session.d.ts +7 -0
- package/dist/track-session.d.ts.map +1 -1
- package/dist/track-session.js +15 -8
- package/dist/track-session.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js +1 -7
- package/dist/wasm-mfu-reassembler.js.map +4 -4
- package/dist/wasm-mmtp-container-parser.js +126 -99
- package/dist/wasm-mmtp-container-parser.js.map +4 -4
- package/package.json +7 -14
- package/schemas/catalog.schema.json +3 -3
- package/src/carp-catalog.ts +51 -24
- package/src/catalog-fec-params.ts +173 -64
- package/src/cmaf-block-assembler.ts +1 -4
- package/src/cmcd-producer.ts +0 -6
- package/src/delivery-catalog.ts +498 -0
- package/src/delta-fallback-config.ts +72 -0
- package/src/fec-manager.ts +457 -334
- package/src/fec-state.ts +20 -32
- package/src/fec-worker-setup.ts +109 -90
- package/src/index.ts +32 -0
- package/src/media-router.ts +59 -21
- package/src/mmtp-container-parser.ts +106 -20
- package/src/mmtp-router.ts +189 -330
- package/src/multicast-manager.ts +265 -86
- package/src/multicast-transport.ts +16 -9
- package/src/repair-fetch.ts +273 -43
- package/src/repair-layers.ts +28 -8
- package/src/track-session.ts +28 -9
- package/test-vectors/catalog/README.md +44 -18
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +52 -0
- package/test-vectors/catalog/negative/fec-enhancement-repair-removed.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-layer-geometry.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-layer-missing-symbols.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-multiple-depends.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-overlay-with-layer.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-priority-out-of-band.json +1 -1
- package/test-vectors/catalog/negative/fec-repair-source-symbols-without-scope.json +1 -1
- package/test-vectors/catalog/negative/multicast-endpoint-relay-address.json +39 -0
- package/test-vectors/catalog/negative/multicast-network-source-empty.json +1 -1
- package/test-vectors/catalog/negative/raptorq-source-symbols-over-max.json +1 -1
- package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +2 -1
- package/test-vectors/catalog/positive/fec-layered-repair.json +2 -2
- package/test-vectors/catalog/positive/fec-multicast.json +2 -1
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +38 -0
- package/test-vectors/catalog/positive/multicast-native-ssm-no-network-source.json +2 -1
- package/test-vectors/catalog/section-codes.json +33 -0
- package/test-vectors/catalog-timing.json +356 -0
- package/test-vectors/catalog-validation.json +40 -5
- package/test-vectors/delivery-catalog/README.md +11 -0
- package/test-vectors/delivery-catalog/negative/missing-block-profile.json +58 -0
- package/test-vectors/delivery-catalog/negative/packet-id-signaling.json +59 -0
- package/test-vectors/delivery-catalog/negative/retired-k-padded-block-profile.json +59 -0
- package/test-vectors/delivery-catalog/positive/dash.json +56 -0
- package/test-vectors/delivery-catalog/positive/mmtp-source-only.json +43 -0
- package/node_modules/@blockcast/fec-worker/README.md +0 -223
- package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts +0 -38
- package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/block-order.js +0 -78
- package/node_modules/@blockcast/fec-worker/dist/block-order.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +0 -93
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +0 -346
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +0 -380
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +0 -11
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +0 -14
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +0 -859
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +0 -7
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts +0 -10
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/index.js +0 -8
- package/node_modules/@blockcast/fec-worker/dist/index.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +0 -20
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +0 -370
- package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +0 -7
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +0 -104
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +0 -181
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +0 -194
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +0 -62
- package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +0 -9
- package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +0 -1
- package/node_modules/@blockcast/fec-worker/dist/transfer.js +0 -13
- package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +0 -1
- package/node_modules/@blockcast/fec-worker/package.json +0 -59
- package/node_modules/@blockcast/fec-worker/src/block-order.ts +0 -93
- package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +0 -392
- package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +0 -399
- package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +0 -1502
- package/node_modules/@blockcast/fec-worker/src/index.ts +0 -35
- package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +0 -589
- package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +0 -222
- package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +0 -209
- package/node_modules/@blockcast/fec-worker/src/transfer.ts +0 -12
- package/node_modules/@blockcast/mmt-alta-parse/README.md +0 -181
- package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +0 -57
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +0 -115
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-alta-parse/package.json +0 -50
- package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +0 -136
- package/node_modules/@blockcast/mmt-base/README.md +0 -134
- package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +0 -55
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +0 -128
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts +0 -7
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/index.js +0 -7
- package/node_modules/@blockcast/mmt-base/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +0 -292
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js +0 -612
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +0 -18
- package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/net-constants.js +0 -18
- package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +0 -47
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +0 -54
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -57
- package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -98
- package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +0 -312
- package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-base/dist/signalling.js +0 -637
- package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +0 -1
- package/node_modules/@blockcast/mmt-base/package.json +0 -49
- package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +0 -145
- package/node_modules/@blockcast/mmt-base/src/index.ts +0 -6
- package/node_modules/@blockcast/mmt-base/src/mmtp.ts +0 -892
- package/node_modules/@blockcast/mmt-base/src/net-constants.ts +0 -17
- package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +0 -67
- package/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -107
- package/node_modules/@blockcast/mmt-base/src/signalling.ts +0 -862
- package/node_modules/@blockcast/mmt-fec/README.md +0 -271
- package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +0 -82
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +0 -296
- package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +0 -106
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +0 -288
- package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +0 -46
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +0 -96
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +0 -33
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +0 -57
- package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +0 -205
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +0 -240
- package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +0 -28
- package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/index.js +0 -28
- package/node_modules/@blockcast/mmt-fec/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +0 -20
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +0 -28
- package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +0 -258
- package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/oti.js +0 -382
- package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +0 -41
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +0 -81
- package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts +0 -82
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.js +0 -170
- package/node_modules/@blockcast/mmt-fec/dist/repair-group.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +0 -181
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +0 -57
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +0 -115
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +0 -50
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +0 -136
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +0 -134
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +0 -55
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +0 -128
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +0 -7
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +0 -7
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +0 -292
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +0 -612
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +0 -18
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js +0 -18
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +0 -47
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js +0 -54
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -57
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -98
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +0 -312
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js +0 -637
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js.map +0 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +0 -49
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +0 -145
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +0 -6
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +0 -892
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/net-constants.ts +0 -17
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/ntp-short.ts +0 -67
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -107
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/signalling.ts +0 -862
- package/node_modules/@blockcast/mmt-fec/package.json +0 -79
- package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +0 -371
- package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +0 -439
- package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +0 -127
- package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +0 -68
- package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +0 -310
- package/node_modules/@blockcast/mmt-fec/src/index.ts +0 -94
- package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +0 -34
- package/node_modules/@blockcast/mmt-fec/src/oti.ts +0 -463
- package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +0 -101
- package/node_modules/@blockcast/mmt-fec/src/repair-group.ts +0 -195
- package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +0 -28
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +0 -128
- package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +0 -4
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +0 -4
- package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +0 -37
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +0 -179
- package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +0 -99
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +0 -492
- package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +0 -1
- package/node_modules/@blockcast/mmt-manifest-verify/package.json +0 -45
- package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +0 -171
- package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +0 -3
- package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +0 -230
- package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +0 -669
- package/node_modules/@noble/hashes/LICENSE +0 -21
- package/node_modules/@noble/hashes/README.md +0 -521
- package/node_modules/@noble/hashes/_assert.d.ts +0 -17
- package/node_modules/@noble/hashes/_assert.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_assert.js +0 -18
- package/node_modules/@noble/hashes/_assert.js.map +0 -1
- package/node_modules/@noble/hashes/_blake.d.ts +0 -14
- package/node_modules/@noble/hashes/_blake.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_blake.js +0 -50
- package/node_modules/@noble/hashes/_blake.js.map +0 -1
- package/node_modules/@noble/hashes/_md.d.ts +0 -51
- package/node_modules/@noble/hashes/_md.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_md.js +0 -162
- package/node_modules/@noble/hashes/_md.js.map +0 -1
- package/node_modules/@noble/hashes/_u64.d.ts +0 -55
- package/node_modules/@noble/hashes/_u64.d.ts.map +0 -1
- package/node_modules/@noble/hashes/_u64.js +0 -90
- package/node_modules/@noble/hashes/_u64.js.map +0 -1
- package/node_modules/@noble/hashes/argon2.d.ts +0 -32
- package/node_modules/@noble/hashes/argon2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/argon2.js +0 -401
- package/node_modules/@noble/hashes/argon2.js.map +0 -1
- package/node_modules/@noble/hashes/blake1.d.ts +0 -106
- package/node_modules/@noble/hashes/blake1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake1.js +0 -459
- package/node_modules/@noble/hashes/blake1.js.map +0 -1
- package/node_modules/@noble/hashes/blake2.d.ts +0 -116
- package/node_modules/@noble/hashes/blake2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake2.js +0 -420
- package/node_modules/@noble/hashes/blake2.js.map +0 -1
- package/node_modules/@noble/hashes/blake2b.d.ts +0 -11
- package/node_modules/@noble/hashes/blake2b.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake2b.js +0 -14
- package/node_modules/@noble/hashes/blake2b.js.map +0 -1
- package/node_modules/@noble/hashes/blake2s.d.ts +0 -20
- package/node_modules/@noble/hashes/blake2s.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake2s.js +0 -24
- package/node_modules/@noble/hashes/blake2s.js.map +0 -1
- package/node_modules/@noble/hashes/blake3.d.ts +0 -54
- package/node_modules/@noble/hashes/blake3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/blake3.js +0 -255
- package/node_modules/@noble/hashes/blake3.js.map +0 -1
- package/node_modules/@noble/hashes/crypto.d.ts +0 -2
- package/node_modules/@noble/hashes/crypto.d.ts.map +0 -1
- package/node_modules/@noble/hashes/crypto.js +0 -5
- package/node_modules/@noble/hashes/crypto.js.map +0 -1
- package/node_modules/@noble/hashes/cryptoNode.d.ts +0 -2
- package/node_modules/@noble/hashes/cryptoNode.d.ts.map +0 -1
- package/node_modules/@noble/hashes/cryptoNode.js +0 -18
- package/node_modules/@noble/hashes/cryptoNode.js.map +0 -1
- package/node_modules/@noble/hashes/eskdf.d.ts +0 -47
- package/node_modules/@noble/hashes/eskdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/eskdf.js +0 -166
- package/node_modules/@noble/hashes/eskdf.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_assert.d.ts +0 -17
- package/node_modules/@noble/hashes/esm/_assert.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_assert.js +0 -15
- package/node_modules/@noble/hashes/esm/_assert.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_blake.d.ts +0 -14
- package/node_modules/@noble/hashes/esm/_blake.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_blake.js +0 -45
- package/node_modules/@noble/hashes/esm/_blake.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_md.d.ts +0 -51
- package/node_modules/@noble/hashes/esm/_md.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_md.js +0 -155
- package/node_modules/@noble/hashes/esm/_md.js.map +0 -1
- package/node_modules/@noble/hashes/esm/_u64.d.ts +0 -55
- package/node_modules/@noble/hashes/esm/_u64.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/_u64.js +0 -67
- package/node_modules/@noble/hashes/esm/_u64.js.map +0 -1
- package/node_modules/@noble/hashes/esm/argon2.d.ts +0 -32
- package/node_modules/@noble/hashes/esm/argon2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/argon2.js +0 -392
- package/node_modules/@noble/hashes/esm/argon2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake1.d.ts +0 -106
- package/node_modules/@noble/hashes/esm/blake1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake1.js +0 -452
- package/node_modules/@noble/hashes/esm/blake1.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2.d.ts +0 -116
- package/node_modules/@noble/hashes/esm/blake2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2.js +0 -413
- package/node_modules/@noble/hashes/esm/blake2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2b.d.ts +0 -11
- package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2b.js +0 -11
- package/node_modules/@noble/hashes/esm/blake2b.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2s.d.ts +0 -20
- package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake2s.js +0 -21
- package/node_modules/@noble/hashes/esm/blake2s.js.map +0 -1
- package/node_modules/@noble/hashes/esm/blake3.d.ts +0 -54
- package/node_modules/@noble/hashes/esm/blake3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/blake3.js +0 -251
- package/node_modules/@noble/hashes/esm/blake3.js.map +0 -1
- package/node_modules/@noble/hashes/esm/crypto.d.ts +0 -2
- package/node_modules/@noble/hashes/esm/crypto.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/crypto.js +0 -2
- package/node_modules/@noble/hashes/esm/crypto.js.map +0 -1
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +0 -2
- package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/cryptoNode.js +0 -15
- package/node_modules/@noble/hashes/esm/cryptoNode.js.map +0 -1
- package/node_modules/@noble/hashes/esm/eskdf.d.ts +0 -47
- package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/eskdf.js +0 -160
- package/node_modules/@noble/hashes/esm/eskdf.js.map +0 -1
- package/node_modules/@noble/hashes/esm/hkdf.d.ts +0 -36
- package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/hkdf.js +0 -82
- package/node_modules/@noble/hashes/esm/hkdf.js.map +0 -1
- package/node_modules/@noble/hashes/esm/hmac.d.ts +0 -35
- package/node_modules/@noble/hashes/esm/hmac.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/hmac.js +0 -86
- package/node_modules/@noble/hashes/esm/hmac.js.map +0 -1
- package/node_modules/@noble/hashes/esm/index.d.ts +0 -2
- package/node_modules/@noble/hashes/esm/index.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/index.js +0 -33
- package/node_modules/@noble/hashes/esm/index.js.map +0 -1
- package/node_modules/@noble/hashes/esm/legacy.d.ts +0 -71
- package/node_modules/@noble/hashes/esm/legacy.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/legacy.js +0 -281
- package/node_modules/@noble/hashes/esm/legacy.js.map +0 -1
- package/node_modules/@noble/hashes/esm/package.json +0 -10
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +0 -23
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/pbkdf2.js +0 -97
- package/node_modules/@noble/hashes/esm/pbkdf2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts +0 -13
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/ripemd160.js +0 -13
- package/node_modules/@noble/hashes/esm/ripemd160.js.map +0 -1
- package/node_modules/@noble/hashes/esm/scrypt.d.ts +0 -34
- package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/scrypt.js +0 -228
- package/node_modules/@noble/hashes/esm/scrypt.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha1.d.ts +0 -11
- package/node_modules/@noble/hashes/esm/sha1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha1.js +0 -11
- package/node_modules/@noble/hashes/esm/sha1.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha2.d.ts +0 -159
- package/node_modules/@noble/hashes/esm/sha2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha2.js +0 -375
- package/node_modules/@noble/hashes/esm/sha2.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha256.d.ts +0 -20
- package/node_modules/@noble/hashes/esm/sha256.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha256.js +0 -20
- package/node_modules/@noble/hashes/esm/sha256.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +0 -142
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3-addons.js +0 -393
- package/node_modules/@noble/hashes/esm/sha3-addons.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3.d.ts +0 -53
- package/node_modules/@noble/hashes/esm/sha3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha3.js +0 -234
- package/node_modules/@noble/hashes/esm/sha3.js.map +0 -1
- package/node_modules/@noble/hashes/esm/sha512.d.ts +0 -26
- package/node_modules/@noble/hashes/esm/sha512.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/sha512.js +0 -26
- package/node_modules/@noble/hashes/esm/sha512.js.map +0 -1
- package/node_modules/@noble/hashes/esm/utils.d.ts +0 -161
- package/node_modules/@noble/hashes/esm/utils.d.ts.map +0 -1
- package/node_modules/@noble/hashes/esm/utils.js +0 -281
- package/node_modules/@noble/hashes/esm/utils.js.map +0 -1
- package/node_modules/@noble/hashes/hkdf.d.ts +0 -36
- package/node_modules/@noble/hashes/hkdf.d.ts.map +0 -1
- package/node_modules/@noble/hashes/hkdf.js +0 -88
- package/node_modules/@noble/hashes/hkdf.js.map +0 -1
- package/node_modules/@noble/hashes/hmac.d.ts +0 -35
- package/node_modules/@noble/hashes/hmac.d.ts.map +0 -1
- package/node_modules/@noble/hashes/hmac.js +0 -91
- package/node_modules/@noble/hashes/hmac.js.map +0 -1
- package/node_modules/@noble/hashes/index.d.ts +0 -1
- package/node_modules/@noble/hashes/index.d.ts.map +0 -1
- package/node_modules/@noble/hashes/index.js +0 -33
- package/node_modules/@noble/hashes/index.js.map +0 -1
- package/node_modules/@noble/hashes/legacy.d.ts +0 -71
- package/node_modules/@noble/hashes/legacy.d.ts.map +0 -1
- package/node_modules/@noble/hashes/legacy.js +0 -287
- package/node_modules/@noble/hashes/legacy.js.map +0 -1
- package/node_modules/@noble/hashes/package.json +0 -266
- package/node_modules/@noble/hashes/pbkdf2.d.ts +0 -23
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/pbkdf2.js +0 -101
- package/node_modules/@noble/hashes/pbkdf2.js.map +0 -1
- package/node_modules/@noble/hashes/ripemd160.d.ts +0 -13
- package/node_modules/@noble/hashes/ripemd160.d.ts.map +0 -1
- package/node_modules/@noble/hashes/ripemd160.js +0 -16
- package/node_modules/@noble/hashes/ripemd160.js.map +0 -1
- package/node_modules/@noble/hashes/scrypt.d.ts +0 -34
- package/node_modules/@noble/hashes/scrypt.d.ts.map +0 -1
- package/node_modules/@noble/hashes/scrypt.js +0 -232
- package/node_modules/@noble/hashes/scrypt.js.map +0 -1
- package/node_modules/@noble/hashes/sha1.d.ts +0 -11
- package/node_modules/@noble/hashes/sha1.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha1.js +0 -14
- package/node_modules/@noble/hashes/sha1.js.map +0 -1
- package/node_modules/@noble/hashes/sha2.d.ts +0 -159
- package/node_modules/@noble/hashes/sha2.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha2.js +0 -384
- package/node_modules/@noble/hashes/sha2.js.map +0 -1
- package/node_modules/@noble/hashes/sha256.d.ts +0 -20
- package/node_modules/@noble/hashes/sha256.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha256.js +0 -23
- package/node_modules/@noble/hashes/sha256.js.map +0 -1
- package/node_modules/@noble/hashes/sha3-addons.d.ts +0 -142
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha3-addons.js +0 -402
- package/node_modules/@noble/hashes/sha3-addons.js.map +0 -1
- package/node_modules/@noble/hashes/sha3.d.ts +0 -53
- package/node_modules/@noble/hashes/sha3.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha3.js +0 -239
- package/node_modules/@noble/hashes/sha3.js.map +0 -1
- package/node_modules/@noble/hashes/sha512.d.ts +0 -26
- package/node_modules/@noble/hashes/sha512.d.ts.map +0 -1
- package/node_modules/@noble/hashes/sha512.js +0 -29
- package/node_modules/@noble/hashes/sha512.js.map +0 -1
- package/node_modules/@noble/hashes/src/_assert.ts +0 -22
- package/node_modules/@noble/hashes/src/_blake.ts +0 -50
- package/node_modules/@noble/hashes/src/_md.ts +0 -176
- package/node_modules/@noble/hashes/src/_u64.ts +0 -91
- package/node_modules/@noble/hashes/src/argon2.ts +0 -497
- package/node_modules/@noble/hashes/src/blake1.ts +0 -534
- package/node_modules/@noble/hashes/src/blake2.ts +0 -486
- package/node_modules/@noble/hashes/src/blake2b.ts +0 -10
- package/node_modules/@noble/hashes/src/blake2s.ts +0 -20
- package/node_modules/@noble/hashes/src/blake3.ts +0 -272
- package/node_modules/@noble/hashes/src/crypto.ts +0 -9
- package/node_modules/@noble/hashes/src/cryptoNode.ts +0 -15
- package/node_modules/@noble/hashes/src/eskdf.ts +0 -187
- package/node_modules/@noble/hashes/src/hkdf.ts +0 -88
- package/node_modules/@noble/hashes/src/hmac.ts +0 -94
- package/node_modules/@noble/hashes/src/index.ts +0 -31
- package/node_modules/@noble/hashes/src/legacy.ts +0 -293
- package/node_modules/@noble/hashes/src/pbkdf2.ts +0 -122
- package/node_modules/@noble/hashes/src/ripemd160.ts +0 -12
- package/node_modules/@noble/hashes/src/scrypt.ts +0 -257
- package/node_modules/@noble/hashes/src/sha1.ts +0 -10
- package/node_modules/@noble/hashes/src/sha2.ts +0 -402
- package/node_modules/@noble/hashes/src/sha256.ts +0 -24
- package/node_modules/@noble/hashes/src/sha3-addons.ts +0 -499
- package/node_modules/@noble/hashes/src/sha3.ts +0 -258
- package/node_modules/@noble/hashes/src/sha512.ts +0 -34
- package/node_modules/@noble/hashes/src/utils.ts +0 -395
- package/node_modules/@noble/hashes/utils.d.ts +0 -161
- package/node_modules/@noble/hashes/utils.d.ts.map +0 -1
- package/node_modules/@noble/hashes/utils.js +0 -313
- package/node_modules/@noble/hashes/utils.js.map +0 -1
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RFC 6330 Object Transmission Information (OTI) utilities.
|
|
3
|
-
*
|
|
4
|
-
* Shared OTI encoding/decoding for both moq-lib and moqtail players.
|
|
5
|
-
* Eliminates duplicated OTI byte manipulation across codebases.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { parseMoqRepairFrame } from "@blockcast/mmt-base";
|
|
9
|
-
|
|
10
|
-
export interface OTIParams {
|
|
11
|
-
/** Transfer length F (total source block size in bytes) */
|
|
12
|
-
transferLength: number;
|
|
13
|
-
/** Symbol size T (bytes per symbol) */
|
|
14
|
-
symbolSize: number;
|
|
15
|
-
/** Number of source blocks Z */
|
|
16
|
-
sourceBlocks: number;
|
|
17
|
-
/** Number of sub-blocks N */
|
|
18
|
-
subBlocks: number;
|
|
19
|
-
/** Symbol alignment Al */
|
|
20
|
-
alignment: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Build a 12-byte RFC 6330 Common + Scheme-Specific OTI from parameters.
|
|
25
|
-
*
|
|
26
|
-
* Wire format (per RFC 6330 §4.3.1 + §4.3.3):
|
|
27
|
-
* byte 0: F high byte (bit 32 — transfer length is 40-bit)
|
|
28
|
-
* bytes 1-4: F low 32 bits (big-endian)
|
|
29
|
-
* byte 5: reserved (0)
|
|
30
|
-
* bytes 6-7: T (symbol size, big-endian)
|
|
31
|
-
* byte 8: Z (source blocks)
|
|
32
|
-
* bytes 9-10: N (sub-blocks, big-endian)
|
|
33
|
-
* byte 11: Al (alignment)
|
|
34
|
-
*/
|
|
35
|
-
export function buildOTI(params: OTIParams): Uint8Array {
|
|
36
|
-
const {
|
|
37
|
-
transferLength: F,
|
|
38
|
-
symbolSize: T,
|
|
39
|
-
sourceBlocks: Z,
|
|
40
|
-
subBlocks: N,
|
|
41
|
-
alignment: Al,
|
|
42
|
-
} = params;
|
|
43
|
-
validateOTIFields(F, T, Z, N, Al);
|
|
44
|
-
const oti = new Uint8Array(12);
|
|
45
|
-
// F: 40-bit big-endian (byte 0 = high, bytes 1-4 = low 32)
|
|
46
|
-
oti[0] = (F / 0x100000000) & 0xFF;
|
|
47
|
-
oti[1] = (F >>> 24) & 0xFF;
|
|
48
|
-
oti[2] = (F >>> 16) & 0xFF;
|
|
49
|
-
oti[3] = (F >>> 8) & 0xFF;
|
|
50
|
-
oti[4] = F & 0xFF;
|
|
51
|
-
// byte 5: reserved
|
|
52
|
-
oti[6] = (T >>> 8) & 0xFF;
|
|
53
|
-
oti[7] = T & 0xFF;
|
|
54
|
-
oti[8] = Z & 0xFF;
|
|
55
|
-
oti[9] = (N >>> 8) & 0xFF;
|
|
56
|
-
oti[10] = N & 0xFF;
|
|
57
|
-
oti[11] = Al & 0xFF;
|
|
58
|
-
return oti;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Build OTI from catalog FEC config (K and T).
|
|
63
|
-
* F = K × T (interleaved encoder convention from FFmpeg moqenc_mmt.c).
|
|
64
|
-
*/
|
|
65
|
-
export function buildOTIFromCatalog(K: number, T: number): Uint8Array {
|
|
66
|
-
if (!Number.isInteger(K) || K <= 0 || K > 56_403) {
|
|
67
|
-
throw new Error(`K must be an integer in 1..56403 (got ${K})`);
|
|
68
|
-
}
|
|
69
|
-
return buildOTI({
|
|
70
|
-
transferLength: K * T,
|
|
71
|
-
symbolSize: T,
|
|
72
|
-
sourceBlocks: 1,
|
|
73
|
-
subBlocks: 1,
|
|
74
|
-
alignment: 8,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Parse a 12-byte OTI into structured parameters.
|
|
80
|
-
*/
|
|
81
|
-
export function parseOTI(oti: Uint8Array): OTIParams & { K: number } {
|
|
82
|
-
if (oti.length !== 12) throw new Error(`OTI must be exactly 12 bytes (got ${oti.length})`);
|
|
83
|
-
if (oti[5] !== 0) throw new Error(`OTI reserved byte 5 must be zero (got ${oti[5]})`);
|
|
84
|
-
const F = ((oti[0] & 0xFF) * 0x100000000) +
|
|
85
|
-
(((oti[1] << 24) | (oti[2] << 16) | (oti[3] << 8) | oti[4]) >>> 0);
|
|
86
|
-
const T = (oti[6] << 8) | oti[7];
|
|
87
|
-
const Z = oti[8];
|
|
88
|
-
const N = (oti[9] << 8) | oti[10];
|
|
89
|
-
const Al = oti[11];
|
|
90
|
-
validateOTIFields(F, T, Z, N, Al);
|
|
91
|
-
const K = Math.ceil(Math.ceil(F / T) / Z);
|
|
92
|
-
return { transferLength: F, symbolSize: T, sourceBlocks: Z, subBlocks: N, alignment: Al, K };
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function validateOTIFields(F: number, T: number, Z: number, N: number, Al: number): void {
|
|
96
|
-
if (!Number.isSafeInteger(F) || F <= 0 || F > 0xffffffffff) {
|
|
97
|
-
throw new Error(`F must be a positive 40-bit integer (got ${F})`);
|
|
98
|
-
}
|
|
99
|
-
if (!Number.isInteger(T) || T <= 0 || T > 0xffff) {
|
|
100
|
-
throw new Error(`T must be an integer in 1..65535 (got ${T})`);
|
|
101
|
-
}
|
|
102
|
-
if (!Number.isInteger(Z) || Z <= 0 || Z > 0xff) {
|
|
103
|
-
throw new Error(`Z must be an integer in 1..255 (got ${Z})`);
|
|
104
|
-
}
|
|
105
|
-
if (!Number.isInteger(N) || N <= 0 || N > 0xffff) {
|
|
106
|
-
throw new Error(`N must be an integer in 1..65535 (got ${N})`);
|
|
107
|
-
}
|
|
108
|
-
if (!Number.isInteger(Al) || Al <= 0 || Al > 0xff || T % Al !== 0) {
|
|
109
|
-
throw new Error(`Al must be an integer in 1..255 that divides T (got Al=${Al}, T=${T})`);
|
|
110
|
-
}
|
|
111
|
-
const K = Math.ceil(Math.ceil(F / T) / Z);
|
|
112
|
-
if (K > 56_403) {
|
|
113
|
-
throw new Error(`OTI requires K=${K}, above the RFC 6330 systematic limit 56403`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Resolve a catalog FEC block's span in milliseconds.
|
|
119
|
-
*
|
|
120
|
-
* The catalog carries exactly ONE interleave field: `interleaveDepthMs`, the
|
|
121
|
-
* full FEC block span in MILLISECONDS (draft-ramadan-moq-fec §5.1). Receivers
|
|
122
|
-
* derive D -- the MEDIA UNITS per block, not a block count -- with
|
|
123
|
-
* `deriveFecInterleaveDepth`. Reading D as a block count is BLO-35597.
|
|
124
|
-
*
|
|
125
|
-
* Absent, non-finite or non-positive → undefined; callers treat that as
|
|
126
|
-
* unconfigured and error rather than guess. Finiteness is checked separately
|
|
127
|
-
* from `> 0` because `Infinity` satisfies `> 0`: a JSON catalog cannot spell
|
|
128
|
-
* `Infinity`, but any overflowing literal (`1e999`) parses to it, and it would
|
|
129
|
-
* then reach `fecBlockBudgetMs` as an unbounded span. The legacy
|
|
130
|
-
* `interleaveDepth` frame-count key and
|
|
131
|
-
* the `interleaveMs` alias were removed in the BLO-14526 clean cut — producers
|
|
132
|
-
* emit milliseconds only, and there is deliberately NO fallback read.
|
|
133
|
-
*/
|
|
134
|
-
export type FecInterleaveCatalog = {
|
|
135
|
-
interleaveDepthMs?: number;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export function catalogFecInterleaveMs(
|
|
139
|
-
fec: FecInterleaveCatalog | undefined,
|
|
140
|
-
): number | undefined {
|
|
141
|
-
const ms = fec?.interleaveDepthMs;
|
|
142
|
-
return typeof ms === "number" && ms > 0 && Number.isFinite(ms) ? ms : undefined;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Derive the integer FEC interleave depth D from a catalog block span and the
|
|
147
|
-
* duration of one media unit.
|
|
148
|
-
*
|
|
149
|
-
* `interleaveDepthMs` is nearest-millisecond catalog signaling while media
|
|
150
|
-
* unit durations are commonly fractional. Invert that quantization with
|
|
151
|
-
* positive-value round-half-up semantics:
|
|
152
|
-
*
|
|
153
|
-
* D = max(1, floor(interleaveDepthMs / mediaUnitDurationMs + 0.5))
|
|
154
|
-
*
|
|
155
|
-
* `Math.ceil` is not equivalent: 4000 / 33.333 is slightly greater than 120,
|
|
156
|
-
* but represents D=120 rather than D=121.
|
|
157
|
-
*/
|
|
158
|
-
export function deriveFecInterleaveDepth(
|
|
159
|
-
interleaveDepthMs: number,
|
|
160
|
-
mediaUnitDurationMs: number,
|
|
161
|
-
): number {
|
|
162
|
-
if (!Number.isFinite(interleaveDepthMs) || interleaveDepthMs <= 0) {
|
|
163
|
-
throw new Error(`[FEC] interleaveDepthMs must be finite and > 0 (got ${interleaveDepthMs})`);
|
|
164
|
-
}
|
|
165
|
-
if (!Number.isFinite(mediaUnitDurationMs) || mediaUnitDurationMs <= 0) {
|
|
166
|
-
throw new Error(`[FEC] mediaUnitDurationMs must be finite and > 0 (got ${mediaUnitDurationMs})`);
|
|
167
|
-
}
|
|
168
|
-
return Math.max(1, Math.floor(interleaveDepthMs / mediaUnitDurationMs + 0.5));
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Compute the full FEC block completion timeout from the catalog block span.
|
|
173
|
-
*
|
|
174
|
-
* The catalog's `interleaveDepthMs` IS the full FEC block span in
|
|
175
|
-
* milliseconds (draft-ramadan-moq-fec §5.1): producers emit
|
|
176
|
-
* D × unit-duration, and every symbol of a block — source and repair —
|
|
177
|
-
* arrives within that span. The full-block timeout is therefore
|
|
178
|
-
* K-INDEPENDENT:
|
|
179
|
-
*
|
|
180
|
-
* timeout = interleaveDepthMs * safetyFactor
|
|
181
|
-
*
|
|
182
|
-
* A caller that genuinely needs a per-sub-block deadline scales the block
|
|
183
|
-
* span by K_sub / K. Never scale it by a symbol count: the span already
|
|
184
|
-
* covers every symbol of the block.
|
|
185
|
-
*
|
|
186
|
-
* @param interleaveDepthMs - Full FEC block span in ms (catalog fec.interleaveDepthMs)
|
|
187
|
-
* @param safetyFactor - Jitter margin (default 3.0)
|
|
188
|
-
* @returns Timeout in milliseconds
|
|
189
|
-
*/
|
|
190
|
-
export function computeFecTimeout(
|
|
191
|
-
interleaveDepthMs: number,
|
|
192
|
-
safetyFactor: number = 3.0,
|
|
193
|
-
): number {
|
|
194
|
-
// Finite, not merely > 0, and on BOTH arguments: the product is the caller's
|
|
195
|
-
// expiry deadline, so a non-finite either side makes every `now > deadline`
|
|
196
|
-
// comparison false and the block never expires -- strictly worse than
|
|
197
|
-
// expiring late. `NaN <= 0` is false, so a bare `> 0` guard passes it
|
|
198
|
-
// through. Both values reach here from JSON (the catalog span, and the
|
|
199
|
-
// safety factor via test-vectors/catalog-validation.json), where an
|
|
200
|
-
// overflowing literal such as `1e999` parses to Infinity -- JSON has no
|
|
201
|
-
// Infinity literal, so there is no other way to spell it.
|
|
202
|
-
if (!Number.isFinite(interleaveDepthMs) || interleaveDepthMs <= 0) {
|
|
203
|
-
throw new Error(`[FEC] interleaveDepthMs must be a finite value > 0 (got ${interleaveDepthMs}ms). Fix encoder config.`);
|
|
204
|
-
}
|
|
205
|
-
if (!Number.isFinite(safetyFactor) || safetyFactor <= 0) {
|
|
206
|
-
throw new Error(`[FEC] safetyFactor must be a finite value > 0 (got ${safetyFactor}). Fix encoder config.`);
|
|
207
|
-
}
|
|
208
|
-
// interleaveDepthMs IS the block span. K=4, D=4 at 30fps:
|
|
209
|
-
// interleaveDepthMs = 133ms → timeout = ceil(133 * 3) = 399ms.
|
|
210
|
-
return Math.ceil(interleaveDepthMs * safetyFactor);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Absolute deadline for one FEC block.
|
|
215
|
-
*
|
|
216
|
-
* deadline = firstAcceptedAtMs + interleaveDepthMs + reorderToleranceMs
|
|
217
|
-
*
|
|
218
|
-
* Two properties matter, and both are contract, not preference:
|
|
219
|
-
*
|
|
220
|
-
* 1. The anchor is an ABSOLUTE receiver-local timestamp of the first accepted
|
|
221
|
-
* packet of the block -- not "now when we noticed", and not a duration a
|
|
222
|
-
* caller starts counting at an unspecified moment. A relative timeout
|
|
223
|
-
* cannot say WHEN a block was due, so it cannot yield playback latency and
|
|
224
|
-
* it cannot be compared across two consumers that started their timers at
|
|
225
|
-
* different instants.
|
|
226
|
-
*
|
|
227
|
-
* 2. The reorder/jitter allowance is ADDITIVE and SIGNALED, never a multiplier
|
|
228
|
-
* on the span. Jitter is a property of the network path; the FEC block span
|
|
229
|
-
* is a property of the encoder. Multiplying them couples two independent
|
|
230
|
-
* quantities: at a 133ms video span a x3 factor grants 266ms of slack, and
|
|
231
|
-
* at a 43ms audio span only 86ms -- for the same network. The tolerance
|
|
232
|
-
* therefore arrives as its own catalog value and is added once.
|
|
233
|
-
*
|
|
234
|
-
* Both arguments are required. There is no default tolerance: a missing value
|
|
235
|
-
* is an encoder/catalog bug and must surface at the boundary, not be papered
|
|
236
|
-
* over with a constant here.
|
|
237
|
-
*
|
|
238
|
-
* @param firstAcceptedAtMs - Receiver-local ms timestamp of the block's first accepted packet
|
|
239
|
-
* @param interleaveDepthMs - Full FEC block span in ms (catalog fec.interleaveDepthMs)
|
|
240
|
-
* @param reorderToleranceMs - Declared jitter/reorder allowance in ms (catalog fec.reorderToleranceMs)
|
|
241
|
-
* @returns Absolute receiver-local deadline in milliseconds
|
|
242
|
-
*/
|
|
243
|
-
export function fecBlockDeadlineMs(params: {
|
|
244
|
-
firstAcceptedAtMs: number;
|
|
245
|
-
interleaveDepthMs: number;
|
|
246
|
-
reorderToleranceMs: number;
|
|
247
|
-
}): number {
|
|
248
|
-
const { firstAcceptedAtMs, interleaveDepthMs, reorderToleranceMs } = params;
|
|
249
|
-
if (!Number.isFinite(firstAcceptedAtMs)) {
|
|
250
|
-
throw new Error(`[FEC] firstAcceptedAtMs must be finite (got ${firstAcceptedAtMs}).`);
|
|
251
|
-
}
|
|
252
|
-
return firstAcceptedAtMs + fecBlockBudgetMs(interleaveDepthMs, reorderToleranceMs);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Relative budget for one FEC block: span + declared tolerance.
|
|
257
|
-
*
|
|
258
|
-
* Only for consumers whose interface genuinely takes a duration (the WASM
|
|
259
|
-
* reassembler's `timeoutMs`). Anything that can hold a timestamp should use
|
|
260
|
-
* `fecBlockDeadlineMs` instead, so the anchor stays explicit and latency stays
|
|
261
|
-
* extractable. This is deliberately NOT `span * factor` -- see the note on
|
|
262
|
-
* `fecBlockDeadlineMs` for why the tolerance is additive.
|
|
263
|
-
*/
|
|
264
|
-
export function fecBlockBudgetMs(interleaveDepthMs: number, reorderToleranceMs: number): number {
|
|
265
|
-
// Finite, not merely > 0: Infinity satisfies `> 0` and would yield an
|
|
266
|
-
// infinite budget, which fecBlockDeadlineMs then turns into a deadline no
|
|
267
|
-
// block can ever miss -- the eviction bound silently stops bounding. The
|
|
268
|
-
// tolerance check below already required finiteness; this is the same bar
|
|
269
|
-
// for the encoder's span.
|
|
270
|
-
if (!Number.isFinite(interleaveDepthMs) || !(interleaveDepthMs > 0)) {
|
|
271
|
-
throw new Error(
|
|
272
|
-
`[FEC] interleaveDepthMs must be a finite value > 0 (got ${interleaveDepthMs}ms). Fix encoder config.`,
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
if (!(reorderToleranceMs >= 0) || !Number.isFinite(reorderToleranceMs)) {
|
|
276
|
-
throw new Error(
|
|
277
|
-
`[FEC] reorderToleranceMs must be a finite value >= 0 (got ${reorderToleranceMs}ms). ` +
|
|
278
|
-
`It is a catalog value (fec.reorderToleranceMs), not a local default.`,
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
return Math.ceil(interleaveDepthMs + reorderToleranceMs);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* How many FEC blocks a receiver must retain, in SBN distance.
|
|
286
|
-
*
|
|
287
|
-
* THE ONE derivation of "the interleave horizon". Every site that retires a
|
|
288
|
-
* block by SBN distance consumes this: the Worker/WASM decoder's retention
|
|
289
|
-
* (`interleaveDepth` -> `cleanup_by_sbn`) and FECManager's ordered-relay
|
|
290
|
-
* settlement horizon. They are not two quantities that happen to agree -- a
|
|
291
|
-
* settlement that fires inside the decoder's retention kills a block the
|
|
292
|
-
* decoder would still have recovered, so the invariant is:
|
|
293
|
-
*
|
|
294
|
-
* ordered-relay settlement must never fire on a block the decoder would
|
|
295
|
-
* still accept -- manager horizon >= decoder retention.
|
|
296
|
-
*
|
|
297
|
-
* Deriving it twice is what broke it (BLO-35597): `deriveFecInterleaveDepth`
|
|
298
|
-
* returns D, MEDIA UNITS per block, and reading that as a block count made the
|
|
299
|
-
* two horizons disagree the moment either side moved. Add a consumer here
|
|
300
|
-
* rather than re-deriving at the call site.
|
|
301
|
-
*
|
|
302
|
-
* The count is the blocks that can be in flight within one block's delivery
|
|
303
|
-
* budget, plus the one being filled.
|
|
304
|
-
*
|
|
305
|
-
* That is DELIBERATELY two blocks of slack, not an exact minimum. The decoder
|
|
306
|
-
* retains `depth + 1` blocks, not `depth` -- `cleanup_by_sbn` retires only
|
|
307
|
-
* blocks strictly behind `current_sbn - interleave_depth`, so the newest block
|
|
308
|
-
* and the `depth` behind it all survive. The smallest depth satisfying the
|
|
309
|
-
* invariant is therefore `ceil(W/S) - 1`. The slack is bought on purpose: it
|
|
310
|
-
* costs retained-block memory and the depth-scaled caps (`maxBlocks`,
|
|
311
|
-
* `pendingVerifyCap` in fec-worker), and it buys headroom against a catalog
|
|
312
|
-
* whose signaled span runs slightly short of the real one -- the failure this
|
|
313
|
-
* whole issue is about. Do not "tighten" it to the minimum without a measured
|
|
314
|
-
* reason; being one block short is what fails a block, being two long is not.
|
|
315
|
-
*
|
|
316
|
-
* The cost ceiling is relative, not absolute: the slack is always two blocks
|
|
317
|
-
* of whatever the retention already is, so it scales with the geometry rather
|
|
318
|
-
* than with the stream. On the live ISS 720p/33ms catalog that is two blocks
|
|
319
|
-
* of six (a third of the buffer, the expensive end); at a 255-block retention
|
|
320
|
-
* it is two of 255 (under 1%). If you come here to tighten it, the number to
|
|
321
|
-
* weigh is the ratio at YOUR geometry -- tightening buys most where retention
|
|
322
|
-
* is small, which is also where being one block short is most likely.
|
|
323
|
-
*
|
|
324
|
-
* @param deliveryWindowMs - The block's own delivery budget (computeFecDeliveryWindowMs / fecBlockBudgetMs)
|
|
325
|
-
* @param interleaveDepthMs - Full FEC block span in ms (catalog fec.interleaveDepthMs)
|
|
326
|
-
* @returns Block count in 2..=255 for every geometry a catalog can express.
|
|
327
|
-
* The floor is 2, not 1: both inputs are guarded `> 0`, so `ceil(quotient)`
|
|
328
|
-
* is `>= 1` and the result `>= 2`. A consumer branching on a `1` case is
|
|
329
|
-
* reading a contract no real geometry produces. The one arithmetic exception
|
|
330
|
-
* is a quotient that underflows to exactly `0` (`Number.MIN_VALUE` over
|
|
331
|
-
* 33ms), which returns 1 -- reachable only by calling this directly with
|
|
332
|
-
* values a catalog cannot produce. NOT a denormal INPUT specifically: the
|
|
333
|
-
* underflow is a property of the QUOTIENT, so two normal operands reach it
|
|
334
|
-
* too (`1e-300` over `1e308` returns 1; min normal is ~2.225e-308). Do not
|
|
335
|
-
* re-narrow this to "a denormal" -- the guards below admit both of those.
|
|
336
|
-
* That a catalog cannot produce such values is a proof, not a judgement
|
|
337
|
-
* about plausible values: BOTH branches of `computeFecDeliveryWindowMs` are
|
|
338
|
-
* `Math.ceil`-wrapped (one directly, the other via `fecBlockBudgetMs`), so
|
|
339
|
-
* every catalog-derived `deliveryWindowMs` is an integer `>= 1`; the quotient
|
|
340
|
-
* is then `>= 1/interleaveDepthMs`, which no FINITE span can push below
|
|
341
|
-
* `Number.MIN_VALUE`. Documented rather than guarded -- a comparison on the
|
|
342
|
-
* per-symbol path for an input the type can express and the system cannot
|
|
343
|
-
* produce, and clamping would be the `Math.min(0xff, ...)` anti-pattern this
|
|
344
|
-
* change removed.
|
|
345
|
-
*/
|
|
346
|
-
export function deriveFecRetentionBlocks(
|
|
347
|
-
deliveryWindowMs: number,
|
|
348
|
-
interleaveDepthMs: number,
|
|
349
|
-
): number {
|
|
350
|
-
const blocks = tryDeriveFecRetentionBlocks(deliveryWindowMs, interleaveDepthMs);
|
|
351
|
-
if (blocks !== undefined) return blocks;
|
|
352
|
-
|
|
353
|
-
// Undefined means one of three things. Re-test to say which -- this is the
|
|
354
|
-
// throwing path, so the cost is irrelevant and the diagnosis is the point.
|
|
355
|
-
if (!Number.isFinite(interleaveDepthMs) || !(interleaveDepthMs > 0)) {
|
|
356
|
-
throw new Error(
|
|
357
|
-
`[FEC] interleaveDepthMs must be a finite value > 0 (got ${interleaveDepthMs}ms). Fix encoder config.`,
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
if (!Number.isFinite(deliveryWindowMs) || !(deliveryWindowMs > 0)) {
|
|
361
|
-
throw new Error(
|
|
362
|
-
`[FEC] deliveryWindowMs must be a finite value > 0 (got ${deliveryWindowMs}ms). ` +
|
|
363
|
-
`It is derived from catalog geometry, not a local default.`,
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
// Fail closed rather than clamp. 255 is the ceiling the WASM decoder and the
|
|
367
|
-
// ISO/IEC 23008-1 AL-FEC signaling byte both accept; silently clamping to it
|
|
368
|
-
// would hand back a retention SHORTER than the caller's own delivery window
|
|
369
|
-
// -- the exact skew this function exists to remove, reintroduced invisibly
|
|
370
|
-
// and only on out-of-range catalogs, where it is hardest to notice.
|
|
371
|
-
//
|
|
372
|
-
// This is the RESIDUAL, not a tested branch: it is reached by elimination
|
|
373
|
-
// once the two guards above have failed to match. That is exact only while
|
|
374
|
-
// `tryDeriveFecRetentionBlocks` returns `undefined` in exactly three places.
|
|
375
|
-
// Add a fourth and this arm mis-diagnoses it as a ceiling violation AND
|
|
376
|
-
// prints a computed block count that is not the reason -- so if you grow a
|
|
377
|
-
// case there, add the matching arm here.
|
|
378
|
-
throw new Error(
|
|
379
|
-
`[FEC] retention of ${Math.ceil(deliveryWindowMs / interleaveDepthMs) + 1} blocks exceeds the 255 the decoder and the ` +
|
|
380
|
-
`ISO/IEC 23008-1 AL-FEC signaling byte accept ` +
|
|
381
|
-
`(deliveryWindowMs=${deliveryWindowMs}ms over interleaveDepthMs=${interleaveDepthMs}ms). ` +
|
|
382
|
-
`Fix the catalog geometry: a span this short cannot carry a window this wide.`,
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* The ceiling the WASM decoder and the ISO/IEC 23008-1 AL-FEC signaling byte
|
|
388
|
-
* both accept. One owner: do not re-state `0xff` against a block count
|
|
389
|
-
* anywhere else.
|
|
390
|
-
*/
|
|
391
|
-
export const MAX_FEC_RETENTION_BLOCKS = 0xff;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* `deriveFecRetentionBlocks` without the throw: the block count, or `undefined`
|
|
395
|
-
* when the geometry cannot define one.
|
|
396
|
-
*
|
|
397
|
-
* THIS is the arithmetic; the throwing variant is this plus a diagnosis of
|
|
398
|
-
* which guard failed. Callers reached from a **per-symbol** path must use this
|
|
399
|
-
* one. An out-of-range `timeoutMs` does not narrow back on its own, so there
|
|
400
|
-
* the throwing variant is not a rare error but steady state, and it would
|
|
401
|
-
* construct an `Error` with a stack capture and unwind it for every symbol on
|
|
402
|
-
* the stream.
|
|
403
|
-
*/
|
|
404
|
-
export function tryDeriveFecRetentionBlocks(
|
|
405
|
-
deliveryWindowMs: number,
|
|
406
|
-
interleaveDepthMs: number,
|
|
407
|
-
): number | undefined {
|
|
408
|
-
if (!Number.isFinite(interleaveDepthMs) || !(interleaveDepthMs > 0)) return undefined;
|
|
409
|
-
if (!Number.isFinite(deliveryWindowMs) || !(deliveryWindowMs > 0)) return undefined;
|
|
410
|
-
const blocks = Math.ceil(deliveryWindowMs / interleaveDepthMs) + 1;
|
|
411
|
-
return blocks > MAX_FEC_RETENTION_BLOCKS ? undefined : blocks;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Playback latency for a block, from the same anchor the deadline uses.
|
|
416
|
-
*
|
|
417
|
-
* latency = presentedAtMs - firstAcceptedAtMs
|
|
418
|
-
*
|
|
419
|
-
* Both timestamps are receiver-local, so this needs NO publisher/receiver
|
|
420
|
-
* clock agreement. That is the point of anchoring the deadline absolutely:
|
|
421
|
-
* publisher-stamped media time and receiver BCTM disagree by roughly the
|
|
422
|
-
* quantity we are trying to measure, which makes any cross-host subtraction
|
|
423
|
-
* unusable at a 33ms target. This subtraction is immune to that skew.
|
|
424
|
-
*
|
|
425
|
-
* It measures first-accepted-packet to presentation. It is NOT glass-to-glass
|
|
426
|
-
* and must not be reported as such -- capture and encode sit outside both
|
|
427
|
-
* timestamps.
|
|
428
|
-
*/
|
|
429
|
-
export function playbackLatencyMs(params: { presentedAtMs: number; firstAcceptedAtMs: number }): number {
|
|
430
|
-
const { presentedAtMs, firstAcceptedAtMs } = params;
|
|
431
|
-
if (!Number.isFinite(presentedAtMs) || !Number.isFinite(firstAcceptedAtMs)) {
|
|
432
|
-
throw new Error(`[FEC] playback latency needs two finite timestamps (got ${presentedAtMs}, ${firstAcceptedAtMs}).`);
|
|
433
|
-
}
|
|
434
|
-
if (presentedAtMs < firstAcceptedAtMs) {
|
|
435
|
-
throw new Error(
|
|
436
|
-
`[FEC] presentedAtMs ${presentedAtMs} precedes firstAcceptedAtMs ${firstAcceptedAtMs}; ` +
|
|
437
|
-
`the two timestamps must come from one receiver-local clock.`,
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
return presentedAtMs - firstAcceptedAtMs;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Extract FEC parameters from an MMTP repair packet.
|
|
445
|
-
*
|
|
446
|
-
* Per ISO/IEC 23008-1 Section C.5.3, the 13-byte Repair FEC Payload ID
|
|
447
|
-
* follows the complete MMTP header, including optional C/X fields.
|
|
448
|
-
*
|
|
449
|
-
* Returns raw fields — caller passes directly to WASM add_repair(ss_start, ssb_length, rs_id, data).
|
|
450
|
-
* No SBN/ESI derivation — the WASM decoder handles block assignment.
|
|
451
|
-
*/
|
|
452
|
-
export function parseRepairPacket(packet: Uint8Array): {
|
|
453
|
-
ssStart: number; ssbLength: number; rsId: number; repairData: Uint8Array;
|
|
454
|
-
} | null {
|
|
455
|
-
const parsed = parseMoqRepairFrame(packet);
|
|
456
|
-
if (!parsed) return null;
|
|
457
|
-
return {
|
|
458
|
-
ssStart: parsed.ssStart,
|
|
459
|
-
ssbLength: parsed.ssbLength,
|
|
460
|
-
rsId: parsed.rsId,
|
|
461
|
-
repairData: parsed.symbolData,
|
|
462
|
-
};
|
|
463
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ReorderBuffer — container-agnostic frame reorder buffer for FEC-interleaved streams.
|
|
3
|
-
*
|
|
4
|
-
* FEC interleaving causes frames to complete out of decode order (e.g., frame N+3
|
|
5
|
-
* before N+1). H.264 P-frames reference the previous frame, so feeding out-of-order
|
|
6
|
-
* frames to VideoDecoder produces green artifacts from reference frame mismatch.
|
|
7
|
-
*
|
|
8
|
-
* This buffer accumulates frames and flushes them in sequence order.
|
|
9
|
-
* - In-order frames flush immediately (zero added latency for well-ordered streams).
|
|
10
|
-
* - Out-of-order frames buffer until the gap is filled or the buffer is full.
|
|
11
|
-
* - Keyframes flush all pending frames first (random access point).
|
|
12
|
-
* - Safety timeout force-flushes stalled buffers (missing frame that will never arrive).
|
|
13
|
-
*
|
|
14
|
-
* Used by WebCodecs decode path. NOT needed for MSE (browser handles ordering internally).
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export interface ReorderBufferConfig<T> {
|
|
18
|
-
/** Maximum frames to buffer before force-flushing oldest. */
|
|
19
|
-
maxSize: number;
|
|
20
|
-
/** Extract sequence number from a frame. */
|
|
21
|
-
getSequence: (frame: T) => number;
|
|
22
|
-
/** Check if a frame is a keyframe (flushes all pending). Optional. */
|
|
23
|
-
isKeyframe?: (frame: T) => boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export class ReorderBuffer<T> {
|
|
27
|
-
readonly #config: ReorderBufferConfig<T>;
|
|
28
|
-
#buffer: T[] = [];
|
|
29
|
-
#lastFlushedSeq = -1;
|
|
30
|
-
|
|
31
|
-
constructor(config: ReorderBufferConfig<T>) {
|
|
32
|
-
this.#config = config;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Push a frame into the buffer. Returns frames ready to decode (in sequence order).
|
|
37
|
-
* May return 0 frames (buffered), 1 frame (in-order), or multiple (gap filled / flush).
|
|
38
|
-
*/
|
|
39
|
-
push(frame: T): T[] {
|
|
40
|
-
const { getSequence, isKeyframe, maxSize } = this.#config;
|
|
41
|
-
|
|
42
|
-
// Keyframe: flush all pending in order, then emit keyframe
|
|
43
|
-
if (isKeyframe?.(frame)) {
|
|
44
|
-
const flushed = this.flushAll();
|
|
45
|
-
this.#lastFlushedSeq = getSequence(frame);
|
|
46
|
-
flushed.push(frame);
|
|
47
|
-
return flushed;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const seq = getSequence(frame);
|
|
51
|
-
|
|
52
|
-
// Drop truly stale frames (older than what we've already flushed)
|
|
53
|
-
if (seq > 0 && seq <= this.#lastFlushedSeq) {
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Insert into buffer (maintain sorted order)
|
|
58
|
-
this.#buffer.push(frame);
|
|
59
|
-
this.#buffer.sort((a, b) => getSequence(a) - getSequence(b));
|
|
60
|
-
|
|
61
|
-
// Flush in-order frames from front
|
|
62
|
-
const flushed: T[] = [];
|
|
63
|
-
while (this.#buffer.length > 0) {
|
|
64
|
-
const frontSeq = getSequence(this.#buffer[0]);
|
|
65
|
-
|
|
66
|
-
// Flush if: next expected seq, OR nothing flushed yet (bootstrap), OR buffer full
|
|
67
|
-
if (frontSeq <= this.#lastFlushedSeq + 1 || this.#lastFlushedSeq < 0 || this.#buffer.length >= maxSize) {
|
|
68
|
-
const f = this.#buffer.shift()!;
|
|
69
|
-
this.#lastFlushedSeq = getSequence(f);
|
|
70
|
-
flushed.push(f);
|
|
71
|
-
} else {
|
|
72
|
-
break; // gap — wait for missing frame
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return flushed;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Flush all pending frames in sequence order. Call on keyframe or cleanup.
|
|
81
|
-
*/
|
|
82
|
-
flushAll(): T[] {
|
|
83
|
-
this.#buffer.sort((a, b) => this.#config.getSequence(a) - this.#config.getSequence(b));
|
|
84
|
-
const flushed = this.#buffer.splice(0);
|
|
85
|
-
if (flushed.length > 0) {
|
|
86
|
-
this.#lastFlushedSeq = this.#config.getSequence(flushed[flushed.length - 1]);
|
|
87
|
-
}
|
|
88
|
-
return flushed;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Number of frames currently buffered (waiting for gap to fill). */
|
|
92
|
-
get pending(): number {
|
|
93
|
-
return this.#buffer.length;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** Reset buffer state. */
|
|
97
|
-
reset(): void {
|
|
98
|
-
this.#buffer = [];
|
|
99
|
-
this.#lastFlushedSeq = -1;
|
|
100
|
-
}
|
|
101
|
-
}
|