@blockcast/mmt-container 0.1.0-main.c71423b8a4e4 → 0.1.0-main.ce3c8aeb7f68
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/dist/align.d.ts +6 -2
- package/dist/align.d.ts.map +1 -1
- package/dist/align.js.map +2 -2
- package/dist/audio-ring-buffer.js +23 -36
- package/dist/audio-ring-buffer.js.map +1 -1
- package/dist/browser-runtime.js +6865 -6485
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +3 -1
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +21 -2
- package/dist/carp-catalog.js.map +4 -4
- package/dist/catalog-fec-params.js +10 -0
- package/dist/catalog-fec-params.js.map +4 -4
- package/dist/cmaf-block-assembler.d.ts +42 -0
- package/dist/cmaf-block-assembler.d.ts.map +1 -1
- package/dist/cmaf-block-assembler.js +542 -535
- package/dist/cmaf-block-assembler.js.map +2 -2
- package/dist/cmaf-group-batcher.js +27 -46
- package/dist/cmaf-group-batcher.js.map +2 -2
- package/dist/cmcd-producer.js +45 -66
- package/dist/cmcd-producer.js.map +1 -1
- package/dist/fec-manager.d.ts +13 -1
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +1151 -871
- package/dist/fec-manager.js.map +2 -2
- package/dist/fec-starvation-detector.js +25 -40
- package/dist/fec-starvation-detector.js.map +1 -1
- package/dist/fec-worker-setup.js +242 -225
- package/dist/fec-worker-setup.js.map +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +2 -2
- package/dist/iso-bmff-timing.js +63 -88
- package/dist/iso-bmff-timing.js.map +1 -1
- package/dist/loc.js +7 -4
- package/dist/loc.js.map +1 -1
- package/dist/manifest-auth-plan.js +292 -311
- package/dist/manifest-auth-plan.js.map +1 -1
- package/dist/media-router.d.ts +0 -99
- package/dist/media-router.d.ts.map +1 -1
- package/dist/media-router.js +270 -504
- package/dist/media-router.js.map +3 -3
- package/dist/mfu-reassembler.js +597 -607
- package/dist/mfu-reassembler.js.map +3 -3
- package/dist/mmtp-container-parser.d.ts +37 -0
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +1531 -1522
- package/dist/mmtp-container-parser.js.map +3 -3
- package/dist/mmtp-container-parser.no-modules.js +179 -102
- package/dist/mmtp-container-parser.no-modules.js.map +3 -3
- package/dist/mmtp-decode-pipeline.js +1641 -1651
- package/dist/mmtp-decode-pipeline.js.map +3 -3
- package/dist/mmtp-router.d.ts +34 -0
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +3676 -3390
- package/dist/mmtp-router.js.map +3 -3
- package/dist/mmtp-to-cmaf.d.ts +7 -1
- package/dist/mmtp-to-cmaf.d.ts.map +1 -1
- package/dist/mmtp-to-cmaf.js +109 -134
- package/dist/mmtp-to-cmaf.js.map +2 -2
- package/dist/multicast-input.d.ts +7 -35
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +21 -2
- package/dist/multicast-input.js.map +4 -4
- package/dist/multicast-manager.d.ts +10 -1
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +5584 -4961
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +7 -0
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +369 -421
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +53 -30
- package/dist/multicast-unwrap.js.map +2 -2
- package/dist/no-modules.js +2096 -2097
- package/dist/no-modules.js.map +3 -3
- package/dist/sample-combiner.js +118 -139
- package/dist/sample-combiner.js.map +1 -1
- package/dist/signaling.js.map +2 -2
- package/dist/source-auth.js +353 -382
- package/dist/source-auth.js.map +1 -1
- package/dist/switching-set-alignment.js +14 -29
- package/dist/switching-set-alignment.js.map +1 -1
- package/dist/timestamp-codec.js +17 -11
- package/dist/timestamp-codec.js.map +2 -2
- package/dist/track-pipeline-setup.js +105 -125
- package/dist/track-pipeline-setup.js.map +1 -1
- package/dist/track-pipeline.js +107 -127
- package/dist/track-pipeline.js.map +1 -1
- package/dist/track-session.d.ts +16 -0
- package/dist/track-session.d.ts.map +1 -1
- package/dist/track-session.js +230 -243
- package/dist/track-session.js.map +2 -2
- package/dist/transport-pool.js +24 -38
- package/dist/transport-pool.js.map +1 -1
- package/dist/wasm-mfu-reassembler.d.ts +6 -1
- package/dist/wasm-mfu-reassembler.d.ts.map +1 -1
- package/dist/wasm-mfu-reassembler.js +127 -144
- package/dist/wasm-mfu-reassembler.js.map +2 -2
- package/dist/wasm-mmtp-container-parser.js +1659 -1650
- package/dist/wasm-mmtp-container-parser.js.map +3 -3
- package/node_modules/@blockcast/fec-worker/README.md +5 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +8 -2
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +1 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +89 -16
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +1 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +48 -3
- package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +1 -1
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +55 -8
- package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +2 -2
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts +1 -1
- package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +1 -1
- package/node_modules/@blockcast/fec-worker/dist/index.js.map +1 -1
- package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +97 -17
- package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +46 -2
- package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +78 -10
- package/node_modules/@blockcast/fec-worker/src/index.ts +2 -0
- package/node_modules/@blockcast/mmt-base/README.md +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +52 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -1
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js +142 -37
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -1
- package/node_modules/@blockcast/mmt-base/src/mmtp.ts +158 -37
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +1 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +52 -0
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +142 -37
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -1
- package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +158 -37
- package/package.json +7 -6
- package/schemas/catalog.schema.json +1 -1
- package/src/align.ts +6 -2
- package/src/carp-catalog.ts +13 -3
- package/src/cmaf-block-assembler.ts +90 -81
- package/src/fec-manager.ts +530 -146
- package/src/index.ts +2 -2
- package/src/media-router.ts +0 -397
- package/src/mmtp-container-parser.ts +97 -21
- package/src/mmtp-router.ts +302 -125
- package/src/mmtp-to-cmaf.ts +21 -7
- package/src/multicast-input.ts +23 -3
- package/src/multicast-manager.ts +83 -11
- package/src/multicast-transport.ts +56 -17
- package/src/track-session.ts +16 -0
- package/src/wasm-mfu-reassembler.ts +40 -24
- package/test-vectors/catalog/README.md +2 -0
- package/test-vectors/catalog/negative/multicast-packet-id-signaling.json +26 -0
- package/test-vectors/catalog-validation.json +11 -0
|
@@ -125,6 +125,8 @@ var BlockcastMmt = (() => {
|
|
|
125
125
|
var SOURCE_FEC_PAYLOAD_ID_SIZE = 4;
|
|
126
126
|
var PACKET_TYPE_MPU2 = 0;
|
|
127
127
|
var PACKET_TYPE_REPAIR = 3;
|
|
128
|
+
var MMTP_SIGNALING_PACKET_ID = 0;
|
|
129
|
+
var MMTP_PACKET_ID_MAX = 65535;
|
|
128
130
|
function parseMMTPHeader(buffer) {
|
|
129
131
|
if (buffer.length < MMTP_HEADER_SIZE2) {
|
|
130
132
|
throw new Error(`MMTP packet too small: ${buffer.length} bytes`);
|
|
@@ -283,7 +285,7 @@ var BlockcastMmt = (() => {
|
|
|
283
285
|
}
|
|
284
286
|
return null;
|
|
285
287
|
}
|
|
286
|
-
function planMfuExtraction(mmtpPacket, options) {
|
|
288
|
+
function planMfuExtraction(mmtpPacket, options, parsedHeader) {
|
|
287
289
|
if (mmtpPacket.length < MMTP_HEADER_SIZE2 + MPU_HEADER_SIZE2) {
|
|
288
290
|
return {
|
|
289
291
|
rejection: {
|
|
@@ -293,15 +295,19 @@ var BlockcastMmt = (() => {
|
|
|
293
295
|
};
|
|
294
296
|
}
|
|
295
297
|
let header;
|
|
296
|
-
|
|
297
|
-
header =
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
if (parsedHeader) {
|
|
299
|
+
header = parsedHeader;
|
|
300
|
+
} else {
|
|
301
|
+
try {
|
|
302
|
+
header = parseMMTPHeader(mmtpPacket);
|
|
303
|
+
} catch (error) {
|
|
304
|
+
return {
|
|
305
|
+
rejection: {
|
|
306
|
+
gate: "mmtp-header-unparseable",
|
|
307
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
305
311
|
}
|
|
306
312
|
if (header.packetType !== PACKET_TYPE_MPU2) {
|
|
307
313
|
return {
|
|
@@ -353,8 +359,10 @@ var BlockcastMmt = (() => {
|
|
|
353
359
|
}
|
|
354
360
|
return { plan: { header, payload, mpu, fragmentType, layout, trailerLayout } };
|
|
355
361
|
}
|
|
356
|
-
function
|
|
357
|
-
|
|
362
|
+
function extractMFUPayloadWithHeader(mmtpPacket, header, options) {
|
|
363
|
+
return extractPlannedMfu(mmtpPacket, planMfuExtraction(mmtpPacket, options, header));
|
|
364
|
+
}
|
|
365
|
+
function extractPlannedMfu(mmtpPacket, result) {
|
|
358
366
|
if ("rejection" in result)
|
|
359
367
|
return null;
|
|
360
368
|
const { header, payload, mpu, fragmentType, layout, trailerLayout } = result.plan;
|
|
@@ -369,32 +377,24 @@ var BlockcastMmt = (() => {
|
|
|
369
377
|
} : null;
|
|
370
378
|
return { header, mpu, fragmentType, data, mfuDuHeader, itemId, fecPayloadId };
|
|
371
379
|
}
|
|
372
|
-
function
|
|
373
|
-
if (!hasSourceFecPayloadId(mmtpPacket))
|
|
374
|
-
return null;
|
|
375
|
-
const off = mmtpPacket.length - SOURCE_FEC_PAYLOAD_ID_SIZE;
|
|
376
|
-
const view2 = new DataView(mmtpPacket.buffer, mmtpPacket.byteOffset + off, SOURCE_FEC_PAYLOAD_ID_SIZE);
|
|
377
|
-
return { ssId: view2.getUint32(0, false) };
|
|
378
|
-
}
|
|
379
|
-
function hasSourceFecPayloadId(mmtpPacket) {
|
|
380
|
+
function sourceFecPayloadIdOf(mmtpPacket, header) {
|
|
380
381
|
if (mmtpPacket.length < MMTP_HEADER_SIZE2 + MPU_HEADER_SIZE2)
|
|
381
|
-
return
|
|
382
|
-
let header;
|
|
383
|
-
try {
|
|
384
|
-
header = parseMMTPHeader(mmtpPacket);
|
|
385
|
-
} catch {
|
|
386
|
-
return false;
|
|
387
|
-
}
|
|
382
|
+
return null;
|
|
388
383
|
if (header.packetType !== PACKET_TYPE_MPU2)
|
|
389
|
-
return
|
|
384
|
+
return null;
|
|
390
385
|
const payload = mmtpPacket.subarray(header.headerLength);
|
|
391
386
|
if (payload.length < MPU_HEADER_SIZE2)
|
|
392
|
-
return
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
return
|
|
396
|
-
const declaredEnd = MPU_LENGTH_FIELD_SIZE2 +
|
|
397
|
-
|
|
387
|
+
return null;
|
|
388
|
+
const payloadLength = payload[0] << 8 | payload[1];
|
|
389
|
+
if (payloadLength < MPU_HEADER_REMAINDER_SIZE2)
|
|
390
|
+
return null;
|
|
391
|
+
const declaredEnd = MPU_LENGTH_FIELD_SIZE2 + payloadLength;
|
|
392
|
+
if (!resolveDeclaredTrailers(payload, declaredEnd, header.fecType)?.hasFecId)
|
|
393
|
+
return null;
|
|
394
|
+
const off = mmtpPacket.length - SOURCE_FEC_PAYLOAD_ID_SIZE;
|
|
395
|
+
return {
|
|
396
|
+
ssId: (mmtpPacket[off] << 24 | mmtpPacket[off + 1] << 16 | mmtpPacket[off + 2] << 8 | mmtpPacket[off + 3]) >>> 0
|
|
397
|
+
};
|
|
398
398
|
}
|
|
399
399
|
var extractAltaTrailer2 = extractAltaTrailer;
|
|
400
400
|
|
|
@@ -5196,7 +5196,7 @@ var BlockcastMmt = (() => {
|
|
|
5196
5196
|
const type = String.fromCharCode(data[4], data[5], data[6], data[7]);
|
|
5197
5197
|
return FMPU_BOX_TYPES.has(type);
|
|
5198
5198
|
}
|
|
5199
|
-
var _tracks, _defaultTrack, _reassembler, _sampleCombiners, _sampleCombinerOptions, _retiredSampleCombinerStats, _timingStreams, _maxPendingTimingSamples, _pendingTimingSamples, _reclaimedTimingSamples, _evictedTimingSamples, _rejectedMovieFragments, _sequencers, _reorderWindow, _reassemblyPolicy, _frameCb, _initCb, _sourceSymbolCb, _trackFrameCbs, _reorderStats, _reliableMoqStartupGate, _disposed, _fedObjects, _feedOutcomes, _deferredFeedOutcomes, _lastOutcome, _lastOutcomeCount, _MmtpContainerParser_instances, streamKey_fn, sampleCombinerFor_fn, releaseTimingSlot_fn, dropSampleCombiner_fn, countOutcome_fn, countDeferredOutcome_fn, drop_fn, feed_fn, emitCombinedSample_fn, passReliableMoqStartupGate_fn, timingResolver_fn, dropTimingStream_fn, validateReassemblyPolicy_fn, buildFrameMeta_fn, sequencerFor_fn, flushSequencers_fn, emitFrame_fn2, _MmtpContainerParser_static, scanForKeyframe_fn, scanLengthPrefixedHevcForKeyframe_fn, scanAnnexBForKeyframe_fn;
|
|
5199
|
+
var _tracks, _defaultTrack, _reassembler, _sampleCombiners, _sampleCombinerOptions, _retiredSampleCombinerStats, _timingStreams, _maxPendingTimingSamples, _pendingTimingSamples, _reclaimedTimingSamples, _evictedTimingSamples, _rejectedMovieFragments, _sequencers, _reorderWindow, _reassemblyPolicy, _frameCb, _initCb, _sourceSymbolCb, _trackFrameCbs, _reorderStats, _reliableMoqStartupGate, _disposed, _fedObjects, _reassemblerFragmentsFed, _reassemblerDataUnitsReturned, _feedOutcomes, _deferredFeedOutcomes, _lastOutcome, _lastOutcomeCount, _MmtpContainerParser_instances, streamKey_fn, sampleCombinerFor_fn, releaseTimingSlot_fn, dropSampleCombiner_fn, countOutcome_fn, countDeferredOutcome_fn, drop_fn, feedCounted_fn, feed_fn, emitCombinedSample_fn, passReliableMoqStartupGate_fn, timingResolver_fn, dropTimingStream_fn, validateReassemblyPolicy_fn, buildFrameMeta_fn, sequencerFor_fn, flushSequencers_fn, emitFrame_fn2, _MmtpContainerParser_static, scanForKeyframe_fn, scanLengthPrefixedHevcForKeyframe_fn, scanAnnexBForKeyframe_fn;
|
|
5200
5200
|
var _MmtpContainerParser = class _MmtpContainerParser {
|
|
5201
5201
|
constructor(config) {
|
|
5202
5202
|
__privateAdd(this, _MmtpContainerParser_instances);
|
|
@@ -5258,6 +5258,8 @@ var BlockcastMmt = (() => {
|
|
|
5258
5258
|
__privateAdd(this, _reliableMoqStartupGate, /* @__PURE__ */ new Map());
|
|
5259
5259
|
__privateAdd(this, _disposed, false);
|
|
5260
5260
|
__privateAdd(this, _fedObjects, 0);
|
|
5261
|
+
__privateAdd(this, _reassemblerFragmentsFed, 0);
|
|
5262
|
+
__privateAdd(this, _reassemblerDataUnitsReturned, 0);
|
|
5261
5263
|
__privateAdd(this, _feedOutcomes, /* @__PURE__ */ new Map());
|
|
5262
5264
|
__privateAdd(this, _deferredFeedOutcomes, /* @__PURE__ */ new Map());
|
|
5263
5265
|
__privateAdd(this, _lastOutcome, null);
|
|
@@ -5403,6 +5405,19 @@ var BlockcastMmt = (() => {
|
|
|
5403
5405
|
get lastFeedOutcomeCount() {
|
|
5404
5406
|
return __privateGet(this, _lastOutcomeCount);
|
|
5405
5407
|
}
|
|
5408
|
+
/**
|
|
5409
|
+
* MFU fragments feed() handed to the reassembler, including rejected ones.
|
|
5410
|
+
* A plain scalar a per-packet caller can difference; reading the
|
|
5411
|
+
* reassembler's own stats is a wasm crossing on the Rust backend
|
|
5412
|
+
* (BLO-36599).
|
|
5413
|
+
*/
|
|
5414
|
+
get reassemblerFragmentsFed() {
|
|
5415
|
+
return __privateGet(this, _reassemblerFragmentsFed);
|
|
5416
|
+
}
|
|
5417
|
+
/** Data units the reassembler returned complete to feed(). */
|
|
5418
|
+
get reassemblerDataUnitsReturned() {
|
|
5419
|
+
return __privateGet(this, _reassemblerDataUnitsReturned);
|
|
5420
|
+
}
|
|
5406
5421
|
get reorderDiagnostics() {
|
|
5407
5422
|
const streams = [];
|
|
5408
5423
|
for (const { packetId, sequencer } of __privateGet(this, _sequencers).values()) {
|
|
@@ -5431,20 +5446,35 @@ var BlockcastMmt = (() => {
|
|
|
5431
5446
|
* Returns null for malformed packets.
|
|
5432
5447
|
*/
|
|
5433
5448
|
parseHeader(packet, options) {
|
|
5449
|
+
return this.parsePacket(packet, options)?.info ?? null;
|
|
5450
|
+
}
|
|
5451
|
+
/**
|
|
5452
|
+
* parseHeader() that also keeps the parsed MMTP header, so a caller that
|
|
5453
|
+
* goes on to feedParsed() the same packet parses its header exactly once.
|
|
5454
|
+
* The MMTP header is parsed once here and the Source FEC Payload ID is read
|
|
5455
|
+
* from it; parseHeader() used to parse the header three times for an FEC
|
|
5456
|
+
* source packet, and feed() repeated all of it (BLO-36599).
|
|
5457
|
+
*/
|
|
5458
|
+
parsePacket(packet, options) {
|
|
5434
5459
|
try {
|
|
5435
5460
|
const header = parseMMTPHeader(packet);
|
|
5436
5461
|
const isRepair = header.packetType === PACKET_TYPE_REPAIR;
|
|
5437
|
-
const
|
|
5462
|
+
const skipFecPayloadId = options?.skipFecPayloadId === true;
|
|
5463
|
+
const fecPayloadId = !skipFecPayloadId && !isRepair ? sourceFecPayloadIdOf(packet, header) : null;
|
|
5438
5464
|
return {
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5465
|
+
info: {
|
|
5466
|
+
packetId: header.packetId,
|
|
5467
|
+
packetType: header.packetType,
|
|
5468
|
+
timestamp: header.timestamp,
|
|
5469
|
+
timestampUs: mmtpTimestampToMicros(header.timestamp),
|
|
5470
|
+
sequenceNumber: header.sequenceNumber,
|
|
5471
|
+
rapFlag: header.rapFlag,
|
|
5472
|
+
fecType: header.fecType,
|
|
5473
|
+
fecPayloadId,
|
|
5474
|
+
isRepair
|
|
5475
|
+
},
|
|
5476
|
+
header,
|
|
5477
|
+
skipFecPayloadId
|
|
5448
5478
|
};
|
|
5449
5479
|
} catch {
|
|
5450
5480
|
return null;
|
|
@@ -5452,16 +5482,16 @@ var BlockcastMmt = (() => {
|
|
|
5452
5482
|
}
|
|
5453
5483
|
/** Feed a complete MMTP packet. For two-phase use, call parseHeader() first. */
|
|
5454
5484
|
feed(packet, options) {
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
return
|
|
5485
|
+
return __privateMethod(this, _MmtpContainerParser_instances, feedCounted_fn).call(this, packet, options, void 0);
|
|
5486
|
+
}
|
|
5487
|
+
/**
|
|
5488
|
+
* feed() for a packet this caller already ran through parsePacket(): the
|
|
5489
|
+
* header parse is reused instead of repeated. `parsed` must come from
|
|
5490
|
+
* parsePacket() of this same, unmodified packet. If it was resolved under a
|
|
5491
|
+
* different skipFecPayloadId option, the packet is parsed again.
|
|
5492
|
+
*/
|
|
5493
|
+
feedParsed(packet, parsed, options) {
|
|
5494
|
+
return __privateMethod(this, _MmtpContainerParser_instances, feedCounted_fn).call(this, packet, options, parsed);
|
|
5465
5495
|
}
|
|
5466
5496
|
onInit(cb) {
|
|
5467
5497
|
__privateSet(this, _initCb, cb);
|
|
@@ -5642,6 +5672,8 @@ var BlockcastMmt = (() => {
|
|
|
5642
5672
|
_reliableMoqStartupGate = new WeakMap();
|
|
5643
5673
|
_disposed = new WeakMap();
|
|
5644
5674
|
_fedObjects = new WeakMap();
|
|
5675
|
+
_reassemblerFragmentsFed = new WeakMap();
|
|
5676
|
+
_reassemblerDataUnitsReturned = new WeakMap();
|
|
5645
5677
|
_feedOutcomes = new WeakMap();
|
|
5646
5678
|
_deferredFeedOutcomes = new WeakMap();
|
|
5647
5679
|
_lastOutcome = new WeakMap();
|
|
@@ -5722,12 +5754,25 @@ var BlockcastMmt = (() => {
|
|
|
5722
5754
|
__privateMethod(this, _MmtpContainerParser_instances, countOutcome_fn).call(this, `drop:${reason}`);
|
|
5723
5755
|
return null;
|
|
5724
5756
|
};
|
|
5725
|
-
|
|
5757
|
+
feedCounted_fn = function(packet, options, parsed) {
|
|
5758
|
+
__privateSet(this, _fedObjects, __privateGet(this, _fedObjects) + 1);
|
|
5759
|
+
let record;
|
|
5760
|
+
try {
|
|
5761
|
+
record = __privateMethod(this, _MmtpContainerParser_instances, feed_fn).call(this, packet, options, parsed);
|
|
5762
|
+
} catch (error) {
|
|
5763
|
+
__privateMethod(this, _MmtpContainerParser_instances, countOutcome_fn).call(this, "drop:threw");
|
|
5764
|
+
throw error;
|
|
5765
|
+
}
|
|
5766
|
+
if (record) __privateMethod(this, _MmtpContainerParser_instances, countOutcome_fn).call(this, record.kind);
|
|
5767
|
+
return record;
|
|
5768
|
+
};
|
|
5769
|
+
feed_fn = function(packet, options, preParsed) {
|
|
5726
5770
|
var _a;
|
|
5727
5771
|
if (__privateGet(this, _disposed)) return __privateMethod(this, _MmtpContainerParser_instances, drop_fn).call(this, "disposed");
|
|
5728
5772
|
this.cleanupTimeouts();
|
|
5729
|
-
const
|
|
5730
|
-
if (!
|
|
5773
|
+
const parsed = preParsed !== void 0 && preParsed.skipFecPayloadId === (options?.skipFecPayloadId === true) ? preParsed : this.parsePacket(packet, options);
|
|
5774
|
+
if (!parsed) return __privateMethod(this, _MmtpContainerParser_instances, drop_fn).call(this, "header-parse-failed");
|
|
5775
|
+
const info = parsed.info;
|
|
5731
5776
|
if (info.packetType !== PACKET_TYPE_MPU2) {
|
|
5732
5777
|
return {
|
|
5733
5778
|
kind: info.isRepair ? "repair" : "non-media",
|
|
@@ -5744,7 +5789,7 @@ var BlockcastMmt = (() => {
|
|
|
5744
5789
|
} catch {
|
|
5745
5790
|
}
|
|
5746
5791
|
}
|
|
5747
|
-
const extraction =
|
|
5792
|
+
const extraction = extractMFUPayloadWithHeader(packet, parsed.header, {
|
|
5748
5793
|
skipFecId: options?.skipFecPayloadId
|
|
5749
5794
|
});
|
|
5750
5795
|
if (!extraction) return __privateMethod(this, _MmtpContainerParser_instances, drop_fn).call(this, "mfu-extract-failed");
|
|
@@ -5830,6 +5875,7 @@ var BlockcastMmt = (() => {
|
|
|
5830
5875
|
}
|
|
5831
5876
|
}
|
|
5832
5877
|
let assembled;
|
|
5878
|
+
__privateWrapper(this, _reassemblerFragmentsFed)._++;
|
|
5833
5879
|
try {
|
|
5834
5880
|
assembled = __privateGet(this, _reassembler).addFragment({
|
|
5835
5881
|
fragmentationIndicator: mpu.fragmentationIndicator,
|
|
@@ -5872,6 +5918,7 @@ var BlockcastMmt = (() => {
|
|
|
5872
5918
|
fragmentCounter: mpu.fragmentCounter
|
|
5873
5919
|
};
|
|
5874
5920
|
}
|
|
5921
|
+
__privateWrapper(this, _reassemblerDataUnitsReturned)._++;
|
|
5875
5922
|
const movieFragmentSequenceNumber = assembled.movieFragmentSequenceNumber;
|
|
5876
5923
|
const sampleNumber = assembled.sampleNumber;
|
|
5877
5924
|
if (movieFragmentSequenceNumber === void 0 || sampleNumber === void 0)
|
|
@@ -6220,7 +6267,7 @@ var BlockcastMmt = (() => {
|
|
|
6220
6267
|
function timestampU32(timestamp) {
|
|
6221
6268
|
return Number(BigInt.asUintN(32, timestamp));
|
|
6222
6269
|
}
|
|
6223
|
-
var _bindings, _core, _now, _timeoutMs2, _cleanupTimer, _nextStreamIdentity, _streamIdentityByKey, _streamNameByIdentity,
|
|
6270
|
+
var _bindings, _core, _now, _timeoutMs2, _cleanupTimer, _nextStreamIdentity, _streamIdentityByKey, _streamNameByIdentity, _offeredFragments, _rejectedFragments, _stats2, _WasmMfuReassembler_instances, refreshStats_fn, streamIdentityFor_fn, asReassemblyError_fn, ensureCleanupArmed_fn, scheduleCleanup_fn, clearCleanupTimer_fn;
|
|
6224
6271
|
var WasmMfuReassembler = class {
|
|
6225
6272
|
constructor(options) {
|
|
6226
6273
|
__privateAdd(this, _WasmMfuReassembler_instances);
|
|
@@ -6232,17 +6279,19 @@ var BlockcastMmt = (() => {
|
|
|
6232
6279
|
__privateAdd(this, _nextStreamIdentity, 1);
|
|
6233
6280
|
__privateAdd(this, _streamIdentityByKey, /* @__PURE__ */ new Map());
|
|
6234
6281
|
__privateAdd(this, _streamNameByIdentity, /* @__PURE__ */ new Map());
|
|
6235
|
-
|
|
6236
|
-
|
|
6282
|
+
// Every fragment handed to the core, including ones it rejected. This is
|
|
6283
|
+
// what `coreTotal + rejectedBeforeCore` computed with a core stats() round
|
|
6284
|
+
// trip before and after every fragment (BLO-36599).
|
|
6285
|
+
__privateAdd(this, _offeredFragments, 0);
|
|
6237
6286
|
__privateAdd(this, _rejectedFragments, 0);
|
|
6238
|
-
this
|
|
6287
|
+
__privateAdd(this, _stats2, {
|
|
6239
6288
|
totalFragments: 0,
|
|
6240
6289
|
reassembledMFUs: 0,
|
|
6241
6290
|
rejectedFragments: 0,
|
|
6242
6291
|
timedOutMFUs: 0,
|
|
6243
6292
|
evictedMemoryLimit: 0,
|
|
6244
6293
|
outOfOrderFragments: 0
|
|
6245
|
-
};
|
|
6294
|
+
});
|
|
6246
6295
|
const maxBuffered = options.maxBuffered ?? 100;
|
|
6247
6296
|
if (!Number.isInteger(maxBuffered) || maxBuffered <= 0) {
|
|
6248
6297
|
throw new Error("[WasmMfuReassembler] maxBuffered must be a positive integer");
|
|
@@ -6255,6 +6304,15 @@ var BlockcastMmt = (() => {
|
|
|
6255
6304
|
get timeoutMs() {
|
|
6256
6305
|
return __privateGet(this, _timeoutMs2);
|
|
6257
6306
|
}
|
|
6307
|
+
/**
|
|
6308
|
+
* Host-observable reassembly statistics, read from the core when asked.
|
|
6309
|
+
* Reading them is a wasm crossing plus six counter getters, so neither
|
|
6310
|
+
* addFragment nor the router's per-packet path refreshes them (BLO-36599).
|
|
6311
|
+
*/
|
|
6312
|
+
get stats() {
|
|
6313
|
+
__privateMethod(this, _WasmMfuReassembler_instances, refreshStats_fn).call(this);
|
|
6314
|
+
return __privateGet(this, _stats2);
|
|
6315
|
+
}
|
|
6258
6316
|
set timeoutMs(timeoutMs) {
|
|
6259
6317
|
if (timeoutMs !== null && (!Number.isFinite(timeoutMs) || timeoutMs <= 0)) {
|
|
6260
6318
|
throw new Error("[WasmMfuReassembler] timeoutMs must be a finite number > 0");
|
|
@@ -6296,22 +6354,18 @@ var BlockcastMmt = (() => {
|
|
|
6296
6354
|
wasmFragment.set_stream_identity(streamIdentity);
|
|
6297
6355
|
}
|
|
6298
6356
|
let output;
|
|
6299
|
-
const coreTotalBefore = __privateGet(this, _coreTotalFragments);
|
|
6300
6357
|
try {
|
|
6301
6358
|
output = __privateGet(this, _core).add_fragment(__privateGet(this, _now).call(this), wasmFragment);
|
|
6302
6359
|
} catch (error) {
|
|
6303
6360
|
const rejection = __privateMethod(this, _WasmMfuReassembler_instances, asReassemblyError_fn).call(this, error);
|
|
6304
6361
|
if (rejection === null) throw error;
|
|
6305
|
-
|
|
6306
|
-
if (__privateGet(this, _coreTotalFragments) === coreTotalBefore) __privateWrapper(this, _rejectedBeforeCore)._++;
|
|
6362
|
+
__privateWrapper(this, _offeredFragments)._++;
|
|
6307
6363
|
__privateWrapper(this, _rejectedFragments)._++;
|
|
6308
|
-
|
|
6309
|
-
this.stats.rejectedFragments = __privateGet(this, _rejectedFragments);
|
|
6310
|
-
__privateMethod(this, _WasmMfuReassembler_instances, scheduleCleanup_fn).call(this);
|
|
6364
|
+
__privateMethod(this, _WasmMfuReassembler_instances, ensureCleanupArmed_fn).call(this);
|
|
6311
6365
|
throw rejection;
|
|
6312
6366
|
}
|
|
6313
|
-
|
|
6314
|
-
__privateMethod(this, _WasmMfuReassembler_instances,
|
|
6367
|
+
__privateWrapper(this, _offeredFragments)._++;
|
|
6368
|
+
__privateMethod(this, _WasmMfuReassembler_instances, ensureCleanupArmed_fn).call(this);
|
|
6315
6369
|
if (!output) return null;
|
|
6316
6370
|
try {
|
|
6317
6371
|
const catalogTrackName = output.stream_identity === void 0 ? void 0 : __privateGet(this, _streamNameByIdentity).get(output.stream_identity);
|
|
@@ -6352,7 +6406,6 @@ var BlockcastMmt = (() => {
|
|
|
6352
6406
|
if (streamIdentity === void 0) return;
|
|
6353
6407
|
__privateMethod(this, _WasmMfuReassembler_instances, clearCleanupTimer_fn).call(this);
|
|
6354
6408
|
__privateGet(this, _core).reset_stream(streamIdentity);
|
|
6355
|
-
__privateMethod(this, _WasmMfuReassembler_instances, refreshStats_fn).call(this);
|
|
6356
6409
|
__privateMethod(this, _WasmMfuReassembler_instances, scheduleCleanup_fn).call(this);
|
|
6357
6410
|
}
|
|
6358
6411
|
reset() {
|
|
@@ -6361,10 +6414,8 @@ var BlockcastMmt = (() => {
|
|
|
6361
6414
|
__privateSet(this, _nextStreamIdentity, 1);
|
|
6362
6415
|
__privateGet(this, _streamIdentityByKey).clear();
|
|
6363
6416
|
__privateGet(this, _streamNameByIdentity).clear();
|
|
6364
|
-
__privateSet(this,
|
|
6365
|
-
__privateSet(this, _rejectedBeforeCore, 0);
|
|
6417
|
+
__privateSet(this, _offeredFragments, 0);
|
|
6366
6418
|
__privateSet(this, _rejectedFragments, 0);
|
|
6367
|
-
__privateMethod(this, _WasmMfuReassembler_instances, refreshStats_fn).call(this);
|
|
6368
6419
|
}
|
|
6369
6420
|
get pendingCount() {
|
|
6370
6421
|
return __privateGet(this, _core).buffered_count;
|
|
@@ -6377,7 +6428,7 @@ var BlockcastMmt = (() => {
|
|
|
6377
6428
|
// Detailed fragment coordinates remain internal to the Rust core. Counts
|
|
6378
6429
|
// and health statistics stay available to MmtpRouter diagnostics.
|
|
6379
6430
|
pendingSamples: [],
|
|
6380
|
-
stats: { ...this
|
|
6431
|
+
stats: { ...__privateGet(this, _stats2) }
|
|
6381
6432
|
};
|
|
6382
6433
|
}
|
|
6383
6434
|
};
|
|
@@ -6389,19 +6440,18 @@ var BlockcastMmt = (() => {
|
|
|
6389
6440
|
_nextStreamIdentity = new WeakMap();
|
|
6390
6441
|
_streamIdentityByKey = new WeakMap();
|
|
6391
6442
|
_streamNameByIdentity = new WeakMap();
|
|
6392
|
-
|
|
6393
|
-
_rejectedBeforeCore = new WeakMap();
|
|
6443
|
+
_offeredFragments = new WeakMap();
|
|
6394
6444
|
_rejectedFragments = new WeakMap();
|
|
6445
|
+
_stats2 = new WeakMap();
|
|
6395
6446
|
_WasmMfuReassembler_instances = new WeakSet();
|
|
6396
6447
|
refreshStats_fn = function() {
|
|
6397
6448
|
const stats = __privateGet(this, _core).stats();
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
this.
|
|
6401
|
-
this.
|
|
6402
|
-
this.stats.
|
|
6403
|
-
this.
|
|
6404
|
-
this.stats.outOfOrderFragments = asNumber(stats.out_of_order_fragments);
|
|
6449
|
+
__privateGet(this, _stats2).totalFragments = __privateGet(this, _offeredFragments);
|
|
6450
|
+
__privateGet(this, _stats2).reassembledMFUs = asNumber(stats.reassembled_mfus);
|
|
6451
|
+
__privateGet(this, _stats2).rejectedFragments = __privateGet(this, _rejectedFragments);
|
|
6452
|
+
__privateGet(this, _stats2).timedOutMFUs = asNumber(stats.timed_out_mfus);
|
|
6453
|
+
__privateGet(this, _stats2).evictedMemoryLimit = asNumber(stats.evicted_memory_limit) + asNumber(stats.evicted_data_units ?? 0);
|
|
6454
|
+
__privateGet(this, _stats2).outOfOrderFragments = asNumber(stats.out_of_order_fragments);
|
|
6405
6455
|
stats.free?.();
|
|
6406
6456
|
};
|
|
6407
6457
|
streamIdentityFor_fn = function(fragment) {
|
|
@@ -6426,6 +6476,18 @@ var BlockcastMmt = (() => {
|
|
|
6426
6476
|
typeof message === "string" ? message : `MFU reassembly rejected: ${code}`
|
|
6427
6477
|
);
|
|
6428
6478
|
};
|
|
6479
|
+
/**
|
|
6480
|
+
* Arm the cleanup wake-up only when none is armed. A fragment can only add
|
|
6481
|
+
* a data unit whose deadline is its own arrival plus the one configured
|
|
6482
|
+
* timeout, which is never earlier than the deadline already armed; the
|
|
6483
|
+
* armed wake-up re-reads the core's next deadline after cleanup. Only a
|
|
6484
|
+
* timeout change can move the next deadline earlier, and the timeoutMs
|
|
6485
|
+
* setter re-arms for that. This replaces a next_timeout_at() crossing and a
|
|
6486
|
+
* clear+set timer pair on every fragment (BLO-36599).
|
|
6487
|
+
*/
|
|
6488
|
+
ensureCleanupArmed_fn = function() {
|
|
6489
|
+
if (__privateGet(this, _cleanupTimer) === null) __privateMethod(this, _WasmMfuReassembler_instances, scheduleCleanup_fn).call(this);
|
|
6490
|
+
};
|
|
6429
6491
|
scheduleCleanup_fn = function() {
|
|
6430
6492
|
__privateMethod(this, _WasmMfuReassembler_instances, clearCleanupTimer_fn).call(this);
|
|
6431
6493
|
if (__privateGet(this, _timeoutMs2) === null) return;
|
|
@@ -6435,7 +6497,6 @@ var BlockcastMmt = (() => {
|
|
|
6435
6497
|
__privateSet(this, _cleanupTimer, setTimeout(() => {
|
|
6436
6498
|
__privateSet(this, _cleanupTimer, null);
|
|
6437
6499
|
__privateGet(this, _core).cleanup_timeouts(__privateGet(this, _now).call(this));
|
|
6438
|
-
__privateMethod(this, _WasmMfuReassembler_instances, refreshStats_fn).call(this);
|
|
6439
6500
|
__privateMethod(this, _WasmMfuReassembler_instances, scheduleCleanup_fn).call(this);
|
|
6440
6501
|
}, delay));
|
|
6441
6502
|
};
|
|
@@ -7185,8 +7246,15 @@ var BlockcastMmt = (() => {
|
|
|
7185
7246
|
catalogError("multicast_track", `${refPath}.name`, `unknown catalog track ${JSON.stringify(name)}`);
|
|
7186
7247
|
}
|
|
7187
7248
|
const packetId = trackRef["packetId"];
|
|
7188
|
-
if (
|
|
7189
|
-
catalogError(
|
|
7249
|
+
if (packetId === MMTP_SIGNALING_PACKET_ID) {
|
|
7250
|
+
catalogError(
|
|
7251
|
+
"multicast_packet_id",
|
|
7252
|
+
`${refPath}.packetId`,
|
|
7253
|
+
`packetId ${packetId} is the MMTP signaling flow and must not be advertised for a track; packetId must be an integer from 1 to ${MMTP_PACKET_ID_MAX}`
|
|
7254
|
+
);
|
|
7255
|
+
}
|
|
7256
|
+
if (!Number.isSafeInteger(packetId) || packetId < 1 || packetId > MMTP_PACKET_ID_MAX) {
|
|
7257
|
+
catalogError("multicast_packet_id", `${refPath}.packetId`, `packetId must be an integer from 1 to ${MMTP_PACKET_ID_MAX}`);
|
|
7190
7258
|
}
|
|
7191
7259
|
const previous = packetIds.get(packetId);
|
|
7192
7260
|
if (previous !== void 0) {
|
|
@@ -7497,6 +7565,7 @@ var BlockcastMmt = (() => {
|
|
|
7497
7565
|
function buildAudioInitSegment(sampleRate, channels, asc, timescale, trackId = 1) {
|
|
7498
7566
|
assertTrackId(trackId, "audio trackId");
|
|
7499
7567
|
const ts = timescale ?? sampleRate;
|
|
7568
|
+
assertTimescale(ts, "audio timescale");
|
|
7500
7569
|
if (!asc) {
|
|
7501
7570
|
const freqTable = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
|
|
7502
7571
|
const fi = freqTable.indexOf(sampleRate);
|
|
@@ -7753,8 +7822,9 @@ var BlockcastMmt = (() => {
|
|
|
7753
7822
|
}
|
|
7754
7823
|
buildAudioInit(sampleRate, channels, asc, timescale) {
|
|
7755
7824
|
const ts = timescale ?? sampleRate;
|
|
7825
|
+
const init = buildAudioInitSegment(sampleRate, channels, asc, ts);
|
|
7756
7826
|
__privateSet(this, _audioTimescale, ts);
|
|
7757
|
-
__privateSet(this, _audioInitSegment,
|
|
7827
|
+
__privateSet(this, _audioInitSegment, init);
|
|
7758
7828
|
}
|
|
7759
7829
|
get videoInitSegment() {
|
|
7760
7830
|
return __privateGet(this, _videoInitSegment);
|
|
@@ -7820,8 +7890,15 @@ var BlockcastMmt = (() => {
|
|
|
7820
7890
|
return encodeMultiSampleSegment(samples, baseDecodeTime, __privateWrapper(this, _videoSeq)._++, trackId);
|
|
7821
7891
|
}
|
|
7822
7892
|
/** Set audio timescale to match the init segment's mdhd timescale.
|
|
7823
|
-
* Call after appending the real encoder init (FT=0 ftyp+moov).
|
|
7893
|
+
* Call after appending the real encoder init (FT=0 ftyp+moov).
|
|
7894
|
+
* Fails closed on a value the mdhd uint32 cannot hold, as the video paths
|
|
7895
|
+
* already do. wrapAudioSample rescales the authored composition offset by
|
|
7896
|
+
* this value, so the two failure modes are both silent: a 0 multiplies
|
|
7897
|
+
* every authored offset to 0 — indistinguishable from a feed that authored
|
|
7898
|
+
* none — while a value above uint32 scales the trun to a timescale the
|
|
7899
|
+
* mdhd cannot declare, since it is emitted with setUint32 modulo 2^32. */
|
|
7824
7900
|
setAudioTimescale(timescale) {
|
|
7901
|
+
assertTimescale(timescale, "audio timescale");
|
|
7825
7902
|
__privateSet(this, _audioTimescale, timescale);
|
|
7826
7903
|
}
|
|
7827
7904
|
/** Convert a raw audio sample to an fMP4 moof+mdat segment. */
|
|
@@ -8482,7 +8559,7 @@ var BlockcastMmt = (() => {
|
|
|
8482
8559
|
return diff === 0;
|
|
8483
8560
|
};
|
|
8484
8561
|
var isPromiseLike = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
|
|
8485
|
-
var _config, _verifySignature, _onFailure, _tracks2,
|
|
8562
|
+
var _config, _verifySignature, _onFailure, _tracks2, _stats3, _disposed2, _ManifestVerifier_instances, requireTrack_fn, group_fn, validateIdentity_fn, admitAgainstEntry_fn, rejectOrShadow_fn, resolvePending_fn, closeGroup_fn, finishGroupSignature_fn, verifyAcceptedSignature_fn, failGroup_fn, removePending_fn, quarantine_fn, enforceCap_fn, giveUpOnPending_fn, failOpenTrack_fn, failOpenGroup_fn, releaseAllQuarantine_fn, failure_fn;
|
|
8486
8563
|
var ManifestVerifier = class {
|
|
8487
8564
|
constructor(options) {
|
|
8488
8565
|
__privateAdd(this, _ManifestVerifier_instances);
|
|
@@ -8490,7 +8567,7 @@ var BlockcastMmt = (() => {
|
|
|
8490
8567
|
__privateAdd(this, _verifySignature);
|
|
8491
8568
|
__privateAdd(this, _onFailure);
|
|
8492
8569
|
__privateAdd(this, _tracks2, /* @__PURE__ */ new Map());
|
|
8493
|
-
__privateAdd(this,
|
|
8570
|
+
__privateAdd(this, _stats3, {
|
|
8494
8571
|
verified: 0,
|
|
8495
8572
|
failures: Object.fromEntries(FAILURE_REASONS.map((reason) => [reason, 0])),
|
|
8496
8573
|
quarantinedBytes: 0
|
|
@@ -8508,10 +8585,10 @@ var BlockcastMmt = (() => {
|
|
|
8508
8585
|
for (const track of __privateGet(this, _tracks2).values())
|
|
8509
8586
|
quarantined += track.quarantine.length;
|
|
8510
8587
|
return {
|
|
8511
|
-
verified: __privateGet(this,
|
|
8512
|
-
failures: { ...__privateGet(this,
|
|
8588
|
+
verified: __privateGet(this, _stats3).verified,
|
|
8589
|
+
failures: { ...__privateGet(this, _stats3).failures },
|
|
8513
8590
|
quarantined,
|
|
8514
|
-
quarantinedBytes: __privateGet(this,
|
|
8591
|
+
quarantinedBytes: __privateGet(this, _stats3).quarantinedBytes
|
|
8515
8592
|
};
|
|
8516
8593
|
}
|
|
8517
8594
|
setMode(mode) {
|
|
@@ -8646,7 +8723,7 @@ var BlockcastMmt = (() => {
|
|
|
8646
8723
|
_verifySignature = new WeakMap();
|
|
8647
8724
|
_onFailure = new WeakMap();
|
|
8648
8725
|
_tracks2 = new WeakMap();
|
|
8649
|
-
|
|
8726
|
+
_stats3 = new WeakMap();
|
|
8650
8727
|
_disposed2 = new WeakMap();
|
|
8651
8728
|
_ManifestVerifier_instances = new WeakSet();
|
|
8652
8729
|
requireTrack_fn = function(bindingId) {
|
|
@@ -8698,7 +8775,7 @@ var BlockcastMmt = (() => {
|
|
|
8698
8775
|
return { action: "stall", verified: false };
|
|
8699
8776
|
}
|
|
8700
8777
|
release();
|
|
8701
|
-
__privateGet(this,
|
|
8778
|
+
__privateGet(this, _stats3).verified++;
|
|
8702
8779
|
return { action: "play", verified: true };
|
|
8703
8780
|
};
|
|
8704
8781
|
rejectOrShadow_fn = function(identity, release, reason) {
|
|
@@ -8838,7 +8915,7 @@ var BlockcastMmt = (() => {
|
|
|
8838
8915
|
if (index >= 0)
|
|
8839
8916
|
track.quarantine.splice(index, 1);
|
|
8840
8917
|
track.quarantinedBytes -= pending.bytes;
|
|
8841
|
-
__privateGet(this,
|
|
8918
|
+
__privateGet(this, _stats3).quarantinedBytes -= pending.bytes;
|
|
8842
8919
|
};
|
|
8843
8920
|
quarantine_fn = function(track, group, pending) {
|
|
8844
8921
|
if (group.pending.has(pending.identity.objectId))
|
|
@@ -8846,7 +8923,7 @@ var BlockcastMmt = (() => {
|
|
|
8846
8923
|
group.pending.set(pending.identity.objectId, pending);
|
|
8847
8924
|
track.quarantine.push(pending);
|
|
8848
8925
|
track.quarantinedBytes += pending.bytes;
|
|
8849
|
-
__privateGet(this,
|
|
8926
|
+
__privateGet(this, _stats3).quarantinedBytes += pending.bytes;
|
|
8850
8927
|
__privateMethod(this, _ManifestVerifier_instances, enforceCap_fn).call(this, track);
|
|
8851
8928
|
return true;
|
|
8852
8929
|
};
|
|
@@ -8857,7 +8934,7 @@ var BlockcastMmt = (() => {
|
|
|
8857
8934
|
if (group)
|
|
8858
8935
|
group.pending.delete(pending.identity.objectId);
|
|
8859
8936
|
track.quarantinedBytes -= pending.bytes;
|
|
8860
|
-
__privateGet(this,
|
|
8937
|
+
__privateGet(this, _stats3).quarantinedBytes -= pending.bytes;
|
|
8861
8938
|
__privateMethod(this, _ManifestVerifier_instances, giveUpOnPending_fn).call(this, pending);
|
|
8862
8939
|
__privateMethod(this, _ManifestVerifier_instances, failure_fn).call(this, pending.identity, "manifestAbsent");
|
|
8863
8940
|
console.warn(`[ManifestVerifier] quarantine cap eviction track=${pending.identity.trackName} group=${pending.identity.groupId} object=${pending.identity.objectId} disposition=${__privateGet(this, _config).mode === "enforce" ? "drop" : "fail-open"}`);
|
|
@@ -8914,7 +8991,7 @@ var BlockcastMmt = (() => {
|
|
|
8914
8991
|
};
|
|
8915
8992
|
failure_fn = function(identity, reason) {
|
|
8916
8993
|
var _a;
|
|
8917
|
-
__privateGet(this,
|
|
8994
|
+
__privateGet(this, _stats3).failures[reason]++;
|
|
8918
8995
|
(_a = __privateGet(this, _onFailure)) == null ? void 0 : _a.call(this, {
|
|
8919
8996
|
trackName: identity.trackName,
|
|
8920
8997
|
...identity.bindingId === void 0 ? {} : { bindingId: identity.bindingId },
|