@blockcast/mmt-container 0.4.0-main.501042ae50df → 0.4.0-main.5a473b35d65f
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 +4 -4
- package/dist/browser-runtime.js +81 -59
- package/dist/browser-runtime.js.map +3 -3
- package/dist/carp-catalog.d.ts +9 -5
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +21 -5
- package/dist/carp-catalog.js.map +2 -2
- package/dist/catalog-fec-params.d.ts +11 -3
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +34 -4
- package/dist/catalog-fec-params.js.map +2 -2
- package/dist/catalog-network-source.d.ts +23 -1
- package/dist/catalog-network-source.d.ts.map +1 -1
- package/dist/catalog-network-source.js +21 -1
- package/dist/catalog-network-source.js.map +2 -2
- package/dist/delivery-catalog.js +14 -0
- package/dist/delivery-catalog.js.map +2 -2
- package/dist/fec-manager.js.map +2 -2
- package/dist/fec-state.d.ts +2 -1
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +5 -2
- package/dist/fec-state.js.map +2 -2
- package/dist/fec-worker-setup.d.ts +2 -0
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +1 -1
- package/dist/fec-worker-setup.js.map +2 -2
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -8
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.js.map +1 -1
- package/dist/manifest-auth-plan.js.map +1 -1
- package/dist/mfu-reassembler.js.map +1 -1
- package/dist/mmtp-container-parser.js.map +1 -1
- package/dist/mmtp-container-parser.no-modules.js +52 -14
- package/dist/mmtp-container-parser.no-modules.js.map +2 -2
- package/dist/mmtp-decode-pipeline.js.map +1 -1
- package/dist/mmtp-fec-session.js.map +1 -1
- package/dist/mmtp-router.js.map +1 -1
- package/dist/multicast-auth-catalog.js.map +1 -1
- package/dist/multicast-input.d.ts +2 -2
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +7 -5
- package/dist/multicast-input.js.map +2 -2
- package/dist/multicast-manager.js +29 -2
- package/dist/multicast-manager.js.map +2 -2
- package/dist/multicast-transport.d.ts +6 -0
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +16 -1
- package/dist/multicast-transport.js.map +2 -2
- package/dist/multicast-unwrap.js.map +1 -1
- package/dist/no-modules.d.ts +2 -2
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +48 -8
- package/dist/no-modules.js.map +3 -3
- package/dist/repair-fetch.js.map +1 -1
- package/dist/repair-layers.d.ts +2 -0
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +19 -2
- package/dist/repair-layers.js.map +2 -2
- package/dist/signaling.js.map +1 -1
- package/dist/source-auth.js +2246 -0
- package/dist/source-auth.js.map +4 -4
- package/dist/timestamp-codec.js.map +1 -1
- package/dist/wasm-mfu-reassembler.js.map +1 -1
- package/dist/wasm-mmtp-container-parser.js.map +1 -1
- package/package.json +6 -9
- package/schemas/catalog.schema.json +8 -4
- package/src/carp-catalog.ts +14 -9
- package/src/catalog-fec-params.ts +23 -1
- package/src/catalog-network-source.ts +44 -1
- package/src/fec-state.ts +9 -3
- package/src/fec-worker-setup.ts +3 -1
- package/src/index.ts +3 -8
- package/src/multicast-input.ts +10 -7
- package/src/multicast-transport.ts +3 -0
- package/src/no-modules.ts +2 -2
- package/src/repair-layers.ts +22 -2
- package/test-vectors/catalog/README.md +5 -0
- package/test-vectors/catalog/negative/fec-block-profile-missing.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-unknown.json +1 -1
- package/test-vectors/catalog/negative/fec-reed-solomon-k-plus-p-over-255.json +39 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-overlay-over-255.json +40 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-above-max.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-out-of-range.json +1 -1
- package/test-vectors/catalog/positive/fec-algorithm-unimplemented.json +29 -0
- package/test-vectors/catalog/positive/fec-iso-ssbg1.json +1 -1
- package/test-vectors/catalog/positive/fec-multicast.json +1 -1
- package/test-vectors/catalog/positive/fec-reed-solomon-layered.json +50 -0
- package/test-vectors/catalog/section-codes.json +3 -0
- package/test-vectors/catalog-validation.json +3 -3
- package/dist/fec-codec.d.ts +0 -32
- package/dist/fec-codec.d.ts.map +0 -1
- package/dist/fec-codec.js +0 -47
- package/dist/fec-codec.js.map +0 -7
- package/src/fec-codec.ts +0 -61
package/README.md
CHANGED
|
@@ -74,7 +74,6 @@ The package exposes a wide subpath surface so consumers can tree-shake aggressiv
|
|
|
74
74
|
| `./multicast-unwrap` | Container-aware MMTP dispatch (LOC vs raw MMTP) |
|
|
75
75
|
| `./signaling` | Packet-type classifier (`isSignalingPacket`, `isSourcePacket`, `classifyPacket`) |
|
|
76
76
|
| `./mmtp-container-parser` | `MmtpContainerParser` (the unified, transport-agnostic parser) |
|
|
77
|
-
| `./fec-codec` | Algorithm-pluggable codec interface — `NoneCodec`, `ReedSolomonCodec`, `createFecCodec` |
|
|
78
77
|
| `./cmcd-producer` | `CmcdProducer` — RFC 9559 CMCD with `x-bc-*` vendor keys |
|
|
79
78
|
| `./cmaf-block-assembler` | `CmafBlockAssembler` — assembles one CMAF segment per FEC source block |
|
|
80
79
|
| `./cmaf-group-batcher` | `CmafGroupBatcher` — MoQ group → CMAF segment batcher |
|
|
@@ -250,8 +249,9 @@ DRIAD *and* a named relay — emit both entries, `[{type: "amt", discovery:
|
|
|
250
249
|
non-DRIAD AMT entry, so the manual one carries the relay while the DRIAD one
|
|
251
250
|
keeps the discovery request. An `atsc3` endpoint now
|
|
252
251
|
requires a `{type: "atsc3", …}` entry and throws `atsc3_requires_tuning`
|
|
253
|
-
without one: that entry carries the frequency
|
|
254
|
-
|
|
252
|
+
without one: that entry carries the frequency in kHz (REQUIRED) and,
|
|
253
|
+
optionally, the PLP, service id and SLS URI (draft -01 4.2.2/4.2.3) — the only
|
|
254
|
+
tuning information an ATSC3 receiver has (the SLS behind
|
|
255
255
|
`slsUri` describes the MMTP session, MP table included, per A/331:2026-04 7.2,
|
|
256
256
|
and nothing of this profile, so `manifestPort` and keys come from provisioning), and the schema
|
|
257
257
|
cannot enforce it because `networkSource` is optional there (a native join has
|
|
@@ -383,7 +383,7 @@ Typed evidence is `RepairLifecycleEvent` version 2 and
|
|
|
383
383
|
`MulticastManager.getBlockPolicyStats()`.
|
|
384
384
|
|
|
385
385
|
This package depends on the FEC primitives from:
|
|
386
|
-
- **`@blockcast/mmt-fec`** — RaptorQ WASM decoder + OTI codec + `
|
|
386
|
+
- **`@blockcast/mmt-fec`** — RaptorQ WASM decoder + OTI codec + `fecBlockDeadlineMs` / `fecBlockBudgetMs`
|
|
387
387
|
- **`@blockcast/fec-worker`** — Web Worker host, `FecWorkerClient`, `FecTrackStats`
|
|
388
388
|
|
|
389
389
|
### MMTP → CMAF demux (`./mmtp-to-cmaf`)
|
package/dist/browser-runtime.js
CHANGED
|
@@ -1007,18 +1007,23 @@ function catalogFecAvailable(fec) {
|
|
|
1007
1007
|
const block = recordOf(fec);
|
|
1008
1008
|
if (block === void 0)
|
|
1009
1009
|
return true;
|
|
1010
|
+
if (fecAlgorithmUnimplemented(block["algorithm"]))
|
|
1011
|
+
return false;
|
|
1010
1012
|
const declaresFecInstance = block["algorithm"] !== "none";
|
|
1011
1013
|
const profile = block["blockProfile"];
|
|
1012
1014
|
const profileOk = isFecBlockProfile(profile) || profile === void 0 && !declaresFecInstance;
|
|
1013
1015
|
return profileOk && (!declaresFecInstance || isoBlockSpanUsable(block));
|
|
1014
1016
|
}
|
|
1017
|
+
function fecAlgorithmUnimplemented(algorithm) {
|
|
1018
|
+
return typeof algorithm === "string" && algorithm !== "none" && algorithm !== "raptorq" && algorithm !== "reed-solomon";
|
|
1019
|
+
}
|
|
1015
1020
|
function isPositiveSafeInteger(value) {
|
|
1016
1021
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
1017
1022
|
}
|
|
1018
1023
|
var ISO_SSBG1_MIN_SYMBOL_SIZE = 14;
|
|
1019
1024
|
function catalogFecDeclaresUnconfigurableInstance(fec) {
|
|
1020
1025
|
const block = recordOf(fec);
|
|
1021
|
-
if (block === void 0 || block["algorithm"] === "none")
|
|
1026
|
+
if (block === void 0 || block["algorithm"] === "none" || fecAlgorithmUnimplemented(block["algorithm"]))
|
|
1022
1027
|
return false;
|
|
1023
1028
|
if (!(isPositiveSafeInteger(block["sourceSymbols"]) && isPositiveSafeInteger(block["symbolSize"])))
|
|
1024
1029
|
return true;
|
|
@@ -6281,6 +6286,7 @@ var DEFAULT_REPAIR_PRIORITY = 240;
|
|
|
6281
6286
|
var MAX_RAPTORQ_SOURCE_SYMBOLS = 56403;
|
|
6282
6287
|
var MAX_REPAIR_SYMBOLS = 16777215;
|
|
6283
6288
|
var MAX_ENCODING_SYMBOL_ID = 16777215;
|
|
6289
|
+
var MAX_REED_SOLOMON_BLOCK_SYMBOLS = 255;
|
|
6284
6290
|
var RepairContractError = class extends Error {
|
|
6285
6291
|
constructor(code, path, message) {
|
|
6286
6292
|
super(`[repair-layers:${code}] ${path}: ${message}`);
|
|
@@ -6463,11 +6469,12 @@ function assembleRepairLayers(source, descriptors, fail = throwRepairContractErr
|
|
|
6463
6469
|
if (layered && !positiveInteger(source.sourceSymbols)) {
|
|
6464
6470
|
fail("track_fec", `${source.path}.sourceSymbols`, "layered or overlay repair needs a positive integer sourceSymbols on the source");
|
|
6465
6471
|
}
|
|
6466
|
-
|
|
6472
|
+
const reedSolomon = source.algorithm === "reed-solomon";
|
|
6473
|
+
if (layered && source.algorithm !== "raptorq" && !reedSolomon) {
|
|
6467
6474
|
fail(
|
|
6468
6475
|
"track_fec",
|
|
6469
6476
|
`${source.path}.algorithm`,
|
|
6470
|
-
"repair layers and overlays are defined only for raptorq
|
|
6477
|
+
"repair layers and overlays are defined only for raptorq and reed-solomon (draft-ramadan-moq-fec-01 6.3.4 rule 7)"
|
|
6471
6478
|
);
|
|
6472
6479
|
}
|
|
6473
6480
|
let layerZeroPriority = DEFAULT_REPAIR_PRIORITY;
|
|
@@ -6526,6 +6533,13 @@ function assembleRepairLayers(source, descriptors, fail = throwRepairContractErr
|
|
|
6526
6533
|
`overlay sourceSymbols + repairSymbols - 1 exceeds the 24-bit ESI space (${MAX_ENCODING_SYMBOL_ID})`
|
|
6527
6534
|
);
|
|
6528
6535
|
}
|
|
6536
|
+
if (reedSolomon && sourceSymbols + repairSymbols > MAX_REED_SOLOMON_BLOCK_SYMBOLS) {
|
|
6537
|
+
fail(
|
|
6538
|
+
"track_fec_bounds",
|
|
6539
|
+
`${d.path}.repairSymbols`,
|
|
6540
|
+
`reed-solomon overlay sourceSymbols + repairSymbols exceeds ${MAX_REED_SOLOMON_BLOCK_SYMBOLS} (draft-ramadan-moq-fec-01 6.3.4 rule 12)`
|
|
6541
|
+
);
|
|
6542
|
+
}
|
|
6529
6543
|
overlays.push({ repairTrackName: d.name, scope: "keyframe", sourceSymbols, repairSymbols, priority: d.priority });
|
|
6530
6544
|
}
|
|
6531
6545
|
let offset = layerZeroSymbols;
|
|
@@ -6570,6 +6584,13 @@ function assembleRepairLayers(source, descriptors, fail = throwRepairContractErr
|
|
|
6570
6584
|
`sourceSymbols + total base repair symbols - 1 exceeds the 24-bit ESI space (${MAX_ENCODING_SYMBOL_ID})`
|
|
6571
6585
|
);
|
|
6572
6586
|
}
|
|
6587
|
+
if (reedSolomon && k + totalBaseRepairSymbols > MAX_REED_SOLOMON_BLOCK_SYMBOLS) {
|
|
6588
|
+
fail(
|
|
6589
|
+
"track_fec_bounds",
|
|
6590
|
+
`${source.path}.sourceSymbols`,
|
|
6591
|
+
`reed-solomon sourceSymbols + total base repair symbols exceeds ${MAX_REED_SOLOMON_BLOCK_SYMBOLS} (draft-ramadan-moq-fec-01 6.3.4 rule 12)`
|
|
6592
|
+
);
|
|
6593
|
+
}
|
|
6573
6594
|
return { sourceTrackName: source.name, baseLayers, overlays, totalBaseRepairSymbols };
|
|
6574
6595
|
}
|
|
6575
6596
|
|
|
@@ -6617,7 +6638,7 @@ function isFecCatalogGeometry(obj) {
|
|
|
6617
6638
|
const o = obj;
|
|
6618
6639
|
const algorithm = o["algorithm"];
|
|
6619
6640
|
const symbolSize = o["symbolSize"];
|
|
6620
|
-
return typeof algorithm === "string" &&
|
|
6641
|
+
return typeof algorithm === "string" && algorithm.length > 0 && typeof o["sourceSymbols"] === "number" && o["sourceSymbols"] >= 1 && typeof o["repairSymbols"] === "number" && o["repairSymbols"] >= 1 && typeof symbolSize === "number" && symbolSize >= 1 && (algorithm !== "raptorq" || symbolSize % 8 === 0) && typeof o["repairTrack"] === "string" && o["repairTrack"].length > 0;
|
|
6621
6642
|
}
|
|
6622
6643
|
function isFecCatalogConfig(obj) {
|
|
6623
6644
|
if (!isFecCatalogGeometry(obj)) return false;
|
|
@@ -6863,8 +6884,8 @@ function validateCmsfMmtpCatalog(value, options = {}) {
|
|
|
6863
6884
|
}
|
|
6864
6885
|
const config = fec;
|
|
6865
6886
|
const algorithm = config["algorithm"];
|
|
6866
|
-
if (
|
|
6867
|
-
catalogError("track_fec", `${path}.fec.algorithm`, "
|
|
6887
|
+
if (typeof algorithm !== "string" || algorithm.length === 0) {
|
|
6888
|
+
catalogError("track_fec", `${path}.fec.algorithm`, "must be a non-empty string");
|
|
6868
6889
|
}
|
|
6869
6890
|
if ("interleaveDepth" in config || "interleaveMs" in config) {
|
|
6870
6891
|
catalogError("track_fec", `${path}.fec`, "interleaveDepthMs is the only supported interleave field");
|
|
@@ -7538,6 +7559,20 @@ function toWindowMulticastSubscribeConfig(input) {
|
|
|
7538
7559
|
consume: "bytes",
|
|
7539
7560
|
...input.packetIds?.length ? { packetIds: [...input.packetIds] } : {}
|
|
7540
7561
|
};
|
|
7562
|
+
if (input.atsc3) {
|
|
7563
|
+
const { frequency, plpId, serviceId } = input.atsc3;
|
|
7564
|
+
if (!Number.isInteger(frequency) || frequency < 1) {
|
|
7565
|
+
throw new TypeError(`ATSC3 tuning requires a positive integer frequency in kHz, got ${String(frequency)}`);
|
|
7566
|
+
}
|
|
7567
|
+
return {
|
|
7568
|
+
...base,
|
|
7569
|
+
origin: "tuner",
|
|
7570
|
+
standard: "atsc3",
|
|
7571
|
+
frequency,
|
|
7572
|
+
...plpId !== void 0 ? { plpId } : {},
|
|
7573
|
+
...serviceId !== void 0 ? { serviceId } : {}
|
|
7574
|
+
};
|
|
7575
|
+
}
|
|
7541
7576
|
const relay = input.amtRelay?.trim();
|
|
7542
7577
|
const driad = !relay && input.amtDiscovery === "driad";
|
|
7543
7578
|
const wantsAmt = input.mode === "tunnel" || input.mode !== "native" && (relay !== void 0 && relay !== "" || driad);
|
|
@@ -8817,7 +8852,7 @@ function multicastFromConfig(input) {
|
|
|
8817
8852
|
throw new MulticastInputError(
|
|
8818
8853
|
ep.protocol === "amt" ? "amt_requires_relay" : "atsc3_requires_tuning",
|
|
8819
8854
|
idx,
|
|
8820
|
-
`endpoint[${idx}] protocol=${ep.protocol} requires a multicast.networkSource entry of type "${ep.protocol}"` + (ep.protocol === "atsc3" ? " carrying
|
|
8855
|
+
`endpoint[${idx}] protocol=${ep.protocol} requires a multicast.networkSource entry of type "${ep.protocol}"` + (ep.protocol === "atsc3" ? " carrying at least its frequency (kHz) \u2014 an ATSC3 endpoint is not tunable without it" : "")
|
|
8821
8856
|
);
|
|
8822
8857
|
});
|
|
8823
8858
|
input.endpoints.forEach((ep, idx) => {
|
|
@@ -8881,13 +8916,15 @@ function validateNetworkSourceEntry(s, i) {
|
|
|
8881
8916
|
}
|
|
8882
8917
|
const inRange = (v, min, max) => Number.isInteger(v) && v >= min && v <= max;
|
|
8883
8918
|
if (!inRange(s.frequency, 1, Number.MAX_SAFE_INTEGER)) {
|
|
8884
|
-
throw err("invalid_network_source", `frequency must be a positive integer; got ${s.frequency}`);
|
|
8919
|
+
throw err("invalid_network_source", `frequency must be a positive integer in kHz; got ${s.frequency}`);
|
|
8920
|
+
}
|
|
8921
|
+
if (s.plpId !== void 0 && !inRange(s.plpId, 0, 63)) {
|
|
8922
|
+
throw err("invalid_network_source", `plpId must be 0..63; got ${s.plpId}`);
|
|
8885
8923
|
}
|
|
8886
|
-
if (!inRange(s.
|
|
8887
|
-
if (!inRange(s.serviceId, 0, 65535)) {
|
|
8924
|
+
if (s.serviceId !== void 0 && !inRange(s.serviceId, 0, 65535)) {
|
|
8888
8925
|
throw err("invalid_network_source", `serviceId must be 0..65535; got ${s.serviceId}`);
|
|
8889
8926
|
}
|
|
8890
|
-
if (typeof s.slsUri !== "string" || !isAbsoluteUri(s.slsUri)) {
|
|
8927
|
+
if (s.slsUri !== void 0 && (typeof s.slsUri !== "string" || !isAbsoluteUri(s.slsUri))) {
|
|
8891
8928
|
throw err("invalid_network_source", `slsUri must be an absolute URI; got ${JSON.stringify(s.slsUri)}`);
|
|
8892
8929
|
}
|
|
8893
8930
|
}
|
|
@@ -12705,7 +12742,7 @@ function isPositiveSafeInteger2(value) {
|
|
|
12705
12742
|
}
|
|
12706
12743
|
function catalogDeclaresFec(fec) {
|
|
12707
12744
|
const block = recordOf2(fec);
|
|
12708
|
-
if (block === void 0 || block["algorithm"] === "none") return false;
|
|
12745
|
+
if (block === void 0 || block["algorithm"] === "none" || fecAlgorithmUnimplemented(block["algorithm"])) return false;
|
|
12709
12746
|
return isPositiveSafeInteger2(block["sourceSymbols"]) && isPositiveSafeInteger2(block["symbolSize"]) && isFecBlockProfile(block["blockProfile"]) && isoBlockSpanUsable(block) && !catalogFecDeclaresUnconfigurableInstance(block);
|
|
12710
12747
|
}
|
|
12711
12748
|
function requireBoolean(value, field) {
|
|
@@ -22286,48 +22323,6 @@ function createWasmMmtpContainerParser(config) {
|
|
|
22286
22323
|
});
|
|
22287
22324
|
}
|
|
22288
22325
|
|
|
22289
|
-
// src/fec-codec.ts
|
|
22290
|
-
var NoneCodec = class {
|
|
22291
|
-
constructor() {
|
|
22292
|
-
this.algorithm = "none";
|
|
22293
|
-
}
|
|
22294
|
-
addSymbol(_blockId, _symbolId, data, _isRepair) {
|
|
22295
|
-
return data;
|
|
22296
|
-
}
|
|
22297
|
-
configure(_params) {
|
|
22298
|
-
}
|
|
22299
|
-
cleanup(_now) {
|
|
22300
|
-
return new Uint8Array(0);
|
|
22301
|
-
}
|
|
22302
|
-
};
|
|
22303
|
-
function createFecCodec(algorithm) {
|
|
22304
|
-
switch (algorithm) {
|
|
22305
|
-
case "none":
|
|
22306
|
-
return new NoneCodec();
|
|
22307
|
-
case "reed-solomon":
|
|
22308
|
-
return new ReedSolomonCodec();
|
|
22309
|
-
case "raptorq":
|
|
22310
|
-
console.warn("[FEC] RaptorQ requested via createFecCodec \u2014 use FECManager.setFecDecoder() for WASM RaptorQ. Falling back to NoneCodec.");
|
|
22311
|
-
return new NoneCodec();
|
|
22312
|
-
default:
|
|
22313
|
-
console.warn(`[FEC] Unknown algorithm "${algorithm}", falling back to NoneCodec`);
|
|
22314
|
-
return new NoneCodec();
|
|
22315
|
-
}
|
|
22316
|
-
}
|
|
22317
|
-
var ReedSolomonCodec = class {
|
|
22318
|
-
constructor() {
|
|
22319
|
-
this.algorithm = "reed-solomon";
|
|
22320
|
-
}
|
|
22321
|
-
addSymbol(_blockId, _symbolId, _data, _isRepair) {
|
|
22322
|
-
return null;
|
|
22323
|
-
}
|
|
22324
|
-
configure(_params) {
|
|
22325
|
-
}
|
|
22326
|
-
cleanup(_now) {
|
|
22327
|
-
return new Uint8Array(0);
|
|
22328
|
-
}
|
|
22329
|
-
};
|
|
22330
|
-
|
|
22331
22326
|
// src/multicast-transport.ts
|
|
22332
22327
|
var JOIN_SUCCEEDED = Object.freeze({ ok: true });
|
|
22333
22328
|
function providerErrorOf(error) {
|
|
@@ -22477,7 +22472,8 @@ var MulticastTransport = class {
|
|
|
22477
22472
|
amtRelayPort: config.amtRelayPort,
|
|
22478
22473
|
amtDiscovery: config.amtDiscovery,
|
|
22479
22474
|
packetIds: config.packetIds,
|
|
22480
|
-
tracks: config.tracks
|
|
22475
|
+
tracks: config.tracks,
|
|
22476
|
+
atsc3: config.atsc3
|
|
22481
22477
|
});
|
|
22482
22478
|
failure = "provider-rejected";
|
|
22483
22479
|
const subscription = await gateway.subscribe(subscribeConfig);
|
|
@@ -23082,6 +23078,25 @@ function catalogAmtNetworkSource(networkSource) {
|
|
|
23082
23078
|
}
|
|
23083
23079
|
return void 0;
|
|
23084
23080
|
}
|
|
23081
|
+
function intIn(value, min, max) {
|
|
23082
|
+
return Number.isInteger(value) && value >= min && value <= max;
|
|
23083
|
+
}
|
|
23084
|
+
function catalogAtsc3NetworkSource(networkSource) {
|
|
23085
|
+
const entries = Array.isArray(networkSource) ? networkSource : networkSource ? [networkSource] : [];
|
|
23086
|
+
for (const raw of entries) {
|
|
23087
|
+
if (!raw || typeof raw !== "object") continue;
|
|
23088
|
+
const ns = raw;
|
|
23089
|
+
if (ns.type !== "atsc3" || !intIn(ns.frequency, 1, Number.MAX_SAFE_INTEGER)) continue;
|
|
23090
|
+
const slsUri = typeof ns.slsUri === "string" ? ns.slsUri.trim() : "";
|
|
23091
|
+
return {
|
|
23092
|
+
frequency: ns.frequency,
|
|
23093
|
+
...intIn(ns.plpId, 0, 63) ? { plpId: ns.plpId } : {},
|
|
23094
|
+
...intIn(ns.serviceId, 0, 65535) ? { serviceId: ns.serviceId } : {},
|
|
23095
|
+
...slsUri ? { slsUri } : {}
|
|
23096
|
+
};
|
|
23097
|
+
}
|
|
23098
|
+
return void 0;
|
|
23099
|
+
}
|
|
23085
23100
|
|
|
23086
23101
|
// src/catalog-fec-params.ts
|
|
23087
23102
|
var MAX_SAFE_TICKS_PER_HZ = Number.MAX_SAFE_INTEGER / 1e3;
|
|
@@ -23297,6 +23312,13 @@ function isoSpanUnavailable(fec, path, declaresFecInstance) {
|
|
|
23297
23312
|
function catalogFecUnavailable(fec, fecPath) {
|
|
23298
23313
|
if (catalogFecAvailable(fec)) return void 0;
|
|
23299
23314
|
const block = recordOf3(fec);
|
|
23315
|
+
if (fecAlgorithmUnimplemented(block["algorithm"])) {
|
|
23316
|
+
return Object.freeze({
|
|
23317
|
+
code: "track_fec_algorithm_unimplemented",
|
|
23318
|
+
path: `${fecPath}.algorithm`,
|
|
23319
|
+
message: `algorithm ${JSON.stringify(block["algorithm"])} is not implemented: the track plays without FEC`
|
|
23320
|
+
});
|
|
23321
|
+
}
|
|
23300
23322
|
const declaresFecInstance = block["algorithm"] !== "none";
|
|
23301
23323
|
const reason = blockProfileUnavailable(block["blockProfile"], `${fecPath}.blockProfile`, declaresFecInstance) ?? isoSpanUnavailable(block, `${fecPath}.interleaveDepthMs`, declaresFecInstance);
|
|
23302
23324
|
if (reason === void 0) {
|
|
@@ -23325,6 +23347,7 @@ function fecParams(catalog, track, rendition, fps, sampleRate) {
|
|
|
23325
23347
|
const fecBlockProfile = readFecBlockProfile(fec.blockProfile, `${fecPath}.blockProfile`, true, throwRepairContractError);
|
|
23326
23348
|
return {
|
|
23327
23349
|
fecK: fec.sourceSymbols ?? 0,
|
|
23350
|
+
fecAlgorithm: fec.algorithm === "reed-solomon" ? "reed-solomon" : "raptorq",
|
|
23328
23351
|
fecBlockProfile,
|
|
23329
23352
|
fecRepairCount: fec.repairSymbols ?? 0,
|
|
23330
23353
|
// The wire RSB_length: every base layer's packets carry the base total (§7.1).
|
|
@@ -25318,7 +25341,7 @@ async function setupFecWorkerForTrack(opts) {
|
|
|
25318
25341
|
trackType: opts.trackType,
|
|
25319
25342
|
framerate: opts.framerate,
|
|
25320
25343
|
sampleRate: opts.sampleRate,
|
|
25321
|
-
algorithm: "
|
|
25344
|
+
algorithm: opts.fecAlgorithm ?? "raptorq",
|
|
25322
25345
|
blockProfile,
|
|
25323
25346
|
k: opts.fecK,
|
|
25324
25347
|
// P as this receiver joined it, not the catalog total: the worker snapshot
|
|
@@ -27930,14 +27953,12 @@ export {
|
|
|
27930
27953
|
MulticastInputError,
|
|
27931
27954
|
MulticastManager,
|
|
27932
27955
|
MulticastTransport,
|
|
27933
|
-
NoneCodec,
|
|
27934
27956
|
REPAIR_LIFECYCLE_EVENT_TYPE,
|
|
27935
27957
|
REPAIR_LIFECYCLE_LOG_PREFIX,
|
|
27936
27958
|
REPAIR_PRIORITY_MAX,
|
|
27937
27959
|
REPAIR_PRIORITY_MIN,
|
|
27938
27960
|
REPAIR_TRACK_GEOMETRY_KEYS,
|
|
27939
27961
|
REPAIR_TRACK_ONLY_KEYS,
|
|
27940
|
-
ReedSolomonCodec,
|
|
27941
27962
|
RepairContractError,
|
|
27942
27963
|
SOURCE_MEDIA_PRIORITY_MAX,
|
|
27943
27964
|
SampleCombineError,
|
|
@@ -27958,6 +27979,7 @@ export {
|
|
|
27958
27979
|
buildHevcVideoInitSegment,
|
|
27959
27980
|
buildVideoInitSegment,
|
|
27960
27981
|
catalogAmtNetworkSource,
|
|
27982
|
+
catalogAtsc3NetworkSource,
|
|
27961
27983
|
catalogDeclaresFec,
|
|
27962
27984
|
catalogFecAvailable,
|
|
27963
27985
|
catalogFecDeclaresUnconfigurableInstance,
|
|
@@ -27974,7 +27996,6 @@ export {
|
|
|
27974
27996
|
computeFecDeliveryWindowMediaUnits,
|
|
27975
27997
|
computeFecDeliveryWindowMs,
|
|
27976
27998
|
computeFecLossWindowMs,
|
|
27977
|
-
createFecCodec,
|
|
27978
27999
|
createFragment,
|
|
27979
28000
|
createWasmMmtpContainerParser,
|
|
27980
28001
|
datagramMfuReassembly,
|
|
@@ -28002,6 +28023,7 @@ export {
|
|
|
28002
28023
|
extractHevcCodecDescription,
|
|
28003
28024
|
extractHevcParameterSets,
|
|
28004
28025
|
extractSpsPpsFromAvcC,
|
|
28026
|
+
fecAlgorithmUnimplemented,
|
|
28005
28027
|
findAnnexBStartCode,
|
|
28006
28028
|
forwardRepairLifecycleEvents,
|
|
28007
28029
|
frameSamplesFromInit,
|