@blockcast/mmt-container 0.4.0 → 0.4.1-main.cbe342dbdd9c
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 +36 -20
- package/dist/align.d.ts +24 -18
- package/dist/align.d.ts.map +1 -1
- package/dist/align.js +23 -4
- package/dist/align.js.map +2 -2
- package/dist/browser-runtime.js +1839 -692
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +76 -39
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +321 -205
- package/dist/carp-catalog.js.map +3 -3
- package/dist/catalog-fec-params.d.ts +12 -4
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +40 -17
- package/dist/catalog-fec-params.js.map +3 -3
- package/dist/catalog-network-source.d.ts +28 -7
- package/dist/catalog-network-source.d.ts.map +1 -1
- package/dist/catalog-network-source.js +21 -1
- package/dist/catalog-network-source.js.map +2 -2
- package/dist/catalog-validator.d.ts +4 -3
- package/dist/catalog-validator.d.ts.map +1 -1
- package/dist/catalog-validator.js +0 -29
- package/dist/catalog-validator.js.map +3 -3
- package/dist/cmcd-producer.d.ts +8 -0
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js +14 -0
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.js +98 -234
- package/dist/delivery-catalog.js.map +4 -4
- package/dist/fec-manager.d.ts +121 -1
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +421 -66
- package/dist/fec-manager.js.map +3 -3
- package/dist/fec-state.d.ts +2 -1
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +18 -3
- package/dist/fec-state.js.map +3 -3
- package/dist/fec-worker-setup.d.ts +10 -0
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +15 -4
- package/dist/fec-worker-setup.js.map +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +39 -1
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +109 -17
- package/dist/iso-block-locator.js.map +3 -3
- package/dist/manifest-auth-plan.d.ts +26 -25
- package/dist/manifest-auth-plan.d.ts.map +1 -1
- package/dist/manifest-auth-plan.js +331 -1171
- package/dist/manifest-auth-plan.js.map +4 -4
- package/dist/mfu-reassembler.js +21 -13
- package/dist/mfu-reassembler.js.map +2 -2
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +93 -22
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +1137 -317
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +93 -22
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-fec-session.d.ts +159 -0
- package/dist/mmtp-fec-session.d.ts.map +1 -0
- package/dist/mmtp-fec-session.js +531 -0
- package/dist/mmtp-fec-session.js.map +7 -0
- package/dist/mmtp-router.d.ts +39 -6
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +184 -27
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-auth-catalog.d.ts +86 -92
- package/dist/multicast-auth-catalog.d.ts.map +1 -1
- package/dist/multicast-auth-catalog.js +347 -132
- package/dist/multicast-auth-catalog.js.map +4 -4
- package/dist/multicast-input.d.ts +31 -8
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +299 -35
- package/dist/multicast-input.js.map +3 -3
- package/dist/multicast-manager.d.ts +94 -5
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +877 -357
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +12 -2
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +108 -238
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +21 -13
- package/dist/multicast-unwrap.js.map +2 -2
- package/dist/no-modules.d.ts +4 -1
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +1086 -301
- package/dist/no-modules.js.map +4 -4
- package/dist/phase14-catalog-override.d.ts +1 -1
- package/dist/phase14-catalog-override.d.ts.map +1 -1
- package/dist/phase14-catalog-override.js +2 -2
- package/dist/phase14-catalog-override.js.map +2 -2
- package/dist/repair-fetch.d.ts +81 -6
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +156 -31
- package/dist/repair-fetch.js.map +3 -3
- package/dist/repair-layers.d.ts +2 -0
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +19 -2
- package/dist/repair-layers.js.map +2 -2
- package/dist/sample-combiner.d.ts +7 -1
- package/dist/sample-combiner.d.ts.map +1 -1
- package/dist/sample-combiner.js +14 -2
- package/dist/sample-combiner.js.map +2 -2
- package/dist/signaling.d.ts +2 -2
- package/dist/signaling.d.ts.map +1 -1
- package/dist/signaling.js +3 -3
- package/dist/signaling.js.map +2 -2
- package/dist/source-auth.js +2710 -7
- package/dist/source-auth.js.map +4 -4
- package/dist/switching-set-alignment.d.ts +1 -1
- package/dist/switching-set-alignment.js.map +1 -1
- package/dist/timestamp-codec.js +21 -13
- package/dist/timestamp-codec.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js.map +1 -1
- package/dist/wasm-mmtp-container-parser.js +93 -22
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +6 -9
- package/schemas/catalog.schema.json +133 -38
- package/src/align.ts +52 -21
- package/src/carp-catalog.ts +188 -68
- package/src/catalog-fec-params.ts +28 -3
- package/src/catalog-network-source.ts +49 -7
- package/src/catalog-validator.ts +4 -11
- package/src/cmcd-producer.ts +17 -0
- package/src/fec-manager.ts +452 -63
- package/src/fec-state.ts +11 -4
- package/src/fec-worker-setup.ts +30 -2
- package/src/index.ts +27 -10
- package/src/iso-block-locator.ts +110 -7
- package/src/manifest-auth-plan.ts +39 -91
- package/src/mmtp-container-parser.ts +75 -7
- package/src/mmtp-fec-session.ts +533 -0
- package/src/mmtp-router.ts +166 -7
- package/src/multicast-auth-catalog.ts +131 -238
- package/src/multicast-input.ts +148 -124
- package/src/multicast-manager.ts +267 -21
- package/src/multicast-transport.ts +17 -3
- package/src/no-modules.ts +7 -1
- package/src/phase14-catalog-override.ts +3 -3
- package/src/repair-fetch.ts +283 -39
- package/src/repair-layers.ts +22 -2
- package/src/sample-combiner.ts +15 -2
- package/src/signaling.ts +2 -2
- package/src/switching-set-alignment.ts +1 -1
- package/test-vectors/align.json +108 -32
- package/test-vectors/bc-provenance-v2.json +1526 -0
- package/test-vectors/catalog/README.md +71 -4
- package/test-vectors/catalog/negative/fec-block-profile-missing.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-unknown.json +1 -1
- package/test-vectors/catalog/negative/fec-iso-symbol-size-below-floor.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-iso-symbol-size-13.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-k-plus-p-over-255.json +39 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-overlay-over-255.json +40 -0
- package/test-vectors/catalog/negative/fec-repair-overlay-source-symbols-zero.json +43 -0
- package/test-vectors/catalog/negative/fec-repair-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-source-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-symbol-size-zero.json +28 -0
- package/test-vectors/catalog/negative/init-data-inline-without-data.json +22 -0
- package/test-vectors/catalog/negative/mmtp-mode-mpu.json +15 -0
- package/test-vectors/catalog/negative/multicast-amt-dns-without-relay.json +37 -0
- package/test-vectors/catalog/negative/multicast-amt-driad-with-relay.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-asm-missing-sender-address.json +77 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-first-epoch.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-kid.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-auth-without-object-auth.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-auth.json +49 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-bandwidth.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-port-equals-port.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-timer-out-of-range.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-above-max.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-below-min.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-sender-address-on-ssm.json +57 -0
- package/test-vectors/catalog/negative/multicast-auth-version-1.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-3.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-missing.json +55 -0
- package/test-vectors/catalog/negative/multicast-endpoint-foreign-namespace-track.json +44 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-amt.json +38 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-atsc3.json +38 -0
- package/test-vectors/catalog/negative/presentation-anchor-unsafe.json +16 -0
- package/test-vectors/catalog/positive/fec-algorithm-unimplemented.json +29 -0
- package/test-vectors/catalog/positive/fec-iso-ssbg1.json +1 -1
- package/test-vectors/catalog/positive/fec-multicast.json +1 -1
- package/test-vectors/catalog/positive/fec-reed-solomon-layered.json +50 -0
- package/test-vectors/catalog/positive/mmt01-12-1-init-ref-anchor.json +29 -0
- package/test-vectors/catalog/positive/multicast-amt-discovery-omitted.json +37 -0
- package/test-vectors/catalog/positive/multicast-amt-dns-relay.json +38 -0
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +3 -3
- package/test-vectors/catalog/{negative/multicast-endpoint-missing-protocol-and-source.json → positive/multicast-asm-unprotected.json} +10 -5
- package/test-vectors/catalog/positive/multicast-auth-asm-sender.json +78 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +39 -38
- package/test-vectors/catalog/positive/multicast-draft01-4-1-example.json +81 -0
- package/test-vectors/catalog/positive/multicast-draft01-7-2-6-example.json +70 -0
- package/test-vectors/catalog/positive/presentation-anchor-negative.json +27 -0
- package/test-vectors/catalog/section-codes.json +31 -1
- package/test-vectors/catalog-multicast-auth-v1.json +38 -20
- package/test-vectors/catalog-validation.json +101 -5
- package/test-vectors/catalog-validator-public-api.mjs +14 -9
- package/test-vectors/generate-bc-provenance-v2.mjs +252 -0
- package/dist/fec-codec.d.ts +0 -32
- package/dist/fec-codec.d.ts.map +0 -1
- package/dist/fec-codec.js +0 -47
- package/dist/fec-codec.js.map +0 -7
- package/src/fec-codec.ts +0 -61
package/src/fec-state.ts
CHANGED
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
// timers or elapsed time. The rules live here so the three players cannot
|
|
14
14
|
// disagree about precedence.
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
catalogFecDeclaresUnconfigurableInstance,
|
|
18
|
+
fecAlgorithmUnimplemented,
|
|
19
|
+
isFecBlockProfile,
|
|
20
|
+
isoBlockSpanUsable,
|
|
21
|
+
} from '@blockcast/mmt-base'
|
|
17
22
|
|
|
18
23
|
/** The optional elapsed-span rule lives in mmt-base beside the other catalog FEC rules. */
|
|
19
24
|
export { isoBlockSpanUsable }
|
|
@@ -103,7 +108,8 @@ function isPositiveSafeInteger(value: unknown): boolean {
|
|
|
103
108
|
* Whether one catalog `fec` block (a hang rendition's `fec` or an MSF/CMSF
|
|
104
109
|
* track's `fec`) declares an FEC instance a receiver can configure: source
|
|
105
110
|
* symbols per block (K) and a symbol size (T) are both positive integers, the
|
|
106
|
-
* algorithm is
|
|
111
|
+
* algorithm is neither `none` nor a token this receiver does not implement
|
|
112
|
+
* (`fecAlgorithmUnimplemented`, draft-ramadan-moq-fec-01 4), `blockProfile` names the implemented profile
|
|
107
113
|
* `iso-ssbg1-v1` (BLO-35597), and the block carries that profile's usable
|
|
108
114
|
* span field (`isoBlockSpanUsable`); zero/absence still permits in-band FEC. Total: it never throws, and answers false for
|
|
109
115
|
* any other value.
|
|
@@ -141,12 +147,13 @@ function isPositiveSafeInteger(value: unknown): boolean {
|
|
|
141
147
|
*/
|
|
142
148
|
export function catalogDeclaresFec(fec: unknown): boolean {
|
|
143
149
|
const block = recordOf(fec)
|
|
144
|
-
if (block === undefined || block['algorithm'] === 'none') return false
|
|
150
|
+
if (block === undefined || block['algorithm'] === 'none' || fecAlgorithmUnimplemented(block['algorithm'])) return false
|
|
145
151
|
return (
|
|
146
152
|
isPositiveSafeInteger(block['sourceSymbols']) &&
|
|
147
153
|
isPositiveSafeInteger(block['symbolSize']) &&
|
|
148
154
|
isFecBlockProfile(block['blockProfile']) &&
|
|
149
|
-
isoBlockSpanUsable(block)
|
|
155
|
+
isoBlockSpanUsable(block) &&
|
|
156
|
+
!catalogFecDeclaresUnconfigurableInstance(block)
|
|
150
157
|
)
|
|
151
158
|
}
|
|
152
159
|
|
package/src/fec-worker-setup.ts
CHANGED
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
import { parseFecBlockProfile, type FecBlockProfile } from '@blockcast/mmt-base'
|
|
17
17
|
import type { FecWorkerClient, FecTrackConfig } from '@blockcast/fec-worker'
|
|
18
18
|
import type { MulticastManager } from './multicast-manager.js'
|
|
19
|
+
import type { FecRepairLayer } from './fec-manager.js'
|
|
19
20
|
import {
|
|
20
21
|
deriveFecRetentionBlocks,
|
|
21
22
|
LOCAL_FEC_RETENTION_BLOCKS,
|
|
22
23
|
LOCAL_FEC_TIMEOUT_MS,
|
|
24
|
+
MAX_FEC_RETENTION_BLOCKS,
|
|
23
25
|
} from '@blockcast/mmt-fec'
|
|
24
26
|
import { computeFecDeliveryWindowMs } from './track-session.js'
|
|
25
27
|
|
|
@@ -47,6 +49,8 @@ export interface FecWorkerSetupOptions {
|
|
|
47
49
|
* Worker is created. Never defaulted, never inferred.
|
|
48
50
|
*/
|
|
49
51
|
fecBlockProfile: FecBlockProfile
|
|
52
|
+
/** The track's FEC scheme (`TrackFecParams.fecAlgorithm`). Defaults to RaptorQ. */
|
|
53
|
+
fecAlgorithm?: 'raptorq' | 'reed-solomon'
|
|
50
54
|
/**
|
|
51
55
|
* FEC K from catalog: the maximum SSB_length (K_max) of any block. Blocks
|
|
52
56
|
* are variable-length ssbg_mode1 blocks keyed by SS_Start, so K bounds
|
|
@@ -77,6 +81,13 @@ export interface FecWorkerSetupOptions {
|
|
|
77
81
|
mediaUnitDurationMs?: number
|
|
78
82
|
/** Optional repair track name (MoQ). Forwarded to FecTrackConfig. */
|
|
79
83
|
repairTrackName?: string
|
|
84
|
+
/**
|
|
85
|
+
* The catalog's base repair layers (`TrackFecParams.repairLayers`) and the
|
|
86
|
+
* layers this receiver holds (default `[0]`), for the fec-01 6.3.9 anchored
|
|
87
|
+
* RSB_length check. Absent layers: no check.
|
|
88
|
+
*/
|
|
89
|
+
fecRepairLayers?: readonly FecRepairLayer[]
|
|
90
|
+
heldRepairLayers?: readonly number[]
|
|
80
91
|
/** Audio sample rate (optional — audio tracks only). */
|
|
81
92
|
sampleRate?: number
|
|
82
93
|
/** Codec string (optional; "unknown" is acceptable for first setup). */
|
|
@@ -237,7 +248,7 @@ export async function setupFecWorkerForTrack(
|
|
|
237
248
|
trackType: opts.trackType,
|
|
238
249
|
framerate: opts.framerate,
|
|
239
250
|
sampleRate: opts.sampleRate,
|
|
240
|
-
algorithm: '
|
|
251
|
+
algorithm: opts.fecAlgorithm ?? 'raptorq',
|
|
241
252
|
blockProfile,
|
|
242
253
|
k: opts.fecK,
|
|
243
254
|
// P as this receiver joined it, not the catalog total: the worker snapshot
|
|
@@ -252,10 +263,10 @@ export async function setupFecWorkerForTrack(
|
|
|
252
263
|
relayBlockSigEnabled: false,
|
|
253
264
|
} as unknown as FecTrackConfig
|
|
254
265
|
|
|
255
|
-
client.configure(fecTrackConfig, rqWasm)
|
|
256
266
|
try {
|
|
257
267
|
opts.multicastManager.setFecWorker(opts.packetId, client, opts.trackType, {
|
|
258
268
|
blockProfile,
|
|
269
|
+
algorithm: opts.fecAlgorithm ?? 'raptorq',
|
|
259
270
|
k: opts.fecK,
|
|
260
271
|
symbolSize: opts.fecSymbolSize,
|
|
261
272
|
interleaveDepthMs: opts.fecInterleaveMs,
|
|
@@ -264,6 +275,8 @@ export async function setupFecWorkerForTrack(
|
|
|
264
275
|
// or classification.
|
|
265
276
|
...(hasCatalogTiming ? { fps: 1000 / opts.mediaUnitDurationMs! } : {}),
|
|
266
277
|
timeoutMs: deliveryWindowMs,
|
|
278
|
+
...(opts.fecRepairLayers ? { repairLayers: opts.fecRepairLayers } : {}),
|
|
279
|
+
...(opts.heldRepairLayers ? { heldLayers: opts.heldRepairLayers } : {}),
|
|
267
280
|
}, opts.trackName)
|
|
268
281
|
} catch (e) {
|
|
269
282
|
// The manager refused the registration (for example the stream still
|
|
@@ -276,6 +289,21 @@ export async function setupFecWorkerForTrack(
|
|
|
276
289
|
}
|
|
277
290
|
throw e
|
|
278
291
|
}
|
|
292
|
+
// The Worker retires a block `interleaveDepth` blocks behind the newest
|
|
293
|
+
// SS_ID it has seen, repair SS_Starts included, by the metric the manager's
|
|
294
|
+
// locator uses for its own horizon. Repairs ride their own group and can run
|
|
295
|
+
// blocks ahead of their media, so a shorter Worker horizon fails a block whose
|
|
296
|
+
// late sources the manager still waits for.
|
|
297
|
+
// ponytail: read once here; a keyframe cadence configured later widens only
|
|
298
|
+
// the manager's horizon (reconfigure the Worker if a player ever does that).
|
|
299
|
+
fecTrackConfig.interleaveDepth = Math.min(
|
|
300
|
+
MAX_FEC_RETENTION_BLOCKS,
|
|
301
|
+
Math.max(
|
|
302
|
+
interleaveDepthBlocks,
|
|
303
|
+
opts.multicastManager.fecManager.isoRetentionBlocksForPacket(opts.packetId) ?? 0,
|
|
304
|
+
),
|
|
305
|
+
)
|
|
306
|
+
client.configure(fecTrackConfig, rqWasm)
|
|
279
307
|
|
|
280
308
|
let disposed = false
|
|
281
309
|
return {
|
package/src/index.ts
CHANGED
|
@@ -121,7 +121,7 @@ export {
|
|
|
121
121
|
} from './loc.js'
|
|
122
122
|
|
|
123
123
|
// CARP Catalog Extensions (draft-law-ramadan-moq-carp-reliability §3-4)
|
|
124
|
-
// + Track Timing (draft-ramadan-moq-mmt-
|
|
124
|
+
// + Track Timing (draft-ramadan-moq-mmt-01 §4.4.2)
|
|
125
125
|
export {
|
|
126
126
|
type FecAlgorithm,
|
|
127
127
|
type FecCatalogConfig,
|
|
@@ -173,7 +173,7 @@ export {
|
|
|
173
173
|
} from './delivery-catalog.js'
|
|
174
174
|
|
|
175
175
|
// Multicast input contract — validator + builder for publisher-emitted
|
|
176
|
-
// catalogs (draft-ramadan-moq-multicast-
|
|
176
|
+
// catalogs (draft-ramadan-moq-multicast-01 §4.1, BLO-3323 A.1).
|
|
177
177
|
// `multicastFromEnv` is the env-var helper used by FFmpeg and the
|
|
178
178
|
// cast bridge (BLO-3337).
|
|
179
179
|
export {
|
|
@@ -265,8 +265,12 @@ export {
|
|
|
265
265
|
type WasmFecDecoder,
|
|
266
266
|
type FecStats,
|
|
267
267
|
type MulticastSymbolDelivery,
|
|
268
|
+
type UndelimitedIsoLoss,
|
|
268
269
|
type FecBlockResolution,
|
|
269
270
|
type RepairVia,
|
|
271
|
+
type FecRepairLayer,
|
|
272
|
+
type FecFailClosedReason,
|
|
273
|
+
type FecFailClosedEvent,
|
|
270
274
|
} from './fec-manager.js'
|
|
271
275
|
|
|
272
276
|
// MMTP Router (packet processing + frame routing)
|
|
@@ -325,14 +329,6 @@ export {
|
|
|
325
329
|
type WasmMmtpParserConfig,
|
|
326
330
|
} from './wasm-mmtp-container-parser.js'
|
|
327
331
|
|
|
328
|
-
// FEC Codec (generic, algorithm-pluggable)
|
|
329
|
-
export {
|
|
330
|
-
type FecCodec,
|
|
331
|
-
NoneCodec,
|
|
332
|
-
ReedSolomonCodec,
|
|
333
|
-
createFecCodec,
|
|
334
|
-
} from './fec-codec.js'
|
|
335
|
-
|
|
336
332
|
// Multicast Transport (SSM join/socket/watchdog)
|
|
337
333
|
export {
|
|
338
334
|
MulticastTransport,
|
|
@@ -554,6 +550,7 @@ export {
|
|
|
554
550
|
catalogFecUnavailable,
|
|
555
551
|
catalogFecAvailable,
|
|
556
552
|
catalogFecDeclaresUnconfigurableInstance,
|
|
553
|
+
fecAlgorithmUnimplemented,
|
|
557
554
|
locateCatalogFecSource,
|
|
558
555
|
type CatalogFecRole,
|
|
559
556
|
type CatalogFecSource,
|
|
@@ -616,10 +613,26 @@ export {
|
|
|
616
613
|
type NoFecCounters,
|
|
617
614
|
} from "./fec-state.js";
|
|
618
615
|
|
|
616
|
+
// In-band AL-FEC for one MMTP asset over a MoQT subscription, for a player
|
|
617
|
+
// that owns its own parser (the Shaka MSF MMTP packaging).
|
|
618
|
+
export {
|
|
619
|
+
MmtpFecSession,
|
|
620
|
+
type MmtpFecSessionCatalogFec,
|
|
621
|
+
type MmtpFecSessionConfig,
|
|
622
|
+
type MmtpFecSessionDecoder,
|
|
623
|
+
type MmtpFecSessionDecoderConstructor,
|
|
624
|
+
type MmtpFecSessionMixedPathStats,
|
|
625
|
+
type MmtpFecSessionPath,
|
|
626
|
+
type MmtpFecSessionPathCounts,
|
|
627
|
+
type MmtpFecSessionStats,
|
|
628
|
+
} from "./mmtp-fec-session.js";
|
|
629
|
+
|
|
619
630
|
export {
|
|
620
631
|
catalogAmtNetworkSource,
|
|
632
|
+
catalogAtsc3NetworkSource,
|
|
621
633
|
DEFAULT_AMT_RELAY_PORT,
|
|
622
634
|
type AmtNetworkSource,
|
|
635
|
+
type Atsc3NetworkSource,
|
|
623
636
|
type CatalogNetworkSource,
|
|
624
637
|
} from "./catalog-network-source.js";
|
|
625
638
|
|
|
@@ -634,7 +647,11 @@ export {
|
|
|
634
647
|
type RepairFetchPriority,
|
|
635
648
|
type RepairFetchRequest,
|
|
636
649
|
type RepairFetchTransport,
|
|
650
|
+
type RepairRangeFetchRequest,
|
|
651
|
+
type RepairRangeFetchTransport,
|
|
652
|
+
type RepairDeadlineBound,
|
|
637
653
|
type RepairPriorityReason,
|
|
654
|
+
type RepairSendMeasurement,
|
|
638
655
|
type RepairSkipReason,
|
|
639
656
|
type RepairSubscribeCallback,
|
|
640
657
|
type WireRepairFetchOptions,
|
package/src/iso-block-locator.ts
CHANGED
|
@@ -51,9 +51,15 @@ export type IsoRepairPlacement<T> =
|
|
|
51
51
|
readonly placed: readonly IsoPlacedSource<T>[]
|
|
52
52
|
/** The repair-less span this repair closed in front of `block`, if any. */
|
|
53
53
|
readonly span?: { readonly block: IsoBlockRange; readonly placed: readonly IsoPlacedSource<T>[] }
|
|
54
|
+
/**
|
|
55
|
+
* With `deferIncompleteGaps`: the SS_IDs in front of `block` whose every
|
|
56
|
+
* repair was lost and some source too, kept as a pending hole instead of
|
|
57
|
+
* a span (see `closeHolesWithin`). `lostSsId` is the highest missing one.
|
|
58
|
+
*/
|
|
59
|
+
readonly hole?: { readonly block: IsoBlockRange; readonly lostSsId: number }
|
|
54
60
|
}
|
|
55
61
|
/** Not a block this stream can use; the repair symbol is dropped. */
|
|
56
|
-
| { readonly status: 'conflict' | 'overlap' | 'stale'; readonly reason: string }
|
|
62
|
+
| { readonly status: 'conflict' | 'overlap' | 'stale' | 'ahead'; readonly reason: string }
|
|
57
63
|
|
|
58
64
|
/**
|
|
59
65
|
* Retention: the locator is never without one. Every call that can grow it
|
|
@@ -79,6 +85,15 @@ export class IsoBlockLocator<T> {
|
|
|
79
85
|
#retentionBlocks: number
|
|
80
86
|
#heldEvicted = 0
|
|
81
87
|
#newest: number | undefined
|
|
88
|
+
/** Pending holes (see `deferIncompleteGaps`): unstated, sources still held. */
|
|
89
|
+
readonly #holes: IsoBlockRange[] = []
|
|
90
|
+
/**
|
|
91
|
+
* Keep a gap that is missing a source as a pending hole rather than a span,
|
|
92
|
+
* so a repair FETCHed for it (draft-ramadan-moq-fec §7.5) can still state
|
|
93
|
+
* its blocks. Set only while a range repair scheduler is wired; its owner
|
|
94
|
+
* must close every hole it is told about (`closeHolesWithin`).
|
|
95
|
+
*/
|
|
96
|
+
deferIncompleteGaps = false
|
|
82
97
|
|
|
83
98
|
/**
|
|
84
99
|
* @param kMax the catalog maximum K (`sourceSymbols`), the bound on SSB_length.
|
|
@@ -168,6 +183,16 @@ export class IsoBlockLocator<T> {
|
|
|
168
183
|
return null
|
|
169
184
|
}
|
|
170
185
|
|
|
186
|
+
/** Number of pending holes. */
|
|
187
|
+
get holeCount(): number {
|
|
188
|
+
return this.#holes.length
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** The stated block (never a span) ending exactly at `end`. */
|
|
192
|
+
blockEndingAt(end: number): IsoBlockRange | undefined {
|
|
193
|
+
return this.#blocks.find((block) => !block.span && isoBlockEnd(block.start, block.length) === end)
|
|
194
|
+
}
|
|
195
|
+
|
|
171
196
|
/** The known block or span starting exactly at `start`. */
|
|
172
197
|
blockAt(start: number): IsoBlockRange | undefined {
|
|
173
198
|
return this.#blocks.find((block) => block.start === start)
|
|
@@ -192,6 +217,10 @@ export class IsoBlockLocator<T> {
|
|
|
192
217
|
coversBetween(a: number, b: number): boolean {
|
|
193
218
|
if (this.#coverageEnd === undefined) return false
|
|
194
219
|
if (!serial32Precedes(a, b) || serial32Distance(a, b) <= 1) return true
|
|
220
|
+
// A pending hole may still be stated by a FETCHed repair.
|
|
221
|
+
const first = (a + 1) >>> 0
|
|
222
|
+
const count = serial32Distance(a, b) - 1
|
|
223
|
+
if (this.#holes.some((hole) => isoRangesOverlap(first, count, hole.start, hole.length))) return false
|
|
195
224
|
// The last SS_ID strictly before b must precede the coverage end.
|
|
196
225
|
return serial32Precedes((b - 1) >>> 0, this.#coverageEnd)
|
|
197
226
|
}
|
|
@@ -225,6 +254,15 @@ export class IsoBlockLocator<T> {
|
|
|
225
254
|
* known block (a different length, or an overlap with another block or a
|
|
226
255
|
* span) fails closed: the repair symbol is dropped and no block changes.
|
|
227
256
|
* A newly stated block retires behind its SS_Start (see the class note).
|
|
257
|
+
* A block so far past `newest` that stating it would retire the position
|
|
258
|
+
* `newest` is refused as `ahead`. When `newest` is a placed block's SS_Start
|
|
259
|
+
* this is slightly conservative (retirement measures that block from its
|
|
260
|
+
* last SS_ID), dropping up to one block-length of repairs past the horizon
|
|
261
|
+
* until a source moves `newest`. Placing it would turn everything
|
|
262
|
+
* between into a repair-less span and leave every real repair behind it
|
|
263
|
+
* `stale`. Sources move `newest` (`hold`, `observe`), so after a real outage
|
|
264
|
+
* the first source back brings the next repair inside the horizon; until one
|
|
265
|
+
* arrives, a stream's repairs alone cannot pass it.
|
|
228
266
|
*/
|
|
229
267
|
placeRepair(start: number, length: number): IsoRepairPlacement<T> {
|
|
230
268
|
if (!Number.isSafeInteger(length) || length <= 0 || length > this.#kMax) {
|
|
@@ -243,6 +281,23 @@ export class IsoBlockLocator<T> {
|
|
|
243
281
|
}
|
|
244
282
|
return { status: 'placed', block: known, placed: [] }
|
|
245
283
|
}
|
|
284
|
+
const pending = this.#holes.find((h) => isoBlockContains(h.start, h.length, start))
|
|
285
|
+
if (pending !== undefined) {
|
|
286
|
+
if (!isoBlockContains(pending.start, pending.length, serial32Add(start, length - 1))) {
|
|
287
|
+
return { status: 'overlap', reason: `repair block ${start}+${length} runs past pending hole ${pending.start}+${pending.length}` }
|
|
288
|
+
}
|
|
289
|
+
// A FETCHed repair stated a block inside a pending hole: split the hole round it.
|
|
290
|
+
this.#holes.splice(this.#holes.indexOf(pending), 1)
|
|
291
|
+
const before = serial32Distance(pending.start, start)
|
|
292
|
+
const afterStart = isoBlockEnd(start, length)
|
|
293
|
+
const after = pending.length - before - length
|
|
294
|
+
if (before > 0) this.#holes.push({ start: pending.start, length: before, span: false })
|
|
295
|
+
if (after > 0) this.#holes.push({ start: afterStart, length: after, span: false })
|
|
296
|
+
const block: IsoBlockRange = { start, length, span: false }
|
|
297
|
+
const placed = this.#claim(block)
|
|
298
|
+
this.#blocks.push(block)
|
|
299
|
+
return { status: 'placed', block, placed }
|
|
300
|
+
}
|
|
246
301
|
for (const block of this.#blocks) {
|
|
247
302
|
if (
|
|
248
303
|
isoBlockContains(block.start, block.length, start) ||
|
|
@@ -254,7 +309,11 @@ export class IsoBlockLocator<T> {
|
|
|
254
309
|
}
|
|
255
310
|
}
|
|
256
311
|
}
|
|
312
|
+
if (this.#newest !== undefined && isoBlocksBehindLowerBound(this.#newest, start, this.#kMax) > this.#retentionBlocks) {
|
|
313
|
+
return { status: 'ahead', reason: `repair block ${start}+${length} is past the retention horizon ahead of ${this.#newest}` }
|
|
314
|
+
}
|
|
257
315
|
let span: { block: IsoBlockRange; placed: IsoPlacedSource<T>[] } | undefined
|
|
316
|
+
let hole: { block: IsoBlockRange; lostSsId: number } | undefined
|
|
258
317
|
if (this.#coverageEnd === undefined) {
|
|
259
318
|
// Reception starts at the first stated block. Held sources before it
|
|
260
319
|
// are the tail of blocks that began before the join: their range is
|
|
@@ -266,24 +325,57 @@ export class IsoBlockLocator<T> {
|
|
|
266
325
|
} else if (serial32Precedes(start, this.#coverageEnd)) {
|
|
267
326
|
return { status: 'stale', reason: `repair block ${start}+${length} precedes known coverage` }
|
|
268
327
|
} else if (start !== this.#coverageEnd) {
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
span:
|
|
328
|
+
const gap = { start: this.#coverageEnd, length: serial32Distance(this.#coverageEnd, start) }
|
|
329
|
+
const lostSsId = this.deferIncompleteGaps ? this.#highestMissing(gap.start, gap.length) : undefined
|
|
330
|
+
if (lostSsId !== undefined) {
|
|
331
|
+
const holeBlock: IsoBlockRange = { ...gap, span: false }
|
|
332
|
+
this.#holes.push(holeBlock)
|
|
333
|
+
hole = { block: holeBlock, lostSsId }
|
|
334
|
+
} else {
|
|
335
|
+
const spanBlock: IsoBlockRange = { ...gap, span: true }
|
|
336
|
+
span = { block: spanBlock, placed: this.#claim(spanBlock) }
|
|
337
|
+
this.#blocks.push(spanBlock)
|
|
273
338
|
}
|
|
274
|
-
span = { block: spanBlock, placed: this.#claim(spanBlock) }
|
|
275
|
-
this.#blocks.push(spanBlock)
|
|
276
339
|
}
|
|
277
340
|
const block: IsoBlockRange = { start, length, span: false }
|
|
278
341
|
const placed = this.#claim(block)
|
|
279
342
|
this.#blocks.push(block)
|
|
280
343
|
this.#coverageEnd = isoBlockEnd(start, length)
|
|
281
344
|
this.retireBehind(start)
|
|
345
|
+
if (hole !== undefined) return { status: 'placed', block, placed, hole }
|
|
282
346
|
return span === undefined
|
|
283
347
|
? { status: 'placed', block, placed }
|
|
284
348
|
: { status: 'placed', block, placed, span }
|
|
285
349
|
}
|
|
286
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Turn every pending hole inside `[start, start + length)` into a
|
|
353
|
+
* repair-less span, claiming its held sources: its range FETCH ended, so
|
|
354
|
+
* nothing more will state its blocks. Returns the spans, in SS_ID order.
|
|
355
|
+
*/
|
|
356
|
+
closeHolesWithin(start: number, length: number): { block: IsoBlockRange; placed: IsoPlacedSource<T>[] }[] {
|
|
357
|
+
const closed: { block: IsoBlockRange; placed: IsoPlacedSource<T>[] }[] = []
|
|
358
|
+
for (const hole of [...this.#holes]) {
|
|
359
|
+
if (!isoBlockContains(start, length, hole.start)) continue
|
|
360
|
+
this.#holes.splice(this.#holes.indexOf(hole), 1)
|
|
361
|
+
const spanBlock: IsoBlockRange = { start: hole.start, length: hole.length, span: true }
|
|
362
|
+
closed.push({ block: spanBlock, placed: this.#claim(spanBlock) })
|
|
363
|
+
this.#blocks.push(spanBlock)
|
|
364
|
+
}
|
|
365
|
+
return closed.sort((x, y) => serial32Distance(start, x.block.start) - serial32Distance(start, y.block.start))
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** The highest SS_ID in the range no source is held for, or undefined when all are. */
|
|
369
|
+
#highestMissing(start: number, length: number): number | undefined {
|
|
370
|
+
// Every position past the held count cannot all be held: bounded scan.
|
|
371
|
+
const steps = Math.min(length, this.#held.size + 1)
|
|
372
|
+
for (let i = 1; i <= steps; i++) {
|
|
373
|
+
const ssId = serial32Add(start, length - i)
|
|
374
|
+
if (!this.#held.has(ssId)) return ssId
|
|
375
|
+
}
|
|
376
|
+
return undefined
|
|
377
|
+
}
|
|
378
|
+
|
|
287
379
|
/**
|
|
288
380
|
* Retire every block and span whose last SS_ID, and every held source,
|
|
289
381
|
* lies more than `retentionBlocks` blocks behind `position`, with the shared
|
|
@@ -302,6 +394,11 @@ export class IsoBlockLocator<T> {
|
|
|
302
394
|
this.#blocks.splice(i, 1)
|
|
303
395
|
}
|
|
304
396
|
}
|
|
397
|
+
for (let i = this.#holes.length - 1; i >= 0; i--) {
|
|
398
|
+
const hole = this.#holes[i]!
|
|
399
|
+
const last = serial32Add(hole.start, hole.length - 1)
|
|
400
|
+
if (isoBlocksBehindLowerBound(last, position, this.#kMax) > horizon) this.#holes.splice(i, 1)
|
|
401
|
+
}
|
|
305
402
|
for (const ssId of [...this.#held.keys()]) {
|
|
306
403
|
if (isoBlocksBehindLowerBound(ssId, position, this.#kMax) > horizon) this.#held.delete(ssId)
|
|
307
404
|
}
|
|
@@ -311,6 +408,7 @@ export class IsoBlockLocator<T> {
|
|
|
311
408
|
/** Forget everything (publisher restart, track reset). */
|
|
312
409
|
reset(): void {
|
|
313
410
|
this.#blocks.length = 0
|
|
411
|
+
this.#holes.length = 0
|
|
314
412
|
this.#held.clear()
|
|
315
413
|
this.#coverageEnd = undefined
|
|
316
414
|
this.#newest = undefined
|
|
@@ -327,3 +425,8 @@ export class IsoBlockLocator<T> {
|
|
|
327
425
|
return placed
|
|
328
426
|
}
|
|
329
427
|
}
|
|
428
|
+
|
|
429
|
+
/** Whether `[aStart, aStart + aLength)` and `[bStart, bStart + bLength)` share an SS_ID. */
|
|
430
|
+
function isoRangesOverlap(aStart: number, aLength: number, bStart: number, bLength: number): boolean {
|
|
431
|
+
return serial32Distance(aStart, bStart) < aLength || serial32Distance(bStart, aStart) < bLength
|
|
432
|
+
}
|
|
@@ -1,107 +1,55 @@
|
|
|
1
|
+
import type { ManifestKey } from '@blockcast/mmt-manifest-verify'
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
manifestBindingId,
|
|
4
|
-
type ManifestAuthConfig,
|
|
5
|
-
type ManifestTrackContext,
|
|
6
|
-
type SignatureVerifier,
|
|
7
|
-
} from '@blockcast/mmt-manifest-verify'
|
|
8
|
-
import {
|
|
3
|
+
multicastAuthKeyFor,
|
|
9
4
|
resolveMulticastAuthCatalog,
|
|
10
|
-
type MulticastAuthMode,
|
|
11
5
|
type ResolvedMulticastAuthConfig,
|
|
6
|
+
type ResolvedMulticastAuthFlow,
|
|
12
7
|
} from './multicast-auth-catalog.js'
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The bc-provenance version 2 plan a receiver binds from one catalog
|
|
11
|
+
* (draft-ramadan-moq-multicast-01 7.2.6): the key set, `minEpoch`, and one
|
|
12
|
+
* flow per protected endpoint. The record verifier and the 7.2.7 state machine
|
|
13
|
+
* consume it; this plan holds no verification state.
|
|
14
|
+
*/
|
|
21
15
|
export interface ManifestAuthPlan {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
keys: readonly ManifestKey[]
|
|
17
|
+
minEpoch: number
|
|
18
|
+
flows: readonly ResolvedMulticastAuthFlow[]
|
|
19
|
+
/** Every `manifestTrack` a flow names, for a unicast receiver to subscribe. */
|
|
25
20
|
manifestTracks: readonly string[]
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
/** The key that signs a record of `kid` at `epoch`; `undefined` drops it.
|
|
22
|
+
* Key selection only: it does not apply `minEpoch`, which the record
|
|
23
|
+
* verifier checks (BLO-49771). */
|
|
24
|
+
keyFor(kid: number, epoch: number): Uint8Array | undefined
|
|
25
|
+
/** The flow whose records arrive on `(S, G, manifestPort)`. */
|
|
26
|
+
flowForManifestPort(source: string, groupAddress: string, manifestPort: number): ResolvedMulticastAuthFlow | undefined
|
|
27
|
+
/** The flow a manifest track mirrors. */
|
|
28
|
+
flowForManifestTrack(manifestTrack: string): ResolvedMulticastAuthFlow | undefined
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
>
|
|
35
|
-
|
|
36
|
-
/** Build the one canonical verifier plan shared by browser players. Transport
|
|
37
|
-
* implementations subscribe the exact returned manifestTracks and feed each
|
|
38
|
-
* bare source-auth frame to ingestManifestPayload without name inference. */
|
|
31
|
+
/** Build the plan, or `undefined` for an unprotected catalog. Throws where
|
|
32
|
+
* `resolveMulticastAuthCatalog` does: no key set, or authentication pinned
|
|
33
|
+
* by `requireAuth` on a catalog without `multicast.auth`. */
|
|
39
34
|
export function createManifestAuthPlan(
|
|
40
35
|
catalog: unknown,
|
|
41
|
-
options: {
|
|
42
|
-
playerMode?: MulticastAuthMode
|
|
43
|
-
onMissingManifest?: ManifestAuthConfig['onMissingManifest']
|
|
44
|
-
verifySignature: SignatureVerifier
|
|
45
|
-
contextFor(
|
|
46
|
-
binding: ResolvedMulticastAuthConfig['tracks'][number],
|
|
47
|
-
resolved: ResolvedMulticastAuthConfig,
|
|
48
|
-
): ContextFields
|
|
49
|
-
onFailure?: ConstructorParameters<typeof ManifestVerifier>[0]['onFailure']
|
|
50
|
-
},
|
|
36
|
+
options: { requireAuth?: boolean; catalogNamespace?: string } = {},
|
|
51
37
|
): ManifestAuthPlan | undefined {
|
|
52
|
-
const resolved = resolveMulticastAuthCatalog(catalog, options
|
|
53
|
-
if (!resolved
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
onMissingManifest: options.onMissingManifest ??
|
|
59
|
-
(resolved.mode === 'enforce' ? 'stall' : 'fallback-shadow'),
|
|
60
|
-
},
|
|
61
|
-
verifySignature: options.verifySignature,
|
|
62
|
-
...(options.onFailure === undefined ? {} : { onFailure: options.onFailure }),
|
|
63
|
-
})
|
|
64
|
-
const byManifestTrack = new Map<string, ManifestAuthBinding>()
|
|
65
|
-
const bindings = resolved.tracks.map((binding): ManifestAuthBinding => {
|
|
66
|
-
const bindingId = manifestBindingId(binding.mediaTrack, binding.sourceSymbolFormat)
|
|
67
|
-
const planned = {
|
|
68
|
-
bindingId,
|
|
69
|
-
mediaTrack: binding.mediaTrack,
|
|
70
|
-
manifestTrack: binding.manifestTrack,
|
|
71
|
-
sourceSymbolFormat: binding.sourceSymbolFormat,
|
|
72
|
-
}
|
|
73
|
-
verifier.registerTrack({
|
|
74
|
-
...options.contextFor(binding, resolved),
|
|
75
|
-
bindingId,
|
|
76
|
-
trackName: binding.mediaTrack,
|
|
77
|
-
sourceSymbolFormat: binding.sourceSymbolFormat,
|
|
78
|
-
authScope: binding.authScope,
|
|
79
|
-
publicKey: resolved.acceptedPublicKeys[0]!,
|
|
80
|
-
acceptedPublicKeys: resolved.acceptedPublicKeys,
|
|
81
|
-
})
|
|
82
|
-
byManifestTrack.set(binding.manifestTrack, planned)
|
|
83
|
-
return planned
|
|
84
|
-
})
|
|
85
|
-
let disposed = false
|
|
86
|
-
|
|
38
|
+
const resolved: ResolvedMulticastAuthConfig | undefined = resolveMulticastAuthCatalog(catalog, options)
|
|
39
|
+
if (!resolved) return undefined
|
|
40
|
+
const byManifestTrack = new Map<string, ResolvedMulticastAuthFlow>()
|
|
41
|
+
for (const flow of resolved.flows) {
|
|
42
|
+
if (flow.manifestTrack !== undefined) byManifestTrack.set(flow.manifestTrack, flow)
|
|
43
|
+
}
|
|
87
44
|
return {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
45
|
+
keys: resolved.keys,
|
|
46
|
+
minEpoch: resolved.minEpoch,
|
|
47
|
+
flows: resolved.flows,
|
|
91
48
|
manifestTracks: [...byManifestTrack.keys()],
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const binding = byManifestTrack.get(manifestTrack)
|
|
98
|
-
if (!binding) throw new Error(`unknown manifest subscription track ${manifestTrack}`)
|
|
99
|
-
verifier.ingestManifestFrame(binding.bindingId, payload)
|
|
100
|
-
},
|
|
101
|
-
dispose() {
|
|
102
|
-
if (disposed) return
|
|
103
|
-
disposed = true
|
|
104
|
-
verifier.dispose()
|
|
105
|
-
},
|
|
49
|
+
keyFor: (kid, epoch) => multicastAuthKeyFor(resolved, kid, epoch),
|
|
50
|
+
flowForManifestPort: (source, groupAddress, manifestPort) =>
|
|
51
|
+
resolved.flows.find(flow =>
|
|
52
|
+
flow.source === source && flow.groupAddress === groupAddress && flow.manifestPort === manifestPort),
|
|
53
|
+
flowForManifestTrack: manifestTrack => byManifestTrack.get(manifestTrack),
|
|
106
54
|
}
|
|
107
55
|
}
|