@blockcast/mmt-container 0.4.1 → 0.5.0-main.34c7b9c2cfa0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/browser-runtime.js +3769 -364
- package/dist/browser-runtime.js.map +4 -4
- package/dist/cmcd-producer.d.ts +5 -1
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.js +18 -2
- package/dist/delivery-catalog.js.map +2 -2
- package/dist/fec-manager.d.ts +21 -16
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +197 -80
- package/dist/fec-manager.js.map +3 -3
- package/dist/held-layer-admission.d.ts +58 -0
- package/dist/held-layer-admission.d.ts.map +1 -0
- package/dist/held-layer-admission.js +105 -0
- package/dist/held-layer-admission.js.map +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +2 -2
- package/dist/mmtp-container-parser.d.ts +10 -0
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +31 -1
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +2713 -1024
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +31 -1
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-fec-session.d.ts +36 -3
- package/dist/mmtp-fec-session.d.ts.map +1 -1
- package/dist/mmtp-fec-session.js +114 -5
- package/dist/mmtp-fec-session.js.map +3 -3
- package/dist/mmtp-router.d.ts +96 -29
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +522 -205
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-auth-catalog.d.ts +10 -2
- package/dist/multicast-auth-catalog.d.ts.map +1 -1
- package/dist/multicast-auth-catalog.js +422 -22
- package/dist/multicast-auth-catalog.js.map +4 -4
- package/dist/multicast-manager.d.ts +78 -11
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +3663 -333
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +4 -1
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +20 -3
- package/dist/multicast-transport.js.map +2 -2
- package/dist/no-modules.d.ts +1 -2
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +2699 -1008
- package/dist/no-modules.js.map +4 -4
- package/dist/repair-fetch.d.ts +50 -10
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +62 -20
- package/dist/repair-fetch.js.map +2 -2
- package/dist/wasm-mmtp-container-parser.js +31 -1
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +7 -15
- package/src/cmcd-producer.ts +6 -1
- package/src/fec-manager.ts +147 -131
- package/src/held-layer-admission.ts +161 -0
- package/src/index.ts +6 -9
- package/src/mmtp-container-parser.ts +48 -0
- package/src/mmtp-fec-session.ts +76 -3
- package/src/mmtp-router.ts +637 -274
- package/src/multicast-auth-catalog.ts +81 -8
- package/src/multicast-manager.ts +274 -49
- package/src/multicast-transport.ts +6 -2
- package/src/no-modules.ts +1 -6
- package/src/repair-fetch.ts +154 -34
- package/test-vectors/catalog/negative/multicast-auth-padded-key.json +0 -1
- package/test-vectors/catalog/negative/multicast-auth-reused-track-format.json +0 -1
- package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +0 -1
- package/test-vectors/catalog/negative/multicast-auth-trailing-pad-bits.json +0 -1
- package/test-vectors/repair-policy-v1.json +113 -0
- package/dist/manifest-auth-plan.d.ts +0 -31
- package/dist/manifest-auth-plan.d.ts.map +0 -1
- package/dist/manifest-auth-plan.js +0 -426
- package/dist/manifest-auth-plan.js.map +0 -7
- package/dist/source-auth.d.ts +0 -2
- package/dist/source-auth.d.ts.map +0 -1
- package/dist/source-auth.js +0 -3912
- package/dist/source-auth.js.map +0 -7
- package/src/manifest-auth-plan.ts +0 -55
- package/src/source-auth.ts +0 -1
- package/test-vectors/generate-source-auth-fixture.mjs +0 -114
- package/test-vectors/source-auth-v1.json +0 -61
|
@@ -5163,6 +5163,9 @@ function authoredGap(before, after) {
|
|
|
5163
5163
|
if (!a || !b || a.mediaTimescale !== b.mediaTimescale) return false;
|
|
5164
5164
|
return b.decodeTime > a.decodeTime + BigInt(a.durationTicks);
|
|
5165
5165
|
}
|
|
5166
|
+
function ssIdAfter(a, b) {
|
|
5167
|
+
return (a - b | 0) > 0;
|
|
5168
|
+
}
|
|
5166
5169
|
var FecReleaseSequencer = class {
|
|
5167
5170
|
#streams = /* @__PURE__ */ new Map();
|
|
5168
5171
|
#gate;
|
|
@@ -5224,11 +5227,17 @@ var FecReleaseSequencer = class {
|
|
|
5224
5227
|
stream.last = null;
|
|
5225
5228
|
stream.lastSbn = void 0;
|
|
5226
5229
|
stream.discontinuity = false;
|
|
5230
|
+
stream.rapSsId = void 0;
|
|
5227
5231
|
}
|
|
5228
5232
|
if (stream.last !== null && compareFrameOrder(frame, stream.last) <= 0) {
|
|
5229
5233
|
this.#recordStat("droppedStale");
|
|
5230
5234
|
return;
|
|
5231
5235
|
}
|
|
5236
|
+
const ssId = meta.fecSbn;
|
|
5237
|
+
if (meta.trackType === "video" && ssId !== void 0 && this.#gate.isRap?.(data, meta) === true) {
|
|
5238
|
+
if (stream.rapSsId === void 0 || ssIdAfter(ssId, stream.rapSsId)) stream.rapSsId = ssId;
|
|
5239
|
+
this.#gate.onRap?.(stream.packetId, stream.catalogTrackName, ssId);
|
|
5240
|
+
}
|
|
5232
5241
|
if (stream.last === null) {
|
|
5233
5242
|
if (meta.trackType === "video" && !meta.keyframe) {
|
|
5234
5243
|
this.#recordStat("droppedBeforeStartupKeyframe");
|
|
@@ -5264,6 +5273,22 @@ var FecReleaseSequencer = class {
|
|
|
5264
5273
|
}
|
|
5265
5274
|
return earliest;
|
|
5266
5275
|
}
|
|
5276
|
+
/**
|
|
5277
|
+
* Whether a complete RAP above SS_ID `ssId` entered the gate of a stream of
|
|
5278
|
+
* `packetId` (draft-ramadan-moq-fec 11.4.2: repair of a block below it is
|
|
5279
|
+
* moot). Its SS_ID is the one its frame completed in; a frame's packets
|
|
5280
|
+
* hold consecutive SS_IDs in authored order, so a complete RAP with a
|
|
5281
|
+
* packet above `ssId` has every packet of it at or above the first SS_ID
|
|
5282
|
+
* any loss at or below `ssId` could have taken.
|
|
5283
|
+
*/
|
|
5284
|
+
rapAbove(packetId, catalogTrackName, ssId) {
|
|
5285
|
+
for (const stream of this.#streams.values()) {
|
|
5286
|
+
if (stream.packetId !== packetId) continue;
|
|
5287
|
+
if (catalogTrackName !== void 0 && stream.catalogTrackName !== catalogTrackName) continue;
|
|
5288
|
+
if (stream.rapSsId !== void 0 && ssIdAfter(stream.rapSsId, ssId)) return true;
|
|
5289
|
+
}
|
|
5290
|
+
return false;
|
|
5291
|
+
}
|
|
5267
5292
|
/** Re-evaluate held gaps after FEC state changed. */
|
|
5268
5293
|
poke(streamKey) {
|
|
5269
5294
|
if (streamKey !== void 0) {
|
|
@@ -5354,7 +5379,8 @@ var FecReleaseSequencer = class {
|
|
|
5354
5379
|
buf: [],
|
|
5355
5380
|
last: null,
|
|
5356
5381
|
lastSbn: void 0,
|
|
5357
|
-
discontinuity: false
|
|
5382
|
+
discontinuity: false,
|
|
5383
|
+
rapSsId: void 0
|
|
5358
5384
|
};
|
|
5359
5385
|
this.#streams.set(streamKey, stream);
|
|
5360
5386
|
}
|
|
@@ -5717,6 +5743,10 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
5717
5743
|
fecReleaseEarliestHeldAtMs(packetId, catalogTrackName) {
|
|
5718
5744
|
return this.#fecSequencer?.earliestHeldArrivalMs(packetId, catalogTrackName);
|
|
5719
5745
|
}
|
|
5746
|
+
/** See FecReleaseSequencer.rapAbove; false when no stream is FEC-gated. */
|
|
5747
|
+
fecReleaseRapAbove(packetId, catalogTrackName, ssId) {
|
|
5748
|
+
return this.#fecSequencer?.rapAbove(packetId, catalogTrackName, ssId) ?? false;
|
|
5749
|
+
}
|
|
5720
5750
|
/** Re-evaluate held gaps after FEC block state changed. */
|
|
5721
5751
|
pokeFecRelease(packetId, catalogTrackName) {
|
|
5722
5752
|
if (!this.#fecSequencer) return;
|