@blockcast/mmt-transport 2.2.0-main.75b39a2cdddf → 2.2.0-main.79fd2df1f6a3
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/mmt-transport.no-modules.js +80 -9
- package/dist/mmt-transport.no-modules.js.map +3 -3
- package/dist/multicast-catalog-policy.d.ts +3 -1
- package/dist/multicast-catalog-policy.d.ts.map +1 -1
- package/dist/multicast-catalog-policy.js +27 -6
- package/dist/multicast-catalog-policy.js.map +1 -1
- package/package.json +2 -2
- package/src/multicast-catalog-policy.ts +29 -5
|
@@ -475,9 +475,12 @@
|
|
|
475
475
|
return issues;
|
|
476
476
|
const tracks = Array.isArray(catalog["tracks"]) ? catalog["tracks"] : [];
|
|
477
477
|
const namespaceOf = /* @__PURE__ */ new Map();
|
|
478
|
+
const modeOf = /* @__PURE__ */ new Map();
|
|
478
479
|
for (const track of tracks) {
|
|
479
|
-
if (isObject(track)
|
|
480
|
-
|
|
480
|
+
if (!isObject(track) || typeof track["name"] !== "string")
|
|
481
|
+
continue;
|
|
482
|
+
namespaceOf.set(track["name"], track["namespace"]);
|
|
483
|
+
modeOf.set(track["name"], track["mmtpMode"]);
|
|
481
484
|
}
|
|
482
485
|
const tagged = catalog[CATALOG_NAMESPACE];
|
|
483
486
|
let referenceNamespace = options.catalogNamespace ?? (typeof tagged === "string" ? tagged : void 0);
|
|
@@ -547,6 +550,9 @@
|
|
|
547
550
|
const name = isObject(ref) ? ref["name"] : ref;
|
|
548
551
|
if (typeof name !== "string")
|
|
549
552
|
continue;
|
|
553
|
+
if (modeOf.get(name) === "mfu-datagram") {
|
|
554
|
+
fail("multicast_track", `${at}.tracks[${refIndex}].name`, `track ${JSON.stringify(name)} is an "mfu-datagram" track, which rides no multicast endpoint; list its "mfu" sibling (draft-ramadan-moq-mmt-02 4.3.1)`);
|
|
555
|
+
}
|
|
550
556
|
const namespace = namespaceOf.get(name);
|
|
551
557
|
if (typeof namespace !== "string")
|
|
552
558
|
continue;
|
|
@@ -586,6 +592,23 @@
|
|
|
586
592
|
const ignored = new Set(issues.map((issue) => issue.endpointIndex));
|
|
587
593
|
return new Set(endpoints.map((_, index) => index).filter((index) => !ignored.has(index)));
|
|
588
594
|
}
|
|
595
|
+
function catalogAtsc3NetworkSource(networkSource) {
|
|
596
|
+
const entries = Array.isArray(networkSource) ? networkSource : networkSource ? [networkSource] : [];
|
|
597
|
+
for (const ns of entries) {
|
|
598
|
+
if (!isObject(ns))
|
|
599
|
+
continue;
|
|
600
|
+
if (ns.type !== "atsc3" || !isIntegerIn(ns.frequency, 1, Number.MAX_SAFE_INTEGER))
|
|
601
|
+
continue;
|
|
602
|
+
const slsUri = typeof ns.slsUri === "string" ? ns.slsUri.trim() : "";
|
|
603
|
+
return {
|
|
604
|
+
frequency: ns.frequency,
|
|
605
|
+
...isIntegerIn(ns.plpId, 0, 63) ? { plpId: ns.plpId } : {},
|
|
606
|
+
...isIntegerIn(ns.serviceId, 0, 65535) ? { serviceId: ns.serviceId } : {},
|
|
607
|
+
...slsUri ? { slsUri } : {}
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
return void 0;
|
|
611
|
+
}
|
|
589
612
|
|
|
590
613
|
// node_modules/@blockcast/mmt-base/dist/fec-catalog.js
|
|
591
614
|
var DEFAULT_SCHEMES = ["reed-solomon", "raptorq"];
|
|
@@ -1015,13 +1038,17 @@
|
|
|
1015
1038
|
});
|
|
1016
1039
|
return { tracks, pointers };
|
|
1017
1040
|
}
|
|
1018
|
-
function
|
|
1041
|
+
function runtimeView(catalog, receiver) {
|
|
1019
1042
|
const { tracks, pointers } = fecCatalogTracks(catalog);
|
|
1020
1043
|
const report = validateFecCatalog({ tracks }, receiver);
|
|
1021
1044
|
const at = (path) => {
|
|
1022
1045
|
const m = /^\/tracks\/(\d+)(.*)$/.exec(path);
|
|
1023
1046
|
return m ? pointers[Number(m[1])] + m[2] : path;
|
|
1024
1047
|
};
|
|
1048
|
+
return { tracks, pointers, report, at };
|
|
1049
|
+
}
|
|
1050
|
+
function resolveFecBindings(catalog, receiver = RUNTIME_FEC_RECEIVER) {
|
|
1051
|
+
const { tracks, pointers, report, at } = runtimeView(catalog, receiver);
|
|
1025
1052
|
const trackAt = (i) => recordOf(tracks[i]) ?? {};
|
|
1026
1053
|
const nameAt = (i) => i === null ? void 0 : trackAt(i)["name"];
|
|
1027
1054
|
const why = (i) => Object.freeze({
|
|
@@ -1119,6 +1146,40 @@
|
|
|
1119
1146
|
});
|
|
1120
1147
|
}
|
|
1121
1148
|
|
|
1149
|
+
// node_modules/@blockcast/mmt-base/dist/mmtp-siblings.js
|
|
1150
|
+
var MMTP_MODES = Object.freeze(["mfu", "mfu-datagram"]);
|
|
1151
|
+
var MMTP_SIBLING_HARD_FIELDS = Object.freeze([
|
|
1152
|
+
"namespace",
|
|
1153
|
+
"timescale",
|
|
1154
|
+
"presentationAnchorTicks",
|
|
1155
|
+
"groupDuration"
|
|
1156
|
+
]);
|
|
1157
|
+
var MMTP_SIBLING_RENDITION_FIELDS = Object.freeze([
|
|
1158
|
+
"codec",
|
|
1159
|
+
"width",
|
|
1160
|
+
"height",
|
|
1161
|
+
"framerate",
|
|
1162
|
+
"bitrate",
|
|
1163
|
+
"samplerate",
|
|
1164
|
+
"channelConfig",
|
|
1165
|
+
"lang"
|
|
1166
|
+
]);
|
|
1167
|
+
var MMTP_SIBLING_SOFT_FIELDS = Object.freeze([
|
|
1168
|
+
"initRef",
|
|
1169
|
+
"keyframeIntervalMs",
|
|
1170
|
+
"keyframeIntervalTicks",
|
|
1171
|
+
"isLive",
|
|
1172
|
+
"altGroup"
|
|
1173
|
+
]);
|
|
1174
|
+
|
|
1175
|
+
// node_modules/@blockcast/mmt-base/dist/datagram-leg-size.js
|
|
1176
|
+
var DATAGRAM_LEG_UDP_FLOOR = 1200;
|
|
1177
|
+
var DATAGRAM_LEG_QUIC_WT_FRAMING = 48;
|
|
1178
|
+
var DATAGRAM_LEG_OBJECT_HEADER = 13;
|
|
1179
|
+
var DATAGRAM_LEG_RELAY_ROOM = 16;
|
|
1180
|
+
var DATAGRAM_LEG_DATAGRAM_MAX = DATAGRAM_LEG_UDP_FLOOR - DATAGRAM_LEG_QUIC_WT_FRAMING;
|
|
1181
|
+
var DATAGRAM_LEG_BODY_MAX = DATAGRAM_LEG_DATAGRAM_MAX - DATAGRAM_LEG_OBJECT_HEADER - DATAGRAM_LEG_RELAY_ROOM;
|
|
1182
|
+
|
|
1122
1183
|
// src/endpoint-config.ts
|
|
1123
1184
|
function toWindowMulticastSubscribeConfig(input) {
|
|
1124
1185
|
if (input.mode !== void 0 && !["auto", "native", "tunnel"].includes(input.mode)) {
|
|
@@ -1731,8 +1792,11 @@
|
|
|
1731
1792
|
Object.assign(config, asmSenderFilter(endpoint));
|
|
1732
1793
|
const ownNetworkSource = Array.isArray(endpoint.networkSource) ? endpoint.networkSource : void 0;
|
|
1733
1794
|
const networkSource = ownNetworkSource ?? catalog?.multicast?.networkSource;
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1795
|
+
const atsc3 = config.senderAddress ? void 0 : catalogAtsc3NetworkSource(networkSource);
|
|
1796
|
+
const amt = atsc3 ? void 0 : findAmtRelay(networkSource);
|
|
1797
|
+
if (atsc3) {
|
|
1798
|
+
config.atsc3 = atsc3;
|
|
1799
|
+
} else if (amt) {
|
|
1736
1800
|
config.mode = "tunnel";
|
|
1737
1801
|
config.amtRelay = amt.relay;
|
|
1738
1802
|
config.amtRelayPort = amt.port;
|
|
@@ -1813,8 +1877,10 @@
|
|
|
1813
1877
|
const sameEndpoint = (endpoint) => endpoint.groupAddress === mediaEndpoint.groupAddress && (endpoint.sourceAddress || "") === (mediaEndpoint.sourceAddress || "") && Number(endpoint.port) === Number(mediaEndpoint.port);
|
|
1814
1878
|
const start = endpoints.findIndex(sameEndpoint);
|
|
1815
1879
|
if (start < 0) return [];
|
|
1816
|
-
const { mode, amtRelay, amtRelayPort, amtNetworkSource } = mediaConfig;
|
|
1880
|
+
const { mode, amtRelay, amtRelayPort, amtNetworkSource, atsc3 } = mediaConfig;
|
|
1817
1881
|
const transport = {
|
|
1882
|
+
// A tuned media join's repair groups ride the same RF channel.
|
|
1883
|
+
...atsc3 === void 0 ? {} : { atsc3 },
|
|
1818
1884
|
...mode === void 0 ? {} : { mode },
|
|
1819
1885
|
...amtRelay === void 0 ? {} : { amtRelay },
|
|
1820
1886
|
...amtRelayPort === void 0 ? {} : { amtRelayPort },
|
|
@@ -1840,12 +1906,14 @@
|
|
|
1840
1906
|
repairs.push({ name: track.name, packetId });
|
|
1841
1907
|
}
|
|
1842
1908
|
if (repairOwners.length === 0) continue;
|
|
1909
|
+
const sender = asmSenderFilter(endpoint);
|
|
1910
|
+
const { atsc3: _tuned, ...untuned } = transport;
|
|
1843
1911
|
companions.push({
|
|
1844
1912
|
group: endpoint.groupAddress,
|
|
1845
1913
|
source: endpoint.sourceAddress || "",
|
|
1846
|
-
...
|
|
1914
|
+
...sender,
|
|
1847
1915
|
port: Number(endpoint.port),
|
|
1848
|
-
...transport,
|
|
1916
|
+
...sender.senderAddress ? untuned : transport,
|
|
1849
1917
|
packetIds: normalizePacketIds(repairOwners.map((owner) => owner.packetId)),
|
|
1850
1918
|
repairOwners,
|
|
1851
1919
|
tracks: [...owners.map((owner) => ({ ...owner })), ...repairs]
|
|
@@ -1885,6 +1953,7 @@
|
|
|
1885
1953
|
const amtRelayPort = positivePort2(String(config.amtRelayPort ?? "")) ?? (dialableRelay ? amt?.port ?? DEFAULT_AMT_RELAY_PORT : void 0);
|
|
1886
1954
|
const packetIds = normalizePacketIds(config.packetIds);
|
|
1887
1955
|
const pendingAmt = dialableRelay ? [] : amtNetworkSourceEntries(config.amtNetworkSource);
|
|
1956
|
+
const atsc3 = config.atsc3 ? catalogAtsc3NetworkSource({ ...config.atsc3, type: "atsc3" }) : void 0;
|
|
1888
1957
|
return {
|
|
1889
1958
|
group: config.group,
|
|
1890
1959
|
source: config.source || "",
|
|
@@ -1908,13 +1977,15 @@
|
|
|
1908
1977
|
// whoever wires that resolution adds `amtNetworkSource` to
|
|
1909
1978
|
// `sameMulticastConfig` in the same change.
|
|
1910
1979
|
...pendingAmt.length > 0 ? { amtNetworkSource: pendingAmt } : {},
|
|
1980
|
+
...atsc3 ? { atsc3 } : {},
|
|
1911
1981
|
...packetIds.length > 0 ? { packetIds } : {}
|
|
1912
1982
|
};
|
|
1913
1983
|
}
|
|
1914
1984
|
function sameMulticastConfig(a, b) {
|
|
1915
1985
|
const left = normalizeMulticastConfig(a);
|
|
1916
1986
|
const right = normalizeMulticastConfig(b);
|
|
1917
|
-
return Boolean(left && right && left.group === right.group && left.source === right.source && left.port === right.port && left.mode === right.mode && left.amtRelay === right.amtRelay && (left.amtRelayPort ?? 0) === (right.amtRelayPort ?? 0) &&
|
|
1987
|
+
return Boolean(left && right && left.group === right.group && left.source === right.source && left.port === right.port && left.mode === right.mode && left.amtRelay === right.amtRelay && (left.amtRelayPort ?? 0) === (right.amtRelayPort ?? 0) && // A retune is a re-join; `slsUri` is not tuning and is ignored.
|
|
1988
|
+
left.atsc3?.frequency === right.atsc3?.frequency && left.atsc3?.plpId === right.atsc3?.plpId && left.atsc3?.serviceId === right.atsc3?.serviceId && JSON.stringify(left.packetIds ?? []) === JSON.stringify(right.packetIds ?? []));
|
|
1918
1989
|
}
|
|
1919
1990
|
function urlOverrideBlocksMulticastCandidate(candidateConfig, urlConfig = readPlayerMulticastConfig()) {
|
|
1920
1991
|
if (!urlConfig) return false;
|