@blockcast/mmt-container 2.2.0-main.4a79a288e69e → 2.2.0-main.4ccba0f2f32a
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/browser-runtime.js +1119 -165
- package/dist/browser-runtime.js.map +3 -3
- package/dist/delta-fallback-config.js.map +1 -1
- package/dist/fec-manager.d.ts +67 -11
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +377 -54
- package/dist/fec-manager.js.map +2 -2
- package/dist/fec-worker-setup.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +48 -13
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +97 -25
- package/dist/iso-block-locator.js.map +2 -2
- package/dist/media-router.js.map +1 -1
- package/dist/mmtp-container-parser.d.ts +64 -8
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +159 -21
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +158 -23
- package/dist/mmtp-container-parser.no-modules.js.map +2 -2
- package/dist/mmtp-decode-pipeline.js +158 -21
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-router.d.ts +31 -8
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +481 -68
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-manager.d.ts +26 -3
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +940 -139
- package/dist/multicast-manager.js.map +2 -2
- package/dist/multicast-transport.js +2 -2
- package/dist/multicast-transport.js.map +2 -2
- package/dist/no-modules.js +158 -21
- package/dist/no-modules.js.map +2 -2
- package/dist/repair-fetch.d.ts +36 -8
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +285 -26
- package/dist/repair-fetch.js.map +3 -3
- package/dist/track-session.d.ts.map +1 -1
- package/dist/track-session.js +1 -0
- package/dist/track-session.js.map +2 -2
- package/dist/wasm-mmtp-container-parser.js +158 -21
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +5 -5
- package/src/fec-manager.ts +407 -28
- package/src/index.ts +3 -0
- package/src/iso-block-locator.ts +133 -31
- package/src/mmtp-container-parser.ts +273 -26
- package/src/mmtp-router.ts +541 -55
- package/src/multicast-manager.ts +118 -14
- package/src/repair-fetch.ts +363 -49
- package/src/track-session.ts +3 -0
package/dist/mmtp-router.js
CHANGED
|
@@ -8023,6 +8023,9 @@ function authoredGap(before, after) {
|
|
|
8023
8023
|
function ssIdAfter(a, b) {
|
|
8024
8024
|
return (a - b | 0) > 0;
|
|
8025
8025
|
}
|
|
8026
|
+
function holdsRebuilt(stream) {
|
|
8027
|
+
return stream.buf.some(({ meta }) => meta.fecSbnFirst !== void 0);
|
|
8028
|
+
}
|
|
8026
8029
|
var FecReleaseSequencer = class {
|
|
8027
8030
|
#streams = /* @__PURE__ */ new Map();
|
|
8028
8031
|
#gate;
|
|
@@ -8085,6 +8088,7 @@ var FecReleaseSequencer = class {
|
|
|
8085
8088
|
stream.lastSbn = void 0;
|
|
8086
8089
|
stream.discontinuity = false;
|
|
8087
8090
|
stream.rapSsId = void 0;
|
|
8091
|
+
stream.sourced = false;
|
|
8088
8092
|
}
|
|
8089
8093
|
if (stream.last !== null && compareFrameOrder(frame, stream.last) <= 0) {
|
|
8090
8094
|
this.#recordStat("droppedStale");
|
|
@@ -8111,6 +8115,7 @@ var FecReleaseSequencer = class {
|
|
|
8111
8115
|
if (compareFrameOrder(stream.buf[mid], frame) < 0) lo = mid + 1;
|
|
8112
8116
|
else hi = mid;
|
|
8113
8117
|
}
|
|
8118
|
+
if (stream.buf[lo]?.passed === true) frame.passed = true;
|
|
8114
8119
|
stream.buf.splice(lo, 0, frame);
|
|
8115
8120
|
this.#drainUnlessDeferred(stream);
|
|
8116
8121
|
}
|
|
@@ -8146,6 +8151,41 @@ var FecReleaseSequencer = class {
|
|
|
8146
8151
|
}
|
|
8147
8152
|
return false;
|
|
8148
8153
|
}
|
|
8154
|
+
/**
|
|
8155
|
+
* These streams' sink is being replaced by one that has seen no source
|
|
8156
|
+
* frame yet. First, from a stream that holds a frame the overlay rebuilt,
|
|
8157
|
+
* release to the sink being replaced the frames the unanchored path had
|
|
8158
|
+
* already released to it (#cursorPassed): there they waited in its queue,
|
|
8159
|
+
* which its replacement flushes. A stream that holds none is not drained:
|
|
8160
|
+
* it holds nothing the anchor kept back, and a drain would still force out
|
|
8161
|
+
* a frame held past the hold limit, which before the anchor waited for the
|
|
8162
|
+
* next push. Then treat the streams as unsourced until a source frame is
|
|
8163
|
+
* released.
|
|
8164
|
+
*/
|
|
8165
|
+
unsource(packetId, catalogTrackName) {
|
|
8166
|
+
for (const stream of this.#streams.values()) {
|
|
8167
|
+
if (stream.packetId === packetId && (catalogTrackName === void 0 || stream.catalogTrackName === catalogTrackName)) {
|
|
8168
|
+
if (stream.draining === 0 && holdsRebuilt(stream)) {
|
|
8169
|
+
if (this.#deferDepth > 0) this.#deferredStreams.add(stream);
|
|
8170
|
+
else this.#drain(stream, true);
|
|
8171
|
+
}
|
|
8172
|
+
stream.sourced = false;
|
|
8173
|
+
}
|
|
8174
|
+
}
|
|
8175
|
+
}
|
|
8176
|
+
/**
|
|
8177
|
+
* Whether a stream of `packetId` holds a frame the keyframe overlay rebuilt
|
|
8178
|
+
* (FrameMeta.fecSbnFirst). Without `catalogTrackName`, every stream of the
|
|
8179
|
+
* packetId.
|
|
8180
|
+
*/
|
|
8181
|
+
holdsRebuilt(packetId, catalogTrackName) {
|
|
8182
|
+
for (const stream of this.#streams.values()) {
|
|
8183
|
+
if (stream.packetId !== packetId) continue;
|
|
8184
|
+
if (catalogTrackName !== void 0 && stream.catalogTrackName !== catalogTrackName) continue;
|
|
8185
|
+
if (holdsRebuilt(stream)) return true;
|
|
8186
|
+
}
|
|
8187
|
+
return false;
|
|
8188
|
+
}
|
|
8149
8189
|
/** Re-evaluate held gaps after FEC state changed. */
|
|
8150
8190
|
poke(streamKey) {
|
|
8151
8191
|
if (streamKey !== void 0) {
|
|
@@ -8237,16 +8277,32 @@ var FecReleaseSequencer = class {
|
|
|
8237
8277
|
last: null,
|
|
8238
8278
|
lastSbn: void 0,
|
|
8239
8279
|
discontinuity: false,
|
|
8240
|
-
rapSsId: void 0
|
|
8280
|
+
rapSsId: void 0,
|
|
8281
|
+
sourced: false,
|
|
8282
|
+
draining: 0
|
|
8241
8283
|
};
|
|
8242
8284
|
this.#streams.set(streamKey, stream);
|
|
8243
8285
|
}
|
|
8244
8286
|
return stream;
|
|
8245
8287
|
}
|
|
8246
|
-
#
|
|
8288
|
+
/** `asUnanchored`: release overlay-rebuilt frames when unanchored did (#cursorPassed). */
|
|
8289
|
+
#drain(stream, asUnanchored = false) {
|
|
8290
|
+
stream.draining++;
|
|
8291
|
+
try {
|
|
8292
|
+
this.#drainLoop(stream, asUnanchored);
|
|
8293
|
+
} finally {
|
|
8294
|
+
stream.draining--;
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8297
|
+
#drainLoop(stream, asUnanchored) {
|
|
8247
8298
|
while (stream.buf.length > 0 && stream.last !== null) {
|
|
8248
8299
|
const head = stream.buf[0];
|
|
8249
8300
|
const last = stream.last;
|
|
8301
|
+
if (compareFrameOrder(head, last) <= 0) {
|
|
8302
|
+
stream.buf.shift();
|
|
8303
|
+
this.#release(stream, head, void 0);
|
|
8304
|
+
continue;
|
|
8305
|
+
}
|
|
8250
8306
|
if (stream.discontinuity) {
|
|
8251
8307
|
stream.discontinuity = false;
|
|
8252
8308
|
stream.buf.shift();
|
|
@@ -8260,9 +8316,10 @@ var FecReleaseSequencer = class {
|
|
|
8260
8316
|
}
|
|
8261
8317
|
const headSbn = head.meta.fecSbn;
|
|
8262
8318
|
const from = stream.lastSbn ?? headSbn;
|
|
8263
|
-
const to = headSbn ?? stream.lastSbn;
|
|
8319
|
+
const to = head.meta.fecSbnFirst ?? headSbn ?? stream.lastSbn;
|
|
8264
8320
|
let lost = [];
|
|
8265
8321
|
const unanchored = from === void 0 && to === void 0;
|
|
8322
|
+
let unresolved = false;
|
|
8266
8323
|
if (from !== void 0 && to !== void 0) {
|
|
8267
8324
|
const resolved = this.#gate.resolvedLoss(
|
|
8268
8325
|
stream.packetId,
|
|
@@ -8271,7 +8328,8 @@ var FecReleaseSequencer = class {
|
|
|
8271
8328
|
Math.max(from, to),
|
|
8272
8329
|
from
|
|
8273
8330
|
);
|
|
8274
|
-
|
|
8331
|
+
unresolved = resolved === null;
|
|
8332
|
+
if (unresolved && !this.#cursorPassed(stream, asUnanchored)) {
|
|
8275
8333
|
const heldMs = performance.now() - head.arrivedAtMs;
|
|
8276
8334
|
if (heldMs <= this.#gate.holdLimitMs(stream.packetId, stream.catalogTrackName)) return;
|
|
8277
8335
|
this.#recordStat("forcedWindowFlushes");
|
|
@@ -8279,22 +8337,56 @@ var FecReleaseSequencer = class {
|
|
|
8279
8337
|
this.#release(stream, head, this.#gate.decide(last, head, [], true));
|
|
8280
8338
|
continue;
|
|
8281
8339
|
}
|
|
8282
|
-
lost = resolved;
|
|
8340
|
+
lost = resolved ?? [];
|
|
8283
8341
|
}
|
|
8284
8342
|
stream.buf.shift();
|
|
8285
8343
|
this.#release(
|
|
8286
8344
|
stream,
|
|
8287
8345
|
head,
|
|
8288
|
-
lost.length > 0 || unanchored || authoredGap(last.meta, head.meta) ? this.#gate.decide(last, head, lost, false) : void 0
|
|
8346
|
+
lost.length > 0 || unanchored || unresolved || authoredGap(last.meta, head.meta) ? this.#gate.decide(last, head, lost, false) : void 0
|
|
8289
8347
|
);
|
|
8290
8348
|
}
|
|
8291
8349
|
}
|
|
8350
|
+
/**
|
|
8351
|
+
* An overlay-rebuilt frame (fecSbnFirst) waits no longer than the BLO-53342
|
|
8352
|
+
* source cursor holds it unanchored, and neither does a later frame behind
|
|
8353
|
+
* it. Unanchored, a frame that waits on no block (fecSbnFirst set, or no
|
|
8354
|
+
* fecSbn) left the gate once every frame ahead of it had: mark it `passed`,
|
|
8355
|
+
* like each frame that arrived in front of it since (stale there). The head
|
|
8356
|
+
* then goes, decided as it would be unanchored, once a frame the base path
|
|
8357
|
+
* delivered (a source frame, or one base FEC recovered) is buffered after a
|
|
8358
|
+
* marked one: the base path has passed that one, so a frame still missing
|
|
8359
|
+
* before it can only come from a repair. It also goes while no source frame
|
|
8360
|
+
* has been released, when the direct path shows a recovered frame at once.
|
|
8361
|
+
* And it goes at once while a staged switch decides on when frames arrive
|
|
8362
|
+
* (FecReleaseGate.releaseUnanchored), and when unsource releases into a
|
|
8363
|
+
* sink being replaced: unanchored, it had already reached the sink.
|
|
8364
|
+
* The scan also writes: the `passed` marks it sets stay on the frames,
|
|
8365
|
+
* and push marks a frame it inserts in front of a marked one from them.
|
|
8366
|
+
*/
|
|
8367
|
+
#cursorPassed(stream, asUnanchored) {
|
|
8368
|
+
let at = -1;
|
|
8369
|
+
for (let i = 0; i < stream.buf.length; i++) {
|
|
8370
|
+
const frame = stream.buf[i];
|
|
8371
|
+
if (frame.meta.fecSbnFirst !== void 0 || frame.meta.fecSbn === void 0) {
|
|
8372
|
+
frame.passed = true;
|
|
8373
|
+
if (at < 0) at = i;
|
|
8374
|
+
} else if (frame.passed !== true) break;
|
|
8375
|
+
}
|
|
8376
|
+
if (at < 0) return false;
|
|
8377
|
+
return asUnanchored || !stream.sourced || this.#gate.releaseUnanchored?.(stream.packetId, stream.catalogTrackName) === true || stream.buf.some(({ meta }, i) => i > at && meta.fecSbnFirst === void 0 && (meta.recovered !== true || meta.fecSbn !== void 0));
|
|
8378
|
+
}
|
|
8292
8379
|
#release(stream, frame, decision) {
|
|
8380
|
+
const stale = stream.last !== null && compareFrameOrder(frame, stream.last) <= 0;
|
|
8381
|
+
if (stale) this.#recordStat("droppedStale");
|
|
8293
8382
|
if (decision) frame.meta.gapBefore = decision;
|
|
8294
8383
|
stream.last = frame;
|
|
8295
|
-
if (frame.meta.fecSbn !== void 0
|
|
8384
|
+
if (frame.meta.fecSbn !== void 0 && (frame.meta.fecSbnFirst === void 0 || stream.lastSbn !== void 0)) {
|
|
8385
|
+
stream.lastSbn = frame.meta.fecSbn;
|
|
8386
|
+
}
|
|
8387
|
+
if (frame.meta.recovered !== true) stream.sourced = true;
|
|
8296
8388
|
this.#gate.onReleased?.(frame.data, frame.meta);
|
|
8297
|
-
this.#emit(frame.data, frame.meta);
|
|
8389
|
+
if (!stale) this.#emit(frame.data, frame.meta);
|
|
8298
8390
|
}
|
|
8299
8391
|
};
|
|
8300
8392
|
var FMPU_BOX_TYPES = /* @__PURE__ */ new Set(["ftyp", "moov", "moof"]);
|
|
@@ -8335,6 +8427,12 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8335
8427
|
this.#reclaimedTimingSamples = 0;
|
|
8336
8428
|
this.#evictedTimingSamples = 0;
|
|
8337
8429
|
this.#rejectedMovieFragments = 0;
|
|
8430
|
+
this.#recoveredHeadsAwaitingTiming = {
|
|
8431
|
+
held: 0,
|
|
8432
|
+
expired: 0,
|
|
8433
|
+
discarded: 0,
|
|
8434
|
+
superseded: 0
|
|
8435
|
+
};
|
|
8338
8436
|
this.#sequencers = /* @__PURE__ */ new Map();
|
|
8339
8437
|
this.#fecGate = null;
|
|
8340
8438
|
this.#fecSequencer = null;
|
|
@@ -8443,6 +8541,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8443
8541
|
#reclaimedTimingSamples;
|
|
8444
8542
|
#evictedTimingSamples;
|
|
8445
8543
|
#rejectedMovieFragments;
|
|
8544
|
+
#recoveredHeadsAwaitingTiming;
|
|
8446
8545
|
#sequencers;
|
|
8447
8546
|
#fecGate;
|
|
8448
8547
|
#fecSequencer;
|
|
@@ -8548,11 +8647,12 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8548
8647
|
/**
|
|
8549
8648
|
* Typed view of the ISO-BMFF timing-sample budget.
|
|
8550
8649
|
*
|
|
8551
|
-
*
|
|
8552
|
-
*
|
|
8553
|
-
*
|
|
8554
|
-
*
|
|
8555
|
-
*
|
|
8650
|
+
* Each stream admits timing against its own window of `capacity` slots
|
|
8651
|
+
* (BLO-52085). A stream at capacity displaces its own oldest timing to
|
|
8652
|
+
* admit the moof in hand, and `evicted` counts the slots so displaced:
|
|
8653
|
+
* timing a stream declared and never delivered shows up there. `pending`
|
|
8654
|
+
* sums every stream, so it can exceed `capacity`. Per repo policy this is
|
|
8655
|
+
* a producer-owned counter -- never infer budget state by parsing logs.
|
|
8556
8656
|
*/
|
|
8557
8657
|
get timingBudgetStats() {
|
|
8558
8658
|
return {
|
|
@@ -8563,6 +8663,14 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8563
8663
|
rejectedMovieFragments: this.#rejectedMovieFragments
|
|
8564
8664
|
};
|
|
8565
8665
|
}
|
|
8666
|
+
/** Recovered heads parked for FT=1 timing (BLO-53369). Survives dispose(). */
|
|
8667
|
+
get recoveredHeadsAwaitingTiming() {
|
|
8668
|
+
let pending = 0;
|
|
8669
|
+
for (const { awaitingTiming } of this.#timingStreams.values()) {
|
|
8670
|
+
for (const head of awaitingTiming) if (head.options?.recovered) pending++;
|
|
8671
|
+
}
|
|
8672
|
+
return { ...this.#recoveredHeadsAwaitingTiming, pending };
|
|
8673
|
+
}
|
|
8566
8674
|
get reorderStats() {
|
|
8567
8675
|
let bufferedFrames = this.#fecSequencer?.buffered ?? 0;
|
|
8568
8676
|
for (const { sequencer } of this.#sequencers.values()) bufferedFrames += sequencer.buffered;
|
|
@@ -8604,6 +8712,14 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8604
8712
|
fecReleaseRapAbove(packetId, catalogTrackName, ssId) {
|
|
8605
8713
|
return this.#fecSequencer?.rapAbove(packetId, catalogTrackName, ssId) ?? false;
|
|
8606
8714
|
}
|
|
8715
|
+
/** See FecReleaseSequencer.unsource. */
|
|
8716
|
+
unsourceFecRelease(packetId, catalogTrackName) {
|
|
8717
|
+
this.#fecSequencer?.unsource(packetId, catalogTrackName);
|
|
8718
|
+
}
|
|
8719
|
+
/** See FecReleaseSequencer.holdsRebuilt. */
|
|
8720
|
+
fecReleaseHoldsRebuilt(packetId, catalogTrackName) {
|
|
8721
|
+
return this.#fecSequencer?.holdsRebuilt(packetId, catalogTrackName) ?? false;
|
|
8722
|
+
}
|
|
8607
8723
|
/** Re-evaluate held gaps after FEC block state changed. */
|
|
8608
8724
|
pokeFecRelease(packetId, catalogTrackName) {
|
|
8609
8725
|
if (!this.#fecSequencer) return;
|
|
@@ -8736,7 +8852,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8736
8852
|
const now = Date.now();
|
|
8737
8853
|
for (const { awaitingTiming } of this.#timingStreams.values()) {
|
|
8738
8854
|
while (awaitingTiming.length > 0 && now - awaitingTiming[0].arrivedAt > timeoutMs) {
|
|
8739
|
-
awaitingTiming.shift();
|
|
8855
|
+
this.#leaveAwaitingTiming(awaitingTiming.shift(), "expired");
|
|
8740
8856
|
}
|
|
8741
8857
|
}
|
|
8742
8858
|
}
|
|
@@ -8857,7 +8973,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8857
8973
|
if (!resolver2?.initialized) return this.#drop("fragment-no-resolver");
|
|
8858
8974
|
const pendingBefore = resolver2.pendingSampleCount;
|
|
8859
8975
|
const evictedBefore = resolver2.evictedSampleCount;
|
|
8860
|
-
const remaining = this.#maxPendingTimingSamples -
|
|
8976
|
+
const remaining = this.#maxPendingTimingSamples - resolver2.pendingSampleCount;
|
|
8861
8977
|
const admitted = resolver2.addMovieFragment(
|
|
8862
8978
|
mpu.mpuSequenceNumber,
|
|
8863
8979
|
data,
|
|
@@ -8904,6 +9020,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8904
9020
|
mpuSequenceNumber: mpu.mpuSequenceNumber,
|
|
8905
9021
|
movieFragmentSequenceNumber: mfuDuHeader.movieFragmentSequenceNumber,
|
|
8906
9022
|
sampleNumber: mfuDuHeader.sampleNumber,
|
|
9023
|
+
sequenceNumber: info.sequenceNumber,
|
|
8907
9024
|
arrivedAt: Date.now()
|
|
8908
9025
|
});
|
|
8909
9026
|
return this.#drop("mfu-sample-timing-missing");
|
|
@@ -8929,7 +9046,8 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
8929
9046
|
info,
|
|
8930
9047
|
resolver,
|
|
8931
9048
|
options?.recovered === true,
|
|
8932
|
-
options?.fecSbn
|
|
9049
|
+
options?.fecSbn,
|
|
9050
|
+
options?.fecSbnFirst
|
|
8933
9051
|
);
|
|
8934
9052
|
if (deferred.record === void 0) this.#countDeferredOutcome(deferred.reason);
|
|
8935
9053
|
}
|
|
@@ -9022,7 +9140,8 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
9022
9140
|
info,
|
|
9023
9141
|
resolver,
|
|
9024
9142
|
options?.recovered === true,
|
|
9025
|
-
options?.fecSbn
|
|
9143
|
+
options?.fecSbn,
|
|
9144
|
+
options?.fecSbnFirst
|
|
9026
9145
|
);
|
|
9027
9146
|
if (outcome.record !== void 0) return outcome.record;
|
|
9028
9147
|
return this.#drop(outcome.reason);
|
|
@@ -9042,7 +9161,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
9042
9161
|
* attribution exists to keep readable. Leaving the choice at the call site
|
|
9043
9162
|
* is what keeps both true.
|
|
9044
9163
|
*/
|
|
9045
|
-
#emitCombinedSample(combined, info, resolver, recovered, fecSbn) {
|
|
9164
|
+
#emitCombinedSample(combined, info, resolver, recovered, fecSbn, fecSbnFirst) {
|
|
9046
9165
|
const timing = resolver.sampleTiming(
|
|
9047
9166
|
combined.mpuSequenceNumber,
|
|
9048
9167
|
combined.movieFragmentSequenceNumber,
|
|
@@ -9059,6 +9178,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
9059
9178
|
);
|
|
9060
9179
|
if (!meta) return { reason: "combined-meta-build-failed" };
|
|
9061
9180
|
if (fecSbn !== void 0) meta.fecSbn = fecSbn;
|
|
9181
|
+
if (fecSbnFirst !== void 0) meta.fecSbnFirst = fecSbnFirst;
|
|
9062
9182
|
if (!resolver.consumeSample(
|
|
9063
9183
|
combined.mpuSequenceNumber,
|
|
9064
9184
|
combined.movieFragmentSequenceNumber,
|
|
@@ -9292,6 +9412,9 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
9292
9412
|
for (const { sequencer } of this.#sequencers.values()) sequencer.discard();
|
|
9293
9413
|
this.#sequencers.clear();
|
|
9294
9414
|
this.#fecSequencer?.discard();
|
|
9415
|
+
for (const { awaitingTiming } of this.#timingStreams.values()) {
|
|
9416
|
+
for (const head of awaitingTiming) this.#leaveAwaitingTiming(head, "discarded");
|
|
9417
|
+
}
|
|
9295
9418
|
this.#timingStreams.clear();
|
|
9296
9419
|
this.#pendingTimingSamples = 0;
|
|
9297
9420
|
this.#reliableMoqStartupGate.clear();
|
|
@@ -9310,10 +9433,23 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
9310
9433
|
return resolver;
|
|
9311
9434
|
}
|
|
9312
9435
|
#awaitTiming(streamKey, head) {
|
|
9313
|
-
const
|
|
9314
|
-
if (!
|
|
9436
|
+
const state = this.#timingStreams.get(streamKey);
|
|
9437
|
+
if (!state) return;
|
|
9438
|
+
if (!head.options?.recovered) {
|
|
9439
|
+
const kept = state.awaitingTiming.filter((queued) => !queued.options?.recovered || queued.sequenceNumber !== head.sequenceNumber);
|
|
9440
|
+
this.#recoveredHeadsAwaitingTiming.superseded += state.awaitingTiming.length - kept.length;
|
|
9441
|
+
state.awaitingTiming = kept;
|
|
9442
|
+
}
|
|
9443
|
+
const awaitingTiming = state.awaitingTiming;
|
|
9315
9444
|
awaitingTiming.push(head);
|
|
9316
|
-
if (
|
|
9445
|
+
if (head.options?.recovered) this.#recoveredHeadsAwaitingTiming.held++;
|
|
9446
|
+
if (awaitingTiming.length > MAX_AWAITING_TIMING_HEADS) {
|
|
9447
|
+
this.#leaveAwaitingTiming(awaitingTiming.shift(), "expired");
|
|
9448
|
+
}
|
|
9449
|
+
}
|
|
9450
|
+
/** Count a recovered head leaving the queue other than by replay or its source copy. */
|
|
9451
|
+
#leaveAwaitingTiming(head, outcome) {
|
|
9452
|
+
if (head.options?.recovered) this.#recoveredHeadsAwaitingTiming[outcome]++;
|
|
9317
9453
|
}
|
|
9318
9454
|
/**
|
|
9319
9455
|
* Feed again the heads whose timing the FT=1 just admitted declares. That
|
|
@@ -9341,6 +9477,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
9341
9477
|
const state = this.#timingStreams.get(streamKey);
|
|
9342
9478
|
if (!state) return;
|
|
9343
9479
|
this.#timingStreams.delete(streamKey);
|
|
9480
|
+
for (const head of state.awaitingTiming) this.#leaveAwaitingTiming(head, "discarded");
|
|
9344
9481
|
this.#pendingTimingSamples -= state.resolver.pendingSampleCount;
|
|
9345
9482
|
if (this.#pendingTimingSamples < 0) {
|
|
9346
9483
|
throw new Error("[MmtpContainerParser] pending timing sample accounting underflow");
|
|
@@ -9881,7 +10018,18 @@ function keyframeOverlaySsId(header) {
|
|
|
9881
10018
|
if (ext?.type !== KEYFRAME_OVERLAY_EXTENSION_TYPE || ext.data.length !== 4) return void 0;
|
|
9882
10019
|
return new DataView(ext.data.buffer, ext.data.byteOffset, 4).getUint32(0);
|
|
9883
10020
|
}
|
|
10021
|
+
function overlayBaseSsId(anchor, overlaySsId, restoredPsn, headerPsn) {
|
|
10022
|
+
if (anchor.baseSsId === void 0 || headerPsn !== restoredPsn) return void 0;
|
|
10023
|
+
return serial32Add(anchor.baseSsId, overlaySsId - anchor.overlaySsId | 0);
|
|
10024
|
+
}
|
|
10025
|
+
function unstampedBaseSsId(offset, unstampedOffset, headerPsn) {
|
|
10026
|
+
if (offset === void 0 || offset !== unstampedOffset) return void 0;
|
|
10027
|
+
return headerPsn + offset >>> 0;
|
|
10028
|
+
}
|
|
10029
|
+
var OVERLAY_ROUTED_LIMIT = 1024;
|
|
10030
|
+
var OVERLAY_PENDING_LIMIT = 256;
|
|
9884
10031
|
var OVERLAY_OFFSET_MPUS = 16;
|
|
10032
|
+
var OVERLAY_REBUILT_LIMIT = 256;
|
|
9885
10033
|
var OVERLAY_MOQ_HORIZON_BLOCKS = 64;
|
|
9886
10034
|
function assertStreamIdentity(role, stream) {
|
|
9887
10035
|
if (stream === void 0 || !Number.isInteger(stream.packetId) || stream.packetId <= MMTP_SIGNALING_PACKET_ID || typeof stream.catalogTrackName !== "string" || stream.catalogTrackName.length === 0) {
|
|
@@ -9992,6 +10140,7 @@ var MmtpRouter = class {
|
|
|
9992
10140
|
#provenance = /* @__PURE__ */ new Map();
|
|
9993
10141
|
#onFlowProtected = null;
|
|
9994
10142
|
#unadmittedListedDrops = 0;
|
|
10143
|
+
#admittedSourceDatagrams = 0;
|
|
9995
10144
|
#unlistedRepairSetAside = 0;
|
|
9996
10145
|
#assistBlocks = /* @__PURE__ */ new Map();
|
|
9997
10146
|
#assistFailures = /* @__PURE__ */ new Map();
|
|
@@ -10048,6 +10197,26 @@ var MmtpRouter = class {
|
|
|
10048
10197
|
* sequence is its SS_ID minus this; see #routeProcessedFecSymbols.
|
|
10049
10198
|
*/
|
|
10050
10199
|
#ssIdSeqOffsetByStream = /* @__PURE__ */ new Map();
|
|
10200
|
+
/**
|
|
10201
|
+
* Per stream, the SS_ID offset at which a base recovery last showed the
|
|
10202
|
+
* sender's own packet_sequence_number: a recovered packet's header psn
|
|
10203
|
+
* equal to its SS_ID minus that offset. While it equals the stream's
|
|
10204
|
+
* current offset, no hop re-stamps the stream, and a packet's protected psn
|
|
10205
|
+
* names its base SS_ID within unstampedBaseSsId's limits (joint decoding of
|
|
10206
|
+
* an MPU no member of which arrived).
|
|
10207
|
+
*/
|
|
10208
|
+
#unstampedSsIdSeqOffsetByStream = /* @__PURE__ */ new Map();
|
|
10209
|
+
/**
|
|
10210
|
+
* The same, shown by the overlay alone, before any base recovery did: a
|
|
10211
|
+
* packet it rebuilt whose base copy carries its protected psn
|
|
10212
|
+
* (#feedOverlaySource), or whose protected psn passes overlayBaseSsId's
|
|
10213
|
+
* test at that offset (#routeOverlayRecovered). A base SS_ID placed by it
|
|
10214
|
+
* anchors the release gate only (BLO-52085 D3): fed to the base, it would
|
|
10215
|
+
* make the base drop a late base copy of a keyframe the overlay never
|
|
10216
|
+
* finished, and lift a block's late-source cut, which nothing before
|
|
10217
|
+
* this offset did.
|
|
10218
|
+
*/
|
|
10219
|
+
#overlayUnstampedSsIdSeqOffsetByStream = /* @__PURE__ */ new Map();
|
|
10051
10220
|
/**
|
|
10052
10221
|
* Streams whose multicast leg delivered a RAP-flagged source packet that was
|
|
10053
10222
|
* not parsed, typically because its overlap copy was parsed first
|
|
@@ -10117,7 +10286,9 @@ var MmtpRouter = class {
|
|
|
10117
10286
|
recovered: 0,
|
|
10118
10287
|
restarts: 0,
|
|
10119
10288
|
unsequencedDropped: 0,
|
|
10120
|
-
protectedDropped: 0
|
|
10289
|
+
protectedDropped: 0,
|
|
10290
|
+
baseFed: 0,
|
|
10291
|
+
baseUndetermined: 0
|
|
10121
10292
|
};
|
|
10122
10293
|
/** Callback fired when a delta-track FEC block completes or fails. */
|
|
10123
10294
|
#onDeltaBlockCompleteCb = null;
|
|
@@ -10290,7 +10461,7 @@ var MmtpRouter = class {
|
|
|
10290
10461
|
const cb = this.#getFrameCallback(packetId);
|
|
10291
10462
|
if (isVideo && !assembler) {
|
|
10292
10463
|
if (frameMeta.recovered) {
|
|
10293
|
-
this.#routeDirectRecoveredVideo(packetId, data, frameMeta, cb);
|
|
10464
|
+
this.#routeDirectRecoveredVideo(packetId, data, frameMeta, cb, meta.fecSbn);
|
|
10294
10465
|
} else {
|
|
10295
10466
|
this.#routeDirectSourceVideo(packetId, data, frameMeta, cb);
|
|
10296
10467
|
}
|
|
@@ -10323,13 +10494,18 @@ var MmtpRouter = class {
|
|
|
10323
10494
|
this.#onDeltaBlockCompleteCb?.(packetId, false);
|
|
10324
10495
|
}
|
|
10325
10496
|
};
|
|
10326
|
-
this.#fecManager.onBlockFailed = (sbn, packetId, catalogTrackName, blockClass) => {
|
|
10497
|
+
this.#fecManager.onBlockFailed = (sbn, packetId, catalogTrackName, blockClass, span) => {
|
|
10327
10498
|
this.#mseAssemblerFor(packetId, catalogTrackName)?.failBlock(sbn);
|
|
10328
10499
|
if (this.#isCatalogTrackUnambiguous(packetId, catalogTrackName) && this.#packetIdRoles.get(packetId) === "delta") {
|
|
10329
10500
|
this.#onDeltaBlockCompleteCb?.(packetId, true);
|
|
10330
10501
|
}
|
|
10331
|
-
|
|
10332
|
-
|
|
10502
|
+
if (span === void 0) {
|
|
10503
|
+
onBlockFailed?.(sbn, packetId, catalogTrackName, blockClass);
|
|
10504
|
+
this.#onBlockFailed?.(sbn, packetId, catalogTrackName, blockClass);
|
|
10505
|
+
} else {
|
|
10506
|
+
onBlockFailed?.(sbn, packetId, catalogTrackName, blockClass, span);
|
|
10507
|
+
this.#onBlockFailed?.(sbn, packetId, catalogTrackName, blockClass, span);
|
|
10508
|
+
}
|
|
10333
10509
|
};
|
|
10334
10510
|
}
|
|
10335
10511
|
}
|
|
@@ -10374,8 +10550,9 @@ var MmtpRouter = class {
|
|
|
10374
10550
|
}
|
|
10375
10551
|
/**
|
|
10376
10552
|
* FEC-recovered source symbols whose reconstructed header named a
|
|
10377
|
-
* packet_sequence_number other than the wire sequence their SS_ID maps to
|
|
10378
|
-
*
|
|
10553
|
+
* packet_sequence_number other than the wire sequence their SS_ID maps to,
|
|
10554
|
+
* or, rebuilt by the overlay, than their base copy carries: a hop
|
|
10555
|
+
* re-stamped the sequence after the sender protected the packet.
|
|
10379
10556
|
*/
|
|
10380
10557
|
get restampedRecoveredSequenceCount() {
|
|
10381
10558
|
return this.#restampedRecoveredSeqs;
|
|
@@ -10554,6 +10731,7 @@ var MmtpRouter = class {
|
|
|
10554
10731
|
enableMseAssembler(packetId, config, catalogTrackName) {
|
|
10555
10732
|
const assemblerKey = this.#mseAssemblerKey(packetId, catalogTrackName);
|
|
10556
10733
|
const previous = this.#mseAssemblers.get(assemblerKey);
|
|
10734
|
+
this.#parser.unsourceFecRelease(packetId, catalogTrackName);
|
|
10557
10735
|
if (previous) {
|
|
10558
10736
|
previous.flush();
|
|
10559
10737
|
previous.dispose();
|
|
@@ -10680,6 +10858,10 @@ var MmtpRouter = class {
|
|
|
10680
10858
|
get keyframeOverlayStats() {
|
|
10681
10859
|
return { ...this.#overlayStats };
|
|
10682
10860
|
}
|
|
10861
|
+
/** Recovered FT=2 heads held for their FT=1, and how each left the wait (BLO-53369). */
|
|
10862
|
+
get recoveredHeadsAwaitingTiming() {
|
|
10863
|
+
return this.#parser.recoveredHeadsAwaitingTiming;
|
|
10864
|
+
}
|
|
10683
10865
|
#isOverlayRepair(repairPacketId, repairTrackName) {
|
|
10684
10866
|
return this.#overlayLegs.has(repairPacketId) || repairTrackName !== void 0 && this.#overlayRepairNames.has(repairTrackName);
|
|
10685
10867
|
}
|
|
@@ -10700,7 +10882,8 @@ var MmtpRouter = class {
|
|
|
10700
10882
|
fec,
|
|
10701
10883
|
k,
|
|
10702
10884
|
offsets: /* @__PURE__ */ new Map(),
|
|
10703
|
-
moqBlocks: /* @__PURE__ */ new Set()
|
|
10885
|
+
moqBlocks: /* @__PURE__ */ new Set(),
|
|
10886
|
+
rebuilt: /* @__PURE__ */ new Map()
|
|
10704
10887
|
};
|
|
10705
10888
|
this.#overlays.set(repairPacketId, inst);
|
|
10706
10889
|
return () => {
|
|
@@ -10730,12 +10913,18 @@ var MmtpRouter = class {
|
|
|
10730
10913
|
*/
|
|
10731
10914
|
resetKeyframeOverlays(sourcePacketId, catalogTrackName) {
|
|
10732
10915
|
for (const inst of this.#overlaysForSource(sourcePacketId, catalogTrackName)) this.#resetOverlay(inst);
|
|
10916
|
+
for (const [name, stream] of this.#streams.get(sourcePacketId) ?? []) {
|
|
10917
|
+
if (catalogTrackName !== void 0 && name !== catalogTrackName) continue;
|
|
10918
|
+
stream.overlayToBase.routed.clear();
|
|
10919
|
+
stream.overlayToBase.pending.clear();
|
|
10920
|
+
}
|
|
10733
10921
|
}
|
|
10734
10922
|
#resetOverlay(inst) {
|
|
10735
10923
|
inst.fec.resetTrack(inst.repairPacketId, inst.streamName);
|
|
10736
10924
|
inst.last = void 0;
|
|
10737
10925
|
inst.offsets.clear();
|
|
10738
10926
|
inst.moqBlocks.clear();
|
|
10927
|
+
inst.rebuilt.clear();
|
|
10739
10928
|
}
|
|
10740
10929
|
#overlaysForSource(sourcePacketId, catalogTrackName) {
|
|
10741
10930
|
return [...this.#overlays.values()].filter(({ leg }) => leg.sourcePacketId === sourcePacketId && (catalogTrackName === void 0 || leg.sourceCatalogTrackName === void 0 || leg.sourceCatalogTrackName === catalogTrackName));
|
|
@@ -10786,18 +10975,33 @@ var MmtpRouter = class {
|
|
|
10786
10975
|
* A source packet that carries a 0x8B01 overlay SS_ID is also a symbol of
|
|
10787
10976
|
* every overlay installed for its source, at that SS_ID, with the bytes the
|
|
10788
10977
|
* base protects: the packet minus its 4-byte SS_ID trailer, extension
|
|
10789
|
-
* included (7.1, 7.4.3).
|
|
10790
|
-
|
|
10791
|
-
|
|
10978
|
+
* included (7.1, 7.4.3). `baseSsId` is that trailer's SS_ID, when the base
|
|
10979
|
+
* FEC reads it.
|
|
10980
|
+
*
|
|
10981
|
+
* The base copy of a packet an overlay rebuilt with no base SS_ID shows
|
|
10982
|
+
* what a base recovery of it would (#routeProcessedFecSymbols, BLO-52085):
|
|
10983
|
+
* its wire packet_sequence_number equal to the protected one rebuilt shows
|
|
10984
|
+
* the stream unstamped at the SS_ID offset it states, for the release gate
|
|
10985
|
+
* (#overlayUnstampedSsIdSeqOffsetByStream); any other shows a hop that
|
|
10986
|
+
* re-stamps it, which is counted (restampedRecoveredSequenceCount).
|
|
10987
|
+
*/
|
|
10988
|
+
#feedOverlaySource(packetId, catalogTrackName, packet, header, sequenceNumber, rapFlag, source, baseSsId) {
|
|
10792
10989
|
if (this.#overlays.size === 0) return;
|
|
10793
10990
|
const ssId = keyframeOverlaySsId(header);
|
|
10794
10991
|
if (ssId === void 0) return;
|
|
10992
|
+
let rebuiltPsn;
|
|
10795
10993
|
for (const inst of this.#overlaysForSource(packetId, catalogTrackName)) {
|
|
10796
10994
|
this.#noteOverlaySsId(inst, ssId, sequenceNumber);
|
|
10995
|
+
rebuiltPsn ??= inst.rebuilt.get(ssId);
|
|
10996
|
+
inst.rebuilt.delete(ssId);
|
|
10797
10997
|
const identity = MmtpContainerParser.sourcePacketIdentity(packet, header);
|
|
10798
10998
|
if (identity !== null) {
|
|
10799
10999
|
inst.offsets.delete(identity.mpuSequenceNumber);
|
|
10800
|
-
inst.offsets.set(identity.mpuSequenceNumber,
|
|
11000
|
+
inst.offsets.set(identity.mpuSequenceNumber, {
|
|
11001
|
+
psnOffset: ssId - sequenceNumber >>> 0,
|
|
11002
|
+
overlaySsId: ssId,
|
|
11003
|
+
...baseSsId === void 0 ? {} : { baseSsId }
|
|
11004
|
+
});
|
|
10801
11005
|
if (inst.offsets.size > OVERLAY_OFFSET_MPUS) inst.offsets.delete(inst.offsets.keys().next().value);
|
|
10802
11006
|
}
|
|
10803
11007
|
const { fec, repairPacketId: pid, streamName: name } = inst;
|
|
@@ -10819,6 +11023,14 @@ var MmtpRouter = class {
|
|
|
10819
11023
|
const recovered = fec.feedSourceSymbol(pid, ssId, symbolData, name);
|
|
10820
11024
|
if (recovered && !alreadyCompleted) this.#routeOverlayRecovered(inst, coords.sbn, recovered);
|
|
10821
11025
|
}
|
|
11026
|
+
if (rebuiltPsn === void 0 || this.#classifyPacketId(packetId) === null) return;
|
|
11027
|
+
const streamKey = this.#mediaStreamKey(packetId, catalogTrackName);
|
|
11028
|
+
if (rebuiltPsn !== sequenceNumber) {
|
|
11029
|
+
this.#restampedRecoveredSeqs++;
|
|
11030
|
+
} else if (baseSsId !== void 0) {
|
|
11031
|
+
const offset = this.#ssIdSeqOffsetByStream.get(streamKey);
|
|
11032
|
+
if (offset === baseSsId - sequenceNumber >>> 0) this.#overlayUnstampedSsIdSeqOffsetByStream.set(streamKey, offset);
|
|
11033
|
+
}
|
|
10822
11034
|
}
|
|
10823
11035
|
#noteOverlayMoqBlock(inst, blockStart) {
|
|
10824
11036
|
inst.moqBlocks.add(blockStart);
|
|
@@ -10852,11 +11064,16 @@ var MmtpRouter = class {
|
|
|
10852
11064
|
}
|
|
10853
11065
|
/**
|
|
10854
11066
|
* Route an overlay-recovered block's packets as source media of the
|
|
10855
|
-
* overlay's source (7.2: an overlay coordinate yields no base SS_ID).
|
|
10856
|
-
*
|
|
10857
|
-
*
|
|
10858
|
-
*
|
|
10859
|
-
*
|
|
11067
|
+
* overlay's source (7.2: an overlay coordinate yields no base SS_ID). A
|
|
11068
|
+
* packet whose base SS_ID is determined independently (overlayBaseSsId,
|
|
11069
|
+
* unstampedBaseSsId) enters the release gate at that SS_ID, as a packet
|
|
11070
|
+
* base FEC recovered does, so it waits behind base frames still in flight,
|
|
11071
|
+
* though not for its own MPU's packets (FrameMeta.fecSbnFirst) and no
|
|
11072
|
+
* longer than unanchored; one whose base SS_ID is undetermined has no
|
|
11073
|
+
* release-gate anchor. No parse ledger, no base re-stamp, no block
|
|
11074
|
+
* advance. Each packet's wire sequence is restored from its keyframe's own
|
|
11075
|
+
* offset; without one, a stream the base never re-stamped keeps the
|
|
11076
|
+
* header's sequence and any other drops the packet.
|
|
10860
11077
|
*/
|
|
10861
11078
|
#routeOverlayRecovered(inst, blockStart, recovered) {
|
|
10862
11079
|
const { fec, repairPacketId: pid, streamName: name } = inst;
|
|
@@ -10876,22 +11093,139 @@ var MmtpRouter = class {
|
|
|
10876
11093
|
const streamKey = this.#mediaStreamKey(sourcePacketId, sourceName);
|
|
10877
11094
|
const restamped = this.#restampedStreams.has(streamKey);
|
|
10878
11095
|
const restored = /* @__PURE__ */ new Set();
|
|
11096
|
+
const baseSsIds = /* @__PURE__ */ new Map();
|
|
11097
|
+
const gateOnly = /* @__PURE__ */ new Set();
|
|
10879
11098
|
const symbols = result.symbols.flatMap((sym) => {
|
|
10880
|
-
const
|
|
10881
|
-
|
|
10882
|
-
|
|
11099
|
+
const overlaySsId = serial32Add(blockStart, sym.index);
|
|
11100
|
+
const anchor = inst.offsets.get(sym.fragment.mpuSequenceNumber);
|
|
11101
|
+
if (anchor !== void 0) {
|
|
11102
|
+
const packetSequenceNumber = overlaySsId - anchor.psnOffset >>> 0;
|
|
10883
11103
|
restored.add(packetSequenceNumber);
|
|
10884
|
-
|
|
11104
|
+
const out = { ...sym, packetSequenceNumber };
|
|
11105
|
+
const baseSsId = overlayBaseSsId(anchor, overlaySsId, packetSequenceNumber, sym.packetSequenceNumber);
|
|
11106
|
+
if (baseSsId !== void 0) {
|
|
11107
|
+
baseSsIds.set(sym.index, baseSsId);
|
|
11108
|
+
const offset = this.#ssIdSeqOffsetByStream.get(streamKey);
|
|
11109
|
+
if (!this.#sourceSeqReceived(sourcePacketId, packetSequenceNumber, sourceName) && offset === baseSsId - packetSequenceNumber >>> 0) {
|
|
11110
|
+
this.#overlayUnstampedSsIdSeqOffsetByStream.set(streamKey, offset);
|
|
11111
|
+
}
|
|
11112
|
+
}
|
|
11113
|
+
return [out];
|
|
11114
|
+
}
|
|
11115
|
+
if (!restamped) {
|
|
11116
|
+
const offset = this.#ssIdSeqOffsetByStream.get(streamKey);
|
|
11117
|
+
const fedSsId = unstampedBaseSsId(offset, this.#unstampedSsIdSeqOffsetByStream.get(streamKey), sym.packetSequenceNumber);
|
|
11118
|
+
const baseSsId = fedSsId ?? unstampedBaseSsId(offset, this.#overlayUnstampedSsIdSeqOffsetByStream.get(streamKey), sym.packetSequenceNumber);
|
|
11119
|
+
if (baseSsId !== void 0) {
|
|
11120
|
+
baseSsIds.set(sym.index, baseSsId);
|
|
11121
|
+
if (fedSsId === void 0) gateOnly.add(sym.index);
|
|
11122
|
+
} else {
|
|
11123
|
+
inst.rebuilt.set(overlaySsId, sym.packetSequenceNumber);
|
|
11124
|
+
if (inst.rebuilt.size > OVERLAY_REBUILT_LIMIT) inst.rebuilt.delete(inst.rebuilt.keys().next().value);
|
|
11125
|
+
}
|
|
11126
|
+
return [sym];
|
|
10885
11127
|
}
|
|
10886
|
-
if (!restamped) return [sym];
|
|
10887
11128
|
this.#overlayStats.unsequencedDropped++;
|
|
10888
11129
|
return [];
|
|
10889
11130
|
});
|
|
10890
11131
|
this.#overlayStats.recovered++;
|
|
11132
|
+
const mpuFirst = /* @__PURE__ */ new Map();
|
|
11133
|
+
for (const sym of symbols) {
|
|
11134
|
+
const ssId = baseSsIds.get(sym.index);
|
|
11135
|
+
const mpu = sym.fragment.mpuSequenceNumber;
|
|
11136
|
+
const first = mpuFirst.get(mpu);
|
|
11137
|
+
if (ssId !== void 0 && (first === void 0 || serial32Precedes(ssId, first))) mpuFirst.set(mpu, ssId);
|
|
11138
|
+
}
|
|
11139
|
+
const firstSsIds = /* @__PURE__ */ new Map();
|
|
11140
|
+
for (const sym of symbols) {
|
|
11141
|
+
if (baseSsIds.has(sym.index)) firstSsIds.set(sym.index, mpuFirst.get(sym.fragment.mpuSequenceNumber));
|
|
11142
|
+
}
|
|
10891
11143
|
this.#routeProcessedFecSymbols(blockStart, { ...result, symbols }, sourcePacketId, sourceName, {
|
|
10892
|
-
deliveryProvenance: inst.moqBlocks.has(blockStart) ? "mixed" : "multicast"
|
|
11144
|
+
deliveryProvenance: inst.moqBlocks.has(blockStart) ? "mixed" : "multicast",
|
|
11145
|
+
baseSsIds,
|
|
11146
|
+
firstSsIds
|
|
10893
11147
|
});
|
|
10894
11148
|
this.#noteOverlayRecoveredRaps(sourcePacketId, sourceName, streamKey, symbols.filter((sym) => restored.has(sym.packetSequenceNumber)));
|
|
11149
|
+
this.#feedOverlayRecoveredToBase(inst, blockStart, symbols, gateOnly.size === 0 ? baseSsIds : new Map([...baseSsIds].filter(([index]) => !gateOnly.has(index))));
|
|
11150
|
+
}
|
|
11151
|
+
/**
|
|
11152
|
+
* Joint decoding (BLO-52085). A packet the overlay rebuilt is a source of
|
|
11153
|
+
* its base block too, once its base SS_ID is determined (overlayBaseSsId,
|
|
11154
|
+
* from a received member of its MPU, else unstampedBaseSsId at an offset a
|
|
11155
|
+
* base recovery showed; `baseSsIds` holds no other),
|
|
11156
|
+
* so it is fed to the base decoder as a rebuilt source
|
|
11157
|
+
* (FECManager.feedRebuiltSourceSymbol): the base block has one erasure
|
|
11158
|
+
* fewer to solve, and its repair can recover the block's other packets.
|
|
11159
|
+
* A base block no repair has stated yet takes it when one does
|
|
11160
|
+
* (#feedPendingRebuilt).
|
|
11161
|
+
*
|
|
11162
|
+
* The overlay route already handled each packet fed (delivered it, or
|
|
11163
|
+
* held an untimed head for its FT=1), so a base recovery routes none of
|
|
11164
|
+
* them again (#routeVerifiedFecSymbols): a second recovered copy of a
|
|
11165
|
+
* held head would wait in the parser for timing its first copy consumed.
|
|
11166
|
+
* Only an overlay block decoded from multicast symbols alone is fed: with
|
|
11167
|
+
* a MoQ symbol in it, the base block's recovery would depend on bytes
|
|
11168
|
+
* that crossed no multicast socket, which the provenance counted from the
|
|
11169
|
+
* block's own arrivals cannot show.
|
|
11170
|
+
*/
|
|
11171
|
+
#feedOverlayRecoveredToBase(inst, blockStart, symbols, baseSsIds) {
|
|
11172
|
+
const fec = this.#fecManager;
|
|
11173
|
+
const owner = inst.leg.sourcePacketId;
|
|
11174
|
+
const name = inst.leg.sourceCatalogTrackName;
|
|
11175
|
+
if (!fec?.feedRebuiltSourceSymbol || inst.moqBlocks.has(blockStart)) return;
|
|
11176
|
+
if (this.#classifyPacketId(owner) === null || fec.isTrackConfigured?.(owner) === false) return;
|
|
11177
|
+
const { duplicates, overlayToBase: { routed } } = this.#stream(owner, name);
|
|
11178
|
+
const feeds = [];
|
|
11179
|
+
for (const sym of symbols) {
|
|
11180
|
+
if (duplicates.sourceSeqs.has(sym.packetSequenceNumber)) continue;
|
|
11181
|
+
const ssId = baseSsIds.get(sym.index);
|
|
11182
|
+
if (ssId === void 0) {
|
|
11183
|
+
this.#overlayStats.baseUndetermined++;
|
|
11184
|
+
continue;
|
|
11185
|
+
}
|
|
11186
|
+
routed.delete(ssId);
|
|
11187
|
+
routed.add(ssId);
|
|
11188
|
+
if (routed.size > OVERLAY_ROUTED_LIMIT) routed.delete(routed.values().next().value);
|
|
11189
|
+
feeds.push([ssId, sym.rawSymbol]);
|
|
11190
|
+
}
|
|
11191
|
+
for (const [ssId, symbolData] of feeds) {
|
|
11192
|
+
if (this.#classifyPacketId(owner) === null) return;
|
|
11193
|
+
this.#feedRebuiltToBase(owner, name, ssId, symbolData);
|
|
11194
|
+
}
|
|
11195
|
+
}
|
|
11196
|
+
/** Feed one rebuilt source to its base block, or keep it until a repair states that block. */
|
|
11197
|
+
#feedRebuiltToBase(owner, name, ssId, symbolData) {
|
|
11198
|
+
const fec = this.#fecManager;
|
|
11199
|
+
if (!fec?.feedRebuiltSourceSymbol) return;
|
|
11200
|
+
const coords = fec.locateIsoSource?.(owner, name, ssId);
|
|
11201
|
+
if (coords == null) {
|
|
11202
|
+
const pending = this.#stream(owner, name).overlayToBase.pending;
|
|
11203
|
+
pending.delete(ssId);
|
|
11204
|
+
pending.set(ssId, symbolData.slice());
|
|
11205
|
+
if (pending.size > OVERLAY_PENDING_LIMIT) pending.delete(pending.keys().next().value);
|
|
11206
|
+
return;
|
|
11207
|
+
}
|
|
11208
|
+
const fed = fec.feedRebuiltSourceSymbol(owner, ssId, symbolData, name);
|
|
11209
|
+
if (!fed.taken) return;
|
|
11210
|
+
this.#overlayStats.baseFed++;
|
|
11211
|
+
if (fed.recovered === null) return;
|
|
11212
|
+
const sbn = coords.sbn;
|
|
11213
|
+
this.#routeRecoveredBlock(sbn, fed.recovered, owner, name, () => {
|
|
11214
|
+
fec.cancelBlockTimeout(sbn, owner, name);
|
|
11215
|
+
fec.countRecovery(owner, sbn, name);
|
|
11216
|
+
fec.markBlockCompleted(sbn, owner, name);
|
|
11217
|
+
});
|
|
11218
|
+
}
|
|
11219
|
+
/** A repair stated `block`: the rebuilt sources that waited for it join it now. */
|
|
11220
|
+
#feedPendingRebuilt(owner, name, block) {
|
|
11221
|
+
const pending = this.#streams.get(owner)?.get(name)?.overlayToBase.pending;
|
|
11222
|
+
if (pending === void 0 || pending.size === 0) return;
|
|
11223
|
+
for (const [ssId, symbolData] of [...pending]) {
|
|
11224
|
+
if (this.#classifyPacketId(owner) === null) return;
|
|
11225
|
+
if (serial32Distance(block.start, ssId) >= block.length) continue;
|
|
11226
|
+
pending.delete(ssId);
|
|
11227
|
+
this.#feedRebuiltToBase(owner, name, ssId, symbolData);
|
|
11228
|
+
}
|
|
10895
11229
|
}
|
|
10896
11230
|
/** fec-multicast-00 §6.6: report each base block whose RAP MFU fragments
|
|
10897
11231
|
* the overlay restored, when the keyframe's FT=0 and FT=1 are held too. A
|
|
@@ -11031,6 +11365,10 @@ var MmtpRouter = class {
|
|
|
11031
11365
|
get unadmittedListedDropCount() {
|
|
11032
11366
|
return this.#unadmittedListedDrops;
|
|
11033
11367
|
}
|
|
11368
|
+
/** Source datagrams (multicast or MoQ) a protected flow's bc-provenance v2 receiver released: admitted at once or held, then admitted by a record. Repair symbols and user-agent-admitted datagrams are not counted. Counted at release, before this router's own track checks: a released datagram those drop, which only a track change between hold and release can cause, still counts, so this is not a count of routed media. */
|
|
11369
|
+
get admittedSourceDatagramCount() {
|
|
11370
|
+
return this.#admittedSourceDatagrams;
|
|
11371
|
+
}
|
|
11034
11372
|
/** MoQ repair symbols of an unlisted track kept out of a governed FEC instance (7.2.7 step 2). */
|
|
11035
11373
|
get unlistedRepairSetAsideCount() {
|
|
11036
11374
|
return this.#unlistedRepairSetAside;
|
|
@@ -11517,6 +11855,8 @@ var MmtpRouter = class {
|
|
|
11517
11855
|
)) return;
|
|
11518
11856
|
fec.noteBlockActivity?.(blockStart, ownerPacketId, catalogTrackName);
|
|
11519
11857
|
fec.noteRepairGroupLength?.(blockStart, ownerPacketId, repair.rsbLength, catalogTrackName);
|
|
11858
|
+
this.#feedPendingRebuilt(ownerPacketId, catalogTrackName, placement.block);
|
|
11859
|
+
if (this.#classifyPacketId(ownerPacketId) === null) return;
|
|
11520
11860
|
const alreadyCompleted = fec.isBlockCompleted(blockStart, ownerPacketId, catalogTrackName);
|
|
11521
11861
|
const recovered = fec.feedRepairSymbol(
|
|
11522
11862
|
ownerPacketId,
|
|
@@ -11567,7 +11907,7 @@ var MmtpRouter = class {
|
|
|
11567
11907
|
catalogTrackName
|
|
11568
11908
|
)) continue;
|
|
11569
11909
|
if (fec.isTrackConfigured?.(ownerPacketId) !== false) {
|
|
11570
|
-
fec.trackBlock(blockStart, ownerPacketId, catalogTrackName, esi, payload.evidence);
|
|
11910
|
+
fec.trackBlock(blockStart, ownerPacketId, catalogTrackName, esi, payload.evidence, true);
|
|
11571
11911
|
this.#requestFecPoke(ownerPacketId, catalogTrackName);
|
|
11572
11912
|
}
|
|
11573
11913
|
if (payload.oversized) continue;
|
|
@@ -11654,6 +11994,8 @@ var MmtpRouter = class {
|
|
|
11654
11994
|
this.#droppedPreSyncVideo.delete(streamKey);
|
|
11655
11995
|
this.#latestVideoSeqByStream.delete(streamKey);
|
|
11656
11996
|
this.#ssIdSeqOffsetByStream.delete(streamKey);
|
|
11997
|
+
this.#unstampedSsIdSeqOffsetByStream.delete(streamKey);
|
|
11998
|
+
this.#overlayUnstampedSsIdSeqOffsetByStream.delete(streamKey);
|
|
11657
11999
|
this.#multicastRapTwinByStream.delete(streamKey);
|
|
11658
12000
|
this.#lastDirectSourceVideoTsByStream.delete(streamKey);
|
|
11659
12001
|
this.#lastDirectEmittedVideoTsByStream.delete(streamKey);
|
|
@@ -11780,6 +12122,12 @@ var MmtpRouter = class {
|
|
|
11780
12122
|
* the outgoing stream stops. The hold is bounded by the incoming stream's
|
|
11781
12123
|
* own RAP cadence, so no timer is involved.
|
|
11782
12124
|
*
|
|
12125
|
+
* While the switch is staged, the FEC release gate lets a keyframe the
|
|
12126
|
+
* overlay rebuilt reach it, on either side, when the keyframe did before
|
|
12127
|
+
* the gate anchored it (FecReleaseGate.releaseUnanchored): the switch
|
|
12128
|
+
* decides on what each side delivered, and the commit discards the gate's
|
|
12129
|
+
* frames of the outgoing stream.
|
|
12130
|
+
*
|
|
11783
12131
|
* The commit is one synchronous transition inside the frame path: the
|
|
11784
12132
|
* outgoing stream's already-admitted frames are released (its queued FEC
|
|
11785
12133
|
* gap fills only up to the RAP, since recovery can queue a frame ahead of
|
|
@@ -11830,6 +12178,9 @@ var MmtpRouter = class {
|
|
|
11830
12178
|
droppedIncomingFrames: 0
|
|
11831
12179
|
};
|
|
11832
12180
|
this.#staged = state;
|
|
12181
|
+
if (this.#parser.fecReleaseHoldsRebuilt(from.packetId, from.catalogTrackName)) {
|
|
12182
|
+
this.#requestFecPoke(from.packetId, from.catalogTrackName);
|
|
12183
|
+
}
|
|
11833
12184
|
return {
|
|
11834
12185
|
cancel: () => {
|
|
11835
12186
|
if (this.#staged !== state) return false;
|
|
@@ -11912,7 +12263,17 @@ var MmtpRouter = class {
|
|
|
11912
12263
|
*/
|
|
11913
12264
|
#routeParsedFrame(data, meta) {
|
|
11914
12265
|
if (this.#classifyPacketId(meta.packetId) === null) return;
|
|
11915
|
-
if (this.#staged !== null
|
|
12266
|
+
if (this.#staged !== null) {
|
|
12267
|
+
let consumed = false;
|
|
12268
|
+
this.#fecPokeDepth++;
|
|
12269
|
+
try {
|
|
12270
|
+
consumed = this.#interceptSwitchFrame(data, meta);
|
|
12271
|
+
} finally {
|
|
12272
|
+
this.#fecPokeDepth--;
|
|
12273
|
+
this.#flushPendingFecPokes();
|
|
12274
|
+
}
|
|
12275
|
+
if (consumed) return;
|
|
12276
|
+
}
|
|
11916
12277
|
this.#deliverParsedFrame(data, meta);
|
|
11917
12278
|
}
|
|
11918
12279
|
#commitStreamSwitch(state, rap, reason) {
|
|
@@ -12064,12 +12425,16 @@ var MmtpRouter = class {
|
|
|
12064
12425
|
this.#parser.deferFecRelease(work);
|
|
12065
12426
|
} finally {
|
|
12066
12427
|
this.#fecPokeDepth--;
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12428
|
+
this.#flushPendingFecPokes();
|
|
12429
|
+
}
|
|
12430
|
+
}
|
|
12431
|
+
/** Run the pokes requested while #fecPokeDepth was raised, once it is 0. */
|
|
12432
|
+
#flushPendingFecPokes() {
|
|
12433
|
+
if (this.#fecPokeDepth === 0 && this.#pendingFecPokes.size > 0 && !this.#disposed) {
|
|
12434
|
+
const pokes = [...this.#pendingFecPokes.values()];
|
|
12435
|
+
this.#pendingFecPokes.clear();
|
|
12436
|
+
for (const poke of pokes) {
|
|
12437
|
+
this.#parser.pokeFecRelease(poke.packetId, poke.catalogTrackName);
|
|
12073
12438
|
}
|
|
12074
12439
|
}
|
|
12075
12440
|
}
|
|
@@ -12147,6 +12512,14 @@ var MmtpRouter = class {
|
|
|
12147
12512
|
onRap: (packetId, catalogTrackName, ssId) => {
|
|
12148
12513
|
for (const observer of this.#fecRapObservers) observer(packetId, catalogTrackName, ssId);
|
|
12149
12514
|
},
|
|
12515
|
+
// A staged switch commits on when each side's frames reach it
|
|
12516
|
+
// (#interceptSwitchFrame): both sides' overlay keyframes reach it when
|
|
12517
|
+
// they did unanchored.
|
|
12518
|
+
releaseUnanchored: (packetId, catalogTrackName) => {
|
|
12519
|
+
const staged = this.#staged;
|
|
12520
|
+
const stream = { packetId, ...catalogTrackName === void 0 ? {} : { catalogTrackName } };
|
|
12521
|
+
return staged !== null && (isStream(stream, staged.from) || isStream(stream, staged.to));
|
|
12522
|
+
},
|
|
12150
12523
|
onReleased: (data, meta) => {
|
|
12151
12524
|
if (meta.trackType !== "video" || meta.mpuSequenceNumber === void 0) return;
|
|
12152
12525
|
const timing = meta.authoredTiming;
|
|
@@ -12288,6 +12661,7 @@ var MmtpRouter = class {
|
|
|
12288
12661
|
const parsed = this.#parser.parsePacket(packet);
|
|
12289
12662
|
if (!parsed) return;
|
|
12290
12663
|
const info = parsed.info;
|
|
12664
|
+
if (manifestAdmitted && !info.isRepair && ingress?.admittedBy !== USER_AGENT_VERIFIED) this.#admittedSourceDatagrams++;
|
|
12291
12665
|
if (source === "multicast" && !manifestAdmitted) {
|
|
12292
12666
|
this.#fecManager?.noteMulticastArrival?.(info.packetId, info.sequenceNumber);
|
|
12293
12667
|
}
|
|
@@ -12569,7 +12943,8 @@ var MmtpRouter = class {
|
|
|
12569
12943
|
parsed.header,
|
|
12570
12944
|
info.sequenceNumber,
|
|
12571
12945
|
info.rapFlag,
|
|
12572
|
-
source
|
|
12946
|
+
source,
|
|
12947
|
+
fecPayloadId?.ssId
|
|
12573
12948
|
);
|
|
12574
12949
|
}
|
|
12575
12950
|
}
|
|
@@ -12595,7 +12970,8 @@ var MmtpRouter = class {
|
|
|
12595
12970
|
source: parserOptions?.source,
|
|
12596
12971
|
deliveryProvenance: parserOptions?.deliveryProvenance,
|
|
12597
12972
|
catalogTrackName: parserOptions?.catalogTrackName,
|
|
12598
|
-
...parserOptions?.fecSbn === void 0 ? {} : { fecSbn: parserOptions.fecSbn }
|
|
12973
|
+
...parserOptions?.fecSbn === void 0 ? {} : { fecSbn: parserOptions.fecSbn },
|
|
12974
|
+
...parserOptions?.fecSbnFirst === void 0 ? {} : { fecSbnFirst: parserOptions.fecSbnFirst }
|
|
12599
12975
|
};
|
|
12600
12976
|
if (parsed) this.#parser.feedParsed(packet, parsed, feedOptions);
|
|
12601
12977
|
else this.#parser.feed(packet, feedOptions);
|
|
@@ -12719,7 +13095,8 @@ var MmtpRouter = class {
|
|
|
12719
13095
|
if (stream === void 0) {
|
|
12720
13096
|
stream = {
|
|
12721
13097
|
key: JSON.stringify([packetId, catalogTrackName ?? null]),
|
|
12722
|
-
duplicates: new StreamDuplicateLedgers(() => this.duplicateHorizonFor(packetId))
|
|
13098
|
+
duplicates: new StreamDuplicateLedgers(() => this.duplicateHorizonFor(packetId)),
|
|
13099
|
+
overlayToBase: { routed: /* @__PURE__ */ new Set(), pending: /* @__PURE__ */ new Map() }
|
|
12723
13100
|
};
|
|
12724
13101
|
byName.set(catalogTrackName, stream);
|
|
12725
13102
|
}
|
|
@@ -12834,8 +13211,16 @@ var MmtpRouter = class {
|
|
|
12834
13211
|
this.#drainDirectRecoveredVideo(streamKey, packetId, (frame) => frame.timestamp <= meta.timestamp, cb);
|
|
12835
13212
|
this.#emitDirectVideo(packetId, data, meta, cb);
|
|
12836
13213
|
}
|
|
12837
|
-
#routeDirectRecoveredVideo(packetId, data, meta, cb) {
|
|
13214
|
+
#routeDirectRecoveredVideo(packetId, data, meta, cb, fecSbn) {
|
|
12838
13215
|
const streamKey = this.#mediaStreamKey(packetId, meta.catalogTrackName);
|
|
13216
|
+
if (this.#isFecTrack(packetId)) {
|
|
13217
|
+
const high = this.#deliveredVideoHighWaterByStream.get(streamKey);
|
|
13218
|
+
if (fecSbn !== void 0 || high !== void 0 && authoredAdjacent(high, meta)) {
|
|
13219
|
+
this.#drainDirectRecoveredVideo(streamKey, packetId, (frame) => frame.timestamp <= meta.timestamp, cb);
|
|
13220
|
+
this.#emitDirectVideo(packetId, data, meta, cb);
|
|
13221
|
+
return;
|
|
13222
|
+
}
|
|
13223
|
+
}
|
|
12839
13224
|
this.#enqueueDirectRecoveredVideo(packetId, data, meta);
|
|
12840
13225
|
const lastSourceTs = this.#lastDirectSourceVideoTsByStream.get(streamKey);
|
|
12841
13226
|
this.#drainDirectRecoveredVideo(
|
|
@@ -12989,6 +13374,13 @@ var MmtpRouter = class {
|
|
|
12989
13374
|
* frames by epoch only if pre-protection input ever matters.
|
|
12990
13375
|
*/
|
|
12991
13376
|
#routeVerifiedFecSymbols(blockId, result, ownerPacketId, catalogTrackName, complete, assisted = false) {
|
|
13377
|
+
const overlayRouted = ownerPacketId == null ? void 0 : this.#streams.get(ownerPacketId)?.get(catalogTrackName)?.overlayToBase.routed;
|
|
13378
|
+
if (overlayRouted !== void 0 && overlayRouted.size > 0) {
|
|
13379
|
+
result = {
|
|
13380
|
+
...result,
|
|
13381
|
+
symbols: result.symbols.filter((sym) => !overlayRouted.has(this.#fecAnchorForRecovered(blockId, sym.index)))
|
|
13382
|
+
};
|
|
13383
|
+
}
|
|
12992
13384
|
const entry = ownerPacketId == null ? void 0 : this.#provenanceFor(ownerPacketId, catalogTrackName);
|
|
12993
13385
|
const receiver = entry === void 0 || entry === "ambiguous" ? entry : entry.receiver;
|
|
12994
13386
|
const userAgent = !assisted && entry !== void 0 && entry !== "ambiguous" && entry.protected === true && entry.userAgent === true;
|
|
@@ -13045,7 +13437,12 @@ var MmtpRouter = class {
|
|
|
13045
13437
|
#routeProcessedFecSymbols(blockId, result, ownerPacketId, catalogTrackName, overlay) {
|
|
13046
13438
|
if (ownerPacketId == null) return;
|
|
13047
13439
|
if (this.#classifyPacketId(ownerPacketId) === null) return;
|
|
13048
|
-
const fecSbnOf = (index) =>
|
|
13440
|
+
const fecSbnOf = (index) => {
|
|
13441
|
+
if (!overlay) return { fecSbn: this.#fecAnchorForRecovered(blockId, index) };
|
|
13442
|
+
const fecSbn = overlay.baseSsIds.get(index);
|
|
13443
|
+
const fecSbnFirst = overlay.firstSsIds.get(index);
|
|
13444
|
+
return fecSbn === void 0 || fecSbnFirst === void 0 ? {} : { fecSbn, fecSbnFirst };
|
|
13445
|
+
};
|
|
13049
13446
|
const streamKey = this.#mediaStreamKey(ownerPacketId, catalogTrackName);
|
|
13050
13447
|
const ssIdSeqOffset = overlay ? void 0 : this.#ssIdSeqOffsetByStream.get(streamKey);
|
|
13051
13448
|
if (ssIdSeqOffset !== void 0) {
|
|
@@ -13053,7 +13450,10 @@ var MmtpRouter = class {
|
|
|
13053
13450
|
...result,
|
|
13054
13451
|
symbols: result.symbols.map((sym) => {
|
|
13055
13452
|
const wire = this.#fecAnchorForRecovered(blockId, sym.index) - ssIdSeqOffset >>> 0;
|
|
13056
|
-
if (wire === sym.packetSequenceNumber)
|
|
13453
|
+
if (wire === sym.packetSequenceNumber) {
|
|
13454
|
+
this.#unstampedSsIdSeqOffsetByStream.set(streamKey, ssIdSeqOffset);
|
|
13455
|
+
return sym;
|
|
13456
|
+
}
|
|
13057
13457
|
this.#restampedRecoveredSeqs++;
|
|
13058
13458
|
this.#restampedStreams.add(streamKey);
|
|
13059
13459
|
return { ...sym, packetSequenceNumber: wire };
|
|
@@ -13089,16 +13489,29 @@ var MmtpRouter = class {
|
|
|
13089
13489
|
}
|
|
13090
13490
|
);
|
|
13091
13491
|
}
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
))
|
|
13101
|
-
|
|
13492
|
+
const untimedHead = (sym) => sym.fragmentType === 2 && sym.fragment.fragmentationIndicator === 1 && sym.fragment.movieFragmentSequenceNumber !== void 0 && sym.fragment.sampleNumber !== void 0 && !this.#parser.hasAuthoredTimingFor(
|
|
13493
|
+
ownerPacketId,
|
|
13494
|
+
sym.fragment.mpuSequenceNumber,
|
|
13495
|
+
sym.fragment.movieFragmentSequenceNumber,
|
|
13496
|
+
sym.fragment.sampleNumber,
|
|
13497
|
+
catalogTrackName
|
|
13498
|
+
);
|
|
13499
|
+
for (const sym of result.symbols) {
|
|
13500
|
+
if (!untimedHead(sym) || this.#sourceSeqReceived(ownerPacketId, sym.packetSequenceNumber, catalogTrackName)) continue;
|
|
13501
|
+
this.#feedViaParser(
|
|
13502
|
+
sym.rawSymbol,
|
|
13503
|
+
{ packetId: ownerPacketId, sequenceNumber: sym.packetSequenceNumber },
|
|
13504
|
+
void 0,
|
|
13505
|
+
{
|
|
13506
|
+
skipFecPayloadId: true,
|
|
13507
|
+
recovered: true,
|
|
13508
|
+
deliveryProvenance,
|
|
13509
|
+
...fecSbnOf(sym.index),
|
|
13510
|
+
...catalogTrackName === void 0 ? {} : { catalogTrackName }
|
|
13511
|
+
}
|
|
13512
|
+
);
|
|
13513
|
+
}
|
|
13514
|
+
result = { ...result, symbols: result.symbols.filter((sym) => !untimedHead(sym)) };
|
|
13102
13515
|
const gated = this.#isFecTrack(ownerPacketId);
|
|
13103
13516
|
const assembler = this.#mseAssemblerFor(ownerPacketId, catalogTrackName);
|
|
13104
13517
|
if (assembler) {
|