@blockcast/mmt-transport 0.2.2 → 0.3.0
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 +44 -58
- package/dist/abr-controller.d.ts +34 -4
- package/dist/abr-controller.d.ts.map +1 -1
- package/dist/abr-controller.js +66 -17
- package/dist/abr-controller.js.map +1 -1
- package/dist/amt-gateway.d.ts.map +1 -1
- package/dist/amt-gateway.js +3 -4
- package/dist/amt-gateway.js.map +1 -1
- package/dist/driad-discovery.d.ts.map +1 -1
- package/dist/driad-discovery.js +3 -6
- package/dist/driad-discovery.js.map +1 -1
- package/dist/endpoint-config.d.ts +68 -0
- package/dist/endpoint-config.d.ts.map +1 -1
- package/dist/endpoint-config.js +118 -3
- package/dist/endpoint-config.js.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -11
- package/dist/index.js.map +1 -1
- package/dist/mmt-transport.no-modules.js +881 -60
- package/dist/mmt-transport.no-modules.js.map +4 -4
- package/dist/moqt-priority.d.ts +39 -0
- package/dist/moqt-priority.d.ts.map +1 -0
- package/dist/moqt-priority.js +41 -0
- package/dist/moqt-priority.js.map +1 -0
- package/dist/multicast-catalog-policy.d.ts +96 -0
- package/dist/multicast-catalog-policy.d.ts.map +1 -0
- package/dist/multicast-catalog-policy.js +660 -0
- package/dist/multicast-catalog-policy.js.map +1 -0
- package/dist/multicast-orchestrator.d.ts +24 -0
- package/dist/multicast-orchestrator.d.ts.map +1 -1
- package/dist/multicast-orchestrator.js +102 -9
- package/dist/multicast-orchestrator.js.map +1 -1
- package/dist/multicast-signaling-reconciler.d.ts +37 -0
- package/dist/multicast-signaling-reconciler.d.ts.map +1 -0
- package/dist/multicast-signaling-reconciler.js +161 -0
- package/dist/multicast-signaling-reconciler.js.map +1 -0
- package/dist/multicast-subscription-pool.d.ts.map +1 -1
- package/dist/multicast-subscription-pool.js +37 -10
- package/dist/multicast-subscription-pool.js.map +1 -1
- package/dist/multicast-tier.d.ts +19 -0
- package/dist/multicast-tier.d.ts.map +1 -1
- package/dist/multicast-tier.js +21 -4
- package/dist/multicast-tier.js.map +1 -1
- package/dist/no-modules.d.ts +40 -3
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +30 -3
- package/dist/no-modules.js.map +1 -1
- package/dist/packet-batch.d.ts +13 -0
- package/dist/packet-batch.d.ts.map +1 -0
- package/dist/packet-batch.js +14 -0
- package/dist/packet-batch.js.map +1 -0
- package/dist/stall-detector.d.ts +10 -0
- package/dist/stall-detector.d.ts.map +1 -1
- package/dist/stall-detector.js +21 -0
- package/dist/stall-detector.js.map +1 -1
- package/dist/takeover.d.ts +3 -0
- package/dist/takeover.d.ts.map +1 -1
- package/dist/takeover.js +35 -2
- package/dist/takeover.js.map +1 -1
- package/dist/transport-manager.d.ts +21 -17
- package/dist/transport-manager.d.ts.map +1 -1
- package/dist/transport-manager.js +63 -29
- package/dist/transport-manager.js.map +1 -1
- package/dist/types.d.ts +98 -123
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -50
- package/dist/types.js.map +1 -1
- package/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
- package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
- package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
- package/node_modules/@blockcast/mmt-base/README.md +134 -0
- package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +55 -0
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +128 -0
- package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts +7 -0
- package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/index.js +7 -0
- package/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +292 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js +612 -0
- package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +18 -0
- package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/net-constants.js +18 -0
- package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +47 -0
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +54 -0
- package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +57 -0
- package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/serial-number.js +98 -0
- package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +312 -0
- package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -0
- package/node_modules/@blockcast/mmt-base/dist/signalling.js +637 -0
- package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -0
- package/node_modules/@blockcast/mmt-base/package.json +49 -0
- package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +145 -0
- package/node_modules/@blockcast/mmt-base/src/index.ts +6 -0
- package/node_modules/@blockcast/mmt-base/src/mmtp.ts +892 -0
- package/node_modules/@blockcast/mmt-base/src/net-constants.ts +17 -0
- package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +67 -0
- package/node_modules/@blockcast/mmt-base/src/serial-number.ts +107 -0
- package/node_modules/@blockcast/mmt-base/src/signalling.ts +862 -0
- package/package.json +13 -6
- package/src/abr-controller.ts +81 -17
- package/src/amt-gateway.ts +3 -5
- package/src/driad-discovery.ts +3 -6
- package/src/endpoint-config.ts +157 -3
- package/src/index.ts +54 -33
- package/src/moqt-priority.ts +51 -0
- package/src/multicast-catalog-policy.ts +753 -0
- package/src/multicast-orchestrator.ts +114 -10
- package/src/multicast-signaling-reconciler.ts +156 -0
- package/src/multicast-subscription-pool.ts +46 -11
- package/src/multicast-tier.ts +30 -3
- package/src/no-modules.ts +54 -2
- package/src/packet-batch.ts +17 -0
- package/src/stall-detector.ts +37 -0
- package/src/takeover.ts +41 -3
- package/src/transport-manager.ts +64 -34
- package/src/types.ts +103 -160
- package/dist/endpoint-config.test.d.ts +0 -2
- package/dist/endpoint-config.test.d.ts.map +0 -1
- package/dist/endpoint-config.test.js +0 -39
- package/dist/endpoint-config.test.js.map +0 -1
- package/dist/fec-client.d.ts +0 -442
- package/dist/fec-client.d.ts.map +0 -1
- package/dist/fec-client.js +0 -789
- package/dist/fec-client.js.map +0 -1
- package/dist/fec-client.test.d.ts +0 -8
- package/dist/fec-client.test.d.ts.map +0 -1
- package/dist/fec-client.test.js +0 -112
- package/dist/fec-client.test.js.map +0 -1
- package/dist/multicast-subscription-pool.test.d.ts +0 -2
- package/dist/multicast-subscription-pool.test.d.ts.map +0 -1
- package/dist/multicast-subscription-pool.test.js +0 -108
- package/dist/multicast-subscription-pool.test.js.map +0 -1
- package/dist/multicast-tier.test.d.ts +0 -2
- package/dist/multicast-tier.test.d.ts.map +0 -1
- package/dist/multicast-tier.test.js +0 -75
- package/dist/multicast-tier.test.js.map +0 -1
- package/dist/stall-detector.test.d.ts +0 -2
- package/dist/stall-detector.test.d.ts.map +0 -1
- package/dist/stall-detector.test.js +0 -33
- package/dist/stall-detector.test.js.map +0 -1
- package/dist/transport-manager.test.d.ts +0 -2
- package/dist/transport-manager.test.d.ts.map +0 -1
- package/dist/transport-manager.test.js +0 -155
- package/dist/transport-manager.test.js.map +0 -1
- package/src/endpoint-config.test.ts +0 -54
- package/src/fec-client.test.ts +0 -140
- package/src/fec-client.ts +0 -1103
- package/src/multicast-subscription-pool.test.ts +0 -115
- package/src/multicast-tier.test.ts +0 -80
- package/src/stall-detector.test.ts +0 -34
- package/src/transport-manager.test.ts +0 -192
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { WindowMulticastSubscribeConfig } from "./types.js";
|
|
1
2
|
export type MulticastTransportPreference = "auto" | "native" | "tunnel";
|
|
3
|
+
export { DEFAULT_AMT_RELAY_PORT } from "@blockcast/mmt-base";
|
|
2
4
|
export interface MulticastEndpointConfig {
|
|
3
5
|
groupAddress: string;
|
|
4
6
|
sourceAddress?: string;
|
|
@@ -7,14 +9,80 @@ export interface MulticastEndpointConfig {
|
|
|
7
9
|
amtRelay?: string;
|
|
8
10
|
amtRelayPort?: number;
|
|
9
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Input accepted by the canonical window.multicast request converter.
|
|
14
|
+
*
|
|
15
|
+
* `mode` and the `amtRelay*` fields are internal endpoint-selection state;
|
|
16
|
+
* they are deliberately not emitted on the page-facing request. The
|
|
17
|
+
* resulting `origin` is the only acquisition selector understood by the
|
|
18
|
+
* gateway.
|
|
19
|
+
*/
|
|
20
|
+
export interface WindowMulticastEndpointInput {
|
|
21
|
+
group: string;
|
|
22
|
+
port: number;
|
|
23
|
+
source?: string;
|
|
24
|
+
mode?: MulticastTransportPreference;
|
|
25
|
+
amtRelay?: string;
|
|
26
|
+
amtRelayPort?: number;
|
|
27
|
+
packetIds?: readonly number[];
|
|
28
|
+
tracks?: ReadonlyArray<{
|
|
29
|
+
name: string;
|
|
30
|
+
packetId: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Convert internal endpoint-selection state to the canonical page contract.
|
|
35
|
+
*
|
|
36
|
+
* Native is the default and an explicit `native` selection always wins over
|
|
37
|
+
* stale relay metadata. Tunnel/AMT requests must carry the resolved relay
|
|
38
|
+
* and port; there is no implicit relay-port default at this boundary.
|
|
39
|
+
*
|
|
40
|
+
* That rule is deliberate and is NOT the place to fix a relay that names no
|
|
41
|
+
* port: this is the last hop before the page-facing request, so a default
|
|
42
|
+
* applied here would be invisible to every caller and to the join it produces.
|
|
43
|
+
* A catalog relay with no port gets `DEFAULT_AMT_RELAY_PORT` upstream, in the
|
|
44
|
+
* readers that resolve it, and arrives here explicit like any other
|
|
45
|
+
* (BLO-38176).
|
|
46
|
+
*/
|
|
47
|
+
export declare function toWindowMulticastSubscribeConfig(input: WindowMulticastEndpointInput): WindowMulticastSubscribeConfig;
|
|
10
48
|
export declare function isValidMulticastGroupAddress(address: string | undefined): boolean;
|
|
11
49
|
export declare function normalizeMulticastEndpoint(endpoint: MulticastEndpointConfig): MulticastEndpointConfig | undefined;
|
|
12
50
|
/** Stable ownership key for one IWA multicast/AMT subscription. */
|
|
13
51
|
export declare function multicastEndpointKey(endpoint: MulticastEndpointConfig): string;
|
|
52
|
+
/**
|
|
53
|
+
* True when `value` may be advertised as a multicast track's MMTP `packet_id`:
|
|
54
|
+
* an integer in 1..MMTP_PACKET_ID_MAX. packet_id 0 (MMTP_SIGNALING_PACKET_ID)
|
|
55
|
+
* is the MMTP signaling flow -- the FFmpeg `moq_mmt` muxer sends the AL-FEC
|
|
56
|
+
* message (0x0203) on it into the same group as the media -- so it is never a
|
|
57
|
+
* track's. Only a number qualifies: a string, boolean or null is not coerced.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isMulticastTrackPacketId(value: unknown): value is number;
|
|
14
60
|
export declare function isUsableMulticastEndpoint(endpoint: {
|
|
15
61
|
groupAddress?: string;
|
|
16
62
|
port?: unknown;
|
|
17
63
|
} | undefined): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Reject a URL multicast override that still carries a retired unprefixed alias.
|
|
66
|
+
*
|
|
67
|
+
* Both URL readers call this only once a valid override is established (a valid
|
|
68
|
+
* multicast `mc_group` and a valid `mc_port`; `readUrlMulticastConfig` also
|
|
69
|
+
* requires the whole endpoint to normalize), which is where they used to read
|
|
70
|
+
* the aliases: a link that
|
|
71
|
+
* relied on one fails here with its replacement named, instead of silently
|
|
72
|
+
* losing its AMT relay (and, in `readUrlMulticastConfig`, its tunnel mode).
|
|
73
|
+
* Presence is the error, whatever the value and whether or not the `mc_` form
|
|
74
|
+
* is also present: quietly preferring one of two keys is the tolerant read being
|
|
75
|
+
* retired. Outside an override the readers read no override key at all, the
|
|
76
|
+
* `mc_` forms included, so the bare names are left to the page; they are live
|
|
77
|
+
* page parameters elsewhere, and keeping clear of those is what the `mc_`
|
|
78
|
+
* namespace is for.
|
|
79
|
+
*/
|
|
80
|
+
export declare function assertNoRetiredMulticastUrlParams(params: URLSearchParams): void;
|
|
81
|
+
/**
|
|
82
|
+
* Read an explicit multicast endpoint override from `mc_*` URL parameters.
|
|
83
|
+
* Throws when an override carries a retired unprefixed alias
|
|
84
|
+
* (`assertNoRetiredMulticastUrlParams`).
|
|
85
|
+
*/
|
|
18
86
|
export declare function readUrlMulticastConfig(search?: string | URLSearchParams): MulticastEndpointConfig | undefined;
|
|
19
87
|
export declare function isMulticastExplicitlyDisabled(search?: string | URLSearchParams): boolean;
|
|
20
88
|
//# sourceMappingURL=endpoint-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-config.d.ts","sourceRoot":"","sources":["../src/endpoint-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint-config.d.ts","sourceRoot":"","sources":["../src/endpoint-config.ts"],"names":[],"mappings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KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAIxE;AAED,wBAAgB,yBAAyB,CACxC,QAAQ,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAC7D,OAAO,CAGT;AAWD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAQ/E;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,GAAE,MAAM,GAAG,eAAwE,GACvF,uBAAuB,GAAG,SAAS,CAwBrC;AAED,wBAAgB,6BAA6B,CAC5C,MAAM,GAAE,MAAM,GAAG,eAAwE,GACvF,OAAO,CAKT"}
|
package/dist/endpoint-config.js
CHANGED
|
@@ -1,3 +1,64 @@
|
|
|
1
|
+
import { MMTP_PACKET_ID_MAX, MMTP_SIGNALING_PACKET_ID } from "@blockcast/mmt-base";
|
|
2
|
+
export { DEFAULT_AMT_RELAY_PORT } from "@blockcast/mmt-base";
|
|
3
|
+
/**
|
|
4
|
+
* Convert internal endpoint-selection state to the canonical page contract.
|
|
5
|
+
*
|
|
6
|
+
* Native is the default and an explicit `native` selection always wins over
|
|
7
|
+
* stale relay metadata. Tunnel/AMT requests must carry the resolved relay
|
|
8
|
+
* and port; there is no implicit relay-port default at this boundary.
|
|
9
|
+
*
|
|
10
|
+
* That rule is deliberate and is NOT the place to fix a relay that names no
|
|
11
|
+
* port: this is the last hop before the page-facing request, so a default
|
|
12
|
+
* applied here would be invisible to every caller and to the join it produces.
|
|
13
|
+
* A catalog relay with no port gets `DEFAULT_AMT_RELAY_PORT` upstream, in the
|
|
14
|
+
* readers that resolve it, and arrives here explicit like any other
|
|
15
|
+
* (BLO-38176).
|
|
16
|
+
*/
|
|
17
|
+
export function toWindowMulticastSubscribeConfig(input) {
|
|
18
|
+
if (input.mode !== undefined && !["auto", "native", "tunnel"].includes(input.mode)) {
|
|
19
|
+
throw new TypeError(`Unsupported multicast mode: ${String(input.mode)}`);
|
|
20
|
+
}
|
|
21
|
+
// An explicit non-array (the null "endpoint unusable" sentinel from
|
|
22
|
+
// selectEndpointPacketIdsForTracks) must not degrade into "no filter".
|
|
23
|
+
if (input.packetIds !== undefined && !Array.isArray(input.packetIds)) {
|
|
24
|
+
throw new TypeError(`multicast packetIds must be an array, got ${input.packetIds === null ? "null" : typeof input.packetIds}`);
|
|
25
|
+
}
|
|
26
|
+
// Every join request passes through here, so the track packet_id range is
|
|
27
|
+
// enforced here rather than trusted from each caller.
|
|
28
|
+
if (input.packetIds?.some(id => !isMulticastTrackPacketId(id)) ||
|
|
29
|
+
input.tracks?.some(track => !isMulticastTrackPacketId(track.packetId))) {
|
|
30
|
+
throw new RangeError(`multicast packetId must be an integer from 1 to ${MMTP_PACKET_ID_MAX}; ` +
|
|
31
|
+
"packetId 0 is the MMTP signaling flow and is never a track's");
|
|
32
|
+
}
|
|
33
|
+
const base = {
|
|
34
|
+
group: input.group,
|
|
35
|
+
port: input.port,
|
|
36
|
+
...(input.source?.trim() ? { source: input.source.trim() } : {}),
|
|
37
|
+
consume: "bytes",
|
|
38
|
+
...(input.packetIds?.length ? { packetIds: [...input.packetIds] } : {}),
|
|
39
|
+
};
|
|
40
|
+
const relay = input.amtRelay?.trim();
|
|
41
|
+
const wantsAmt = input.mode === "tunnel" ||
|
|
42
|
+
(input.mode !== "native" && relay !== undefined && relay !== "");
|
|
43
|
+
if (!wantsAmt) {
|
|
44
|
+
const native = {
|
|
45
|
+
...base,
|
|
46
|
+
origin: "ip-multicast",
|
|
47
|
+
...(input.tracks?.length ? { tracks: input.tracks.map(({ name, packetId }) => ({ name, packetId })) } : {}),
|
|
48
|
+
};
|
|
49
|
+
return native;
|
|
50
|
+
}
|
|
51
|
+
const relayPort = input.amtRelayPort;
|
|
52
|
+
if (!relay || relayPort === undefined || !isPositivePort(relayPort)) {
|
|
53
|
+
throw new TypeError("AMT requires a resolved relay and a valid relay port");
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...base,
|
|
57
|
+
origin: "amt",
|
|
58
|
+
relay,
|
|
59
|
+
relayPort,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
1
62
|
export function isValidMulticastGroupAddress(address) {
|
|
2
63
|
const value = address?.trim().toLowerCase();
|
|
3
64
|
if (!value)
|
|
@@ -48,21 +109,69 @@ export function multicastEndpointKey(endpoint) {
|
|
|
48
109
|
normalized.amtRelayPort ?? "",
|
|
49
110
|
]);
|
|
50
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* True when `value` may be advertised as a multicast track's MMTP `packet_id`:
|
|
114
|
+
* an integer in 1..MMTP_PACKET_ID_MAX. packet_id 0 (MMTP_SIGNALING_PACKET_ID)
|
|
115
|
+
* is the MMTP signaling flow -- the FFmpeg `moq_mmt` muxer sends the AL-FEC
|
|
116
|
+
* message (0x0203) on it into the same group as the media -- so it is never a
|
|
117
|
+
* track's. Only a number qualifies: a string, boolean or null is not coerced.
|
|
118
|
+
*/
|
|
119
|
+
export function isMulticastTrackPacketId(value) {
|
|
120
|
+
return Number.isInteger(value) &&
|
|
121
|
+
value > MMTP_SIGNALING_PACKET_ID &&
|
|
122
|
+
value <= MMTP_PACKET_ID_MAX;
|
|
123
|
+
}
|
|
51
124
|
export function isUsableMulticastEndpoint(endpoint) {
|
|
52
125
|
const port = Number(endpoint?.port);
|
|
53
126
|
return isValidMulticastGroupAddress(endpoint?.groupAddress) && isPositivePort(port);
|
|
54
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Unprefixed aliases of the `mc_` URL override keys, retired in BLO-37507, each
|
|
130
|
+
* paired with the key that replaces it.
|
|
131
|
+
*/
|
|
132
|
+
const RETIRED_MULTICAST_URL_PARAMS = [
|
|
133
|
+
["amt_relay", "mc_amt_relay"],
|
|
134
|
+
["amt_relay_port", "mc_amt_relay_port"],
|
|
135
|
+
];
|
|
136
|
+
/**
|
|
137
|
+
* Reject a URL multicast override that still carries a retired unprefixed alias.
|
|
138
|
+
*
|
|
139
|
+
* Both URL readers call this only once a valid override is established (a valid
|
|
140
|
+
* multicast `mc_group` and a valid `mc_port`; `readUrlMulticastConfig` also
|
|
141
|
+
* requires the whole endpoint to normalize), which is where they used to read
|
|
142
|
+
* the aliases: a link that
|
|
143
|
+
* relied on one fails here with its replacement named, instead of silently
|
|
144
|
+
* losing its AMT relay (and, in `readUrlMulticastConfig`, its tunnel mode).
|
|
145
|
+
* Presence is the error, whatever the value and whether or not the `mc_` form
|
|
146
|
+
* is also present: quietly preferring one of two keys is the tolerant read being
|
|
147
|
+
* retired. Outside an override the readers read no override key at all, the
|
|
148
|
+
* `mc_` forms included, so the bare names are left to the page; they are live
|
|
149
|
+
* page parameters elsewhere, and keeping clear of those is what the `mc_`
|
|
150
|
+
* namespace is for.
|
|
151
|
+
*/
|
|
152
|
+
export function assertNoRetiredMulticastUrlParams(params) {
|
|
153
|
+
for (const [retired, replacement] of RETIRED_MULTICAST_URL_PARAMS) {
|
|
154
|
+
if (params.has(retired)) {
|
|
155
|
+
throw new Error(`multicast URL override: query parameter "${retired}" is retired; use "${replacement}"`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Read an explicit multicast endpoint override from `mc_*` URL parameters.
|
|
161
|
+
* Throws when an override carries a retired unprefixed alias
|
|
162
|
+
* (`assertNoRetiredMulticastUrlParams`).
|
|
163
|
+
*/
|
|
55
164
|
export function readUrlMulticastConfig(search = typeof location === "undefined" ? "" : location.search) {
|
|
56
165
|
const params = typeof search === "string" ? new URLSearchParams(search) : search;
|
|
57
166
|
const groupAddress = params.get("mc_group") || "";
|
|
58
167
|
const port = positivePort(params.get("mc_port"));
|
|
59
168
|
if (!groupAddress || !port)
|
|
60
169
|
return undefined;
|
|
61
|
-
const amtRelay = params.get("mc_amt_relay") ||
|
|
62
|
-
const amtRelayPort = positivePort(params.get("mc_amt_relay_port")
|
|
170
|
+
const amtRelay = params.get("mc_amt_relay") || undefined;
|
|
171
|
+
const amtRelayPort = positivePort(params.get("mc_amt_relay_port"));
|
|
63
172
|
const requestedMode = params.get("mc_mode");
|
|
64
173
|
const mode = amtRelay ? "tunnel" : multicastMode(requestedMode);
|
|
65
|
-
|
|
174
|
+
const endpoint = normalizeMulticastEndpoint({
|
|
66
175
|
groupAddress,
|
|
67
176
|
sourceAddress: params.get("mc_source") || undefined,
|
|
68
177
|
port,
|
|
@@ -70,6 +179,12 @@ export function readUrlMulticastConfig(search = typeof location === "undefined"
|
|
|
70
179
|
...(amtRelay ? { amtRelay } : {}),
|
|
71
180
|
...(amtRelayPort ? { amtRelayPort } : {}),
|
|
72
181
|
});
|
|
182
|
+
// An endpoint that does not normalize (e.g. a non-multicast mc_group) is no
|
|
183
|
+
// override, so the page keeps its own bare names; the same scope
|
|
184
|
+
// readPlayerMulticastConfig applies by validating the group first.
|
|
185
|
+
if (endpoint)
|
|
186
|
+
assertNoRetiredMulticastUrlParams(params);
|
|
187
|
+
return endpoint;
|
|
73
188
|
}
|
|
74
189
|
export function isMulticastExplicitlyDisabled(search = typeof location === "undefined" ? "" : location.search) {
|
|
75
190
|
const params = typeof search === "string" ? new URLSearchParams(search) : search;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-config.js","sourceRoot":"","sources":["../src/endpoint-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint-config.js","sourceRoot":"","sources":["../src/endpoint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAQnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AA8B7D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gCAAgC,CAC/C,KAAmC;IAEnC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ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zC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IACnC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,CAAC;AAC5D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,20 +22,22 @@
|
|
|
22
22
|
* - Unified FEC/ABR pipeline across all transport modes
|
|
23
23
|
* - A/V synchronization via SharedClock
|
|
24
24
|
*/
|
|
25
|
-
export type { TransportConfig, TransportSubscription, QualityLevel, TransportCapabilities, TransportMode, TransportState, DRIADRelay, AmtRelayInfo, GroupKey, PacketMetadata,
|
|
26
|
-
export {
|
|
25
|
+
export type { TransportConfig, TransportConnectConfig, TransportSubscription, QualityLevel, TransportCapabilities, TransportMode, TransportState, DRIADRelay, AmtRelayInfo, GroupKey, PacketMetadata, Micro, SyncDecision, WindowMulticastSubscribeConfig, WindowMulticastSubscribeConfigBytes, WindowMulticastSubscribeConfigAmt, WindowMulticastSubscriptionState, WindowMulticastSubscriptionEventMap, WindowMulticastSubscription, WindowMulticastDelivery, WindowMulticastCapabilities, WindowMulticastGateway, MulticastTransportMode, MulticastConfig, PacketSource, SubscriptionState, SubscriptionStats, MulticastSubscriptionHandle, MulticastBridge, MoqFecConfig, RepairObjectHeader, } from "./types.js";
|
|
26
|
+
export { repairTrackPath, MoqFecAlgorithm, } from "./types.js";
|
|
27
27
|
export { TransportManager, transportManager } from "./transport-manager.js";
|
|
28
|
-
export { SSMTransportManager, ssmTransport } from "./transport-manager.js";
|
|
29
28
|
export { DRIADDiscovery, driadDiscovery } from "./driad-discovery.js";
|
|
30
|
-
export { AdaptiveBitrateController, QUALITY_LEVELS, type FecStatsForAbr, } from "./abr-controller.js";
|
|
29
|
+
export { AdaptiveBitrateController, validateQualityLadder, type AdaptiveBitrateControllerOptions, QUALITY_LEVELS, type FecStatsForAbr, } from "./abr-controller.js";
|
|
31
30
|
export { endpointKey, selectMulticastTier, type MulticastTierEndpoint, } from "./multicast-tier.js";
|
|
32
|
-
export { MulticastOrchestrator, DEFAULT_DWELL_MS, DEFAULT_JOIN_DEADLINE_MS, goodputFromStats, type GoodputSample, type MulticastTierPacket, type OrchestratorCommand, type OrchestratorOptions, type OrchestratorState, } from "./multicast-orchestrator.js";
|
|
33
|
-
export {
|
|
31
|
+
export { MulticastOrchestrator, DEFAULT_DWELL_MS, DEFAULT_JOIN_DEADLINE_MS, goodputFromStats, type GoodputSample, type HeadroomSample, type MulticastTierPacket, type OrchestratorCommand, type OrchestratorOptions, type OrchestratorState, } from "./multicast-orchestrator.js";
|
|
32
|
+
export { createMulticastSignalingReconciler, normalizeCatalogEndpoints, type MulticastSignalingEndpoint, } from "./multicast-signaling-reconciler.js";
|
|
33
|
+
export { catalogTierEndpoints, endpointCarriesMedia, endpointToMulticastConfig, hasMulticastCatalogBaseline, hasUnicastMediaRenditions, isMulticastOnlyCatalog, isRecoverableMulticastSignalReadError, mergeUrlMulticastPolicy, normalizeMulticastConfig, readPlayerMulticastConfig, requiresMulticastCapability, sameMulticastConfig, selectEndpointPacketIds, selectEndpointPacketIdsForTracks, selectMulticastCandidate, selectMulticastCandidateForTracks, urlOverrideBlocksMulticastCandidate, withMulticastEndpoints, catalogQualityLadder, type PlayerMulticastConfig, type MulticastTrackSelection, } from "./multicast-catalog-policy.js";
|
|
34
|
+
export { isMulticastExplicitlyDisabled, isMulticastTrackPacketId, isUsableMulticastEndpoint, isValidMulticastGroupAddress, multicastEndpointKey, normalizeMulticastEndpoint, readUrlMulticastConfig, toWindowMulticastSubscribeConfig, type MulticastEndpointConfig, type MulticastTransportPreference, type WindowMulticastEndpointInput, } from "./endpoint-config.js";
|
|
35
|
+
export { subscriptionDeliversPacketBatches } from "./packet-batch.js";
|
|
34
36
|
export { MulticastSubscriptionPool, multicastSubscriptionPool, type MulticastSubscriptionConsumer, type MulticastSubscriptionLease, } from "./multicast-subscription-pool.js";
|
|
35
|
-
export { TransportStallDetector, type FecProgressSnapshot, type StallDetectorConfig, } from "./stall-detector.js";
|
|
37
|
+
export { classifyStall, TransportStallDetector, type FecProgressSnapshot, type PlayerStallClassification, type PlayerStallSnapshot, type StallDetectorConfig, } from "./stall-detector.js";
|
|
36
38
|
export { makeSourceSwitchHandler, wireStallDetector, wireStarvationDetector, type ActivatableSessions, type FecStarvationSnapshot, type LossArcSession, type StallDetectorLike, type StarvationDetectorLike, } from "./takeover.js";
|
|
37
39
|
export { runUnicastFallback, type FallbackBroadcast, type FallbackBroadcastLike, type FallbackGroup, type FallbackGroupLike, type FallbackSessionManagerLike, type FallbackSessions, type FallbackSubscription, type FallbackSubLike, type FallbackTrack, } from "./unicast-fallback.js";
|
|
40
|
+
export { MOQT_PUBLISHER_PRIORITY, MOQT_SUBSCRIBER_PRIORITY, moqtPublisherPriority, type MoqtPublisherPriority, moqtSubscriberPriority, type MoqtSubscriberPriority, } from "./moqt-priority.js";
|
|
38
41
|
export { AMTGatewayManager, AMTGateway, amtGatewayManager, type AMTSubscriptionConfig, type AMTGatewayOptions, } from "./amt-gateway.js";
|
|
39
|
-
export { MmtFecClient, createMulticastFecHandler, setupMmtFec, MoqFecClient, createMoqFecClient, loadMmtWasm, type MoqFecClientConfig, type MoqFecClientStats, type FecDecoderConfig, } from "./fec-client.js";
|
|
40
42
|
export { SharedClock, getSharedClock, resetSharedClock, SYNC_TOLERANCE_US, PTS_OFFSET_US, } from "./clock.js";
|
|
41
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,YAAY,EACX,eAAe,E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AClB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,aAAa,GAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,sBAAsB,EACtB,KAAK,sBAAsB,GAC3B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACN,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACN,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACb,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,28 +23,25 @@
|
|
|
23
23
|
* - A/V synchronization via SharedClock
|
|
24
24
|
*/
|
|
25
25
|
// FEC constants and utilities per draft-ramadan-moq-fec-00
|
|
26
|
-
export {
|
|
27
|
-
// Transport Manager (renamed from SSMTransportManager)
|
|
26
|
+
export { repairTrackPath, MoqFecAlgorithm, } from "./types.js";
|
|
28
27
|
export { TransportManager, transportManager } from "./transport-manager.js";
|
|
29
|
-
// @deprecated - Use TransportManager and transportManager instead
|
|
30
|
-
export { SSMTransportManager, ssmTransport } from "./transport-manager.js";
|
|
31
28
|
// DRIAD Discovery
|
|
32
29
|
export { DRIADDiscovery, driadDiscovery } from "./driad-discovery.js";
|
|
33
30
|
// Adaptive Bitrate Controller
|
|
34
|
-
export { AdaptiveBitrateController, QUALITY_LEVELS, } from "./abr-controller.js";
|
|
31
|
+
export { AdaptiveBitrateController, validateQualityLadder, QUALITY_LEVELS, } from "./abr-controller.js";
|
|
35
32
|
export { endpointKey, selectMulticastTier, } from "./multicast-tier.js";
|
|
36
33
|
export { MulticastOrchestrator, DEFAULT_DWELL_MS, DEFAULT_JOIN_DEADLINE_MS, goodputFromStats, } from "./multicast-orchestrator.js";
|
|
37
|
-
export {
|
|
34
|
+
export { createMulticastSignalingReconciler, normalizeCatalogEndpoints, } from "./multicast-signaling-reconciler.js";
|
|
35
|
+
export { catalogTierEndpoints, endpointCarriesMedia, endpointToMulticastConfig, hasMulticastCatalogBaseline, hasUnicastMediaRenditions, isMulticastOnlyCatalog, isRecoverableMulticastSignalReadError, mergeUrlMulticastPolicy, normalizeMulticastConfig, readPlayerMulticastConfig, requiresMulticastCapability, sameMulticastConfig, selectEndpointPacketIds, selectEndpointPacketIdsForTracks, selectMulticastCandidate, selectMulticastCandidateForTracks, urlOverrideBlocksMulticastCandidate, withMulticastEndpoints, catalogQualityLadder, } from "./multicast-catalog-policy.js";
|
|
36
|
+
export { isMulticastExplicitlyDisabled, isMulticastTrackPacketId, isUsableMulticastEndpoint, isValidMulticastGroupAddress, multicastEndpointKey, normalizeMulticastEndpoint, readUrlMulticastConfig, toWindowMulticastSubscribeConfig, } from "./endpoint-config.js";
|
|
37
|
+
export { subscriptionDeliversPacketBatches } from "./packet-batch.js";
|
|
38
38
|
export { MulticastSubscriptionPool, multicastSubscriptionPool, } from "./multicast-subscription-pool.js";
|
|
39
|
-
export { TransportStallDetector, } from "./stall-detector.js";
|
|
39
|
+
export { classifyStall, TransportStallDetector, } from "./stall-detector.js";
|
|
40
40
|
export { makeSourceSwitchHandler, wireStallDetector, wireStarvationDetector, } from "./takeover.js";
|
|
41
41
|
export { runUnicastFallback, } from "./unicast-fallback.js";
|
|
42
|
+
export { MOQT_PUBLISHER_PRIORITY, MOQT_SUBSCRIBER_PRIORITY, moqtPublisherPriority, moqtSubscriberPriority, } from "./moqt-priority.js";
|
|
42
43
|
// AMT Gateway
|
|
43
44
|
export { AMTGatewayManager, AMTGateway, amtGatewayManager, } from "./amt-gateway.js";
|
|
44
|
-
// FEC Client
|
|
45
|
-
export { MmtFecClient, createMulticastFecHandler, setupMmtFec,
|
|
46
|
-
// MoQ FEC Client (for WebTransport)
|
|
47
|
-
MoqFecClient, createMoqFecClient, loadMmtWasm, } from "./fec-client.js";
|
|
48
45
|
// A/V Sync Clock
|
|
49
46
|
export { SharedClock, getSharedClock, resetSharedClock, SYNC_TOLERANCE_US, PTS_OFFSET_US, } from "./clock.js";
|
|
50
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAuCH,2DAA2D;AAC3D,OAAO,EACN,eAAe,EACf,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtE,8BAA8B;AAC9B,OAAO,EACN,yBAAyB,EACzB,qBAAqB,EAErB,cAAc,GAEd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,WAAW,EACX,mBAAmB,GAEnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,GAOhB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACN,kCAAkC,EAClC,yBAAyB,GAEzB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,qCAAqC,EACrC,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,E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