@blockcast/mmt-container 2.2.0-main.e1bebe787bc9 → 2.2.0-main.ea9223dc11de
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/block-policy.d.ts +33 -3
- package/dist/block-policy.d.ts.map +1 -1
- package/dist/block-policy.js +60 -24
- package/dist/block-policy.js.map +3 -3
- package/dist/browser-runtime.js +1034 -126
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +40 -1
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +163 -10
- package/dist/carp-catalog.js.map +4 -4
- package/dist/catalog-fec-params.js +34 -0
- package/dist/catalog-fec-params.js.map +3 -3
- package/dist/catalog-network-source.js +34 -0
- package/dist/catalog-network-source.js.map +3 -3
- package/dist/datagram-leg-deadline.d.ts +138 -0
- package/dist/datagram-leg-deadline.d.ts.map +1 -0
- package/dist/datagram-leg-deadline.js +229 -0
- package/dist/datagram-leg-deadline.js.map +7 -0
- package/dist/delivery-catalog.js +68 -0
- package/dist/delivery-catalog.js.map +4 -4
- package/dist/delta-fallback-config.js +34 -0
- package/dist/delta-fallback-config.js.map +3 -3
- package/dist/fec-manager.d.ts +117 -13
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +358 -42
- package/dist/fec-manager.js.map +4 -4
- package/dist/fec-state.d.ts +17 -5
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +36 -0
- package/dist/fec-state.js.map +3 -3
- package/dist/fec-worker-setup.js +34 -0
- package/dist/fec-worker-setup.js.map +3 -3
- package/dist/held-layer-admission.js +34 -0
- package/dist/held-layer-admission.js.map +3 -3
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +16 -0
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +62 -0
- package/dist/iso-block-locator.js.map +3 -3
- package/dist/mfu-reassembler.js +34 -0
- package/dist/mfu-reassembler.js.map +3 -3
- package/dist/mmtp-container-parser.d.ts +6 -3
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +34 -0
- package/dist/mmtp-container-parser.js.map +3 -3
- package/dist/mmtp-container-parser.no-modules.js +167 -13
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +34 -0
- package/dist/mmtp-decode-pipeline.js.map +3 -3
- package/dist/mmtp-fec-session.js +34 -0
- package/dist/mmtp-fec-session.js.map +3 -3
- package/dist/mmtp-mode-selection.d.ts +48 -0
- package/dist/mmtp-mode-selection.d.ts.map +1 -0
- package/dist/mmtp-mode-selection.js +79 -0
- package/dist/mmtp-mode-selection.js.map +7 -0
- package/dist/mmtp-router.d.ts +66 -10
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +204 -30
- package/dist/mmtp-router.js.map +4 -4
- package/dist/multicast-auth-catalog.js +42 -2
- package/dist/multicast-auth-catalog.js.map +3 -3
- package/dist/multicast-input.js +42 -2
- package/dist/multicast-input.js.map +3 -3
- package/dist/multicast-manager.d.ts +95 -1
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +613 -92
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.js +68 -0
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +34 -0
- package/dist/multicast-unwrap.js.map +3 -3
- package/dist/no-modules.js +167 -13
- package/dist/no-modules.js.map +4 -4
- package/dist/phase14-catalog-override.d.ts +2 -1
- package/dist/phase14-catalog-override.d.ts.map +1 -1
- package/dist/phase14-catalog-override.js +69 -2
- package/dist/phase14-catalog-override.js.map +3 -3
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +50 -0
- package/dist/repair-fetch.js.map +3 -3
- package/dist/repair-layer-subscriptions.js +34 -0
- package/dist/repair-layer-subscriptions.js.map +3 -3
- package/dist/signaling.js +34 -0
- package/dist/signaling.js.map +3 -3
- package/dist/timestamp-codec.js +34 -0
- package/dist/timestamp-codec.js.map +3 -3
- package/dist/wasm-mfu-reassembler.js +34 -0
- package/dist/wasm-mfu-reassembler.js.map +3 -3
- package/dist/wasm-mmtp-container-parser.js +34 -0
- package/dist/wasm-mmtp-container-parser.js.map +3 -3
- package/package.json +5 -5
- package/schemas/catalog.schema.json +2 -2
- package/src/block-policy.ts +108 -31
- package/src/carp-catalog.ts +165 -5
- package/src/datagram-leg-deadline.ts +370 -0
- package/src/fec-manager.ts +345 -33
- package/src/fec-state.ts +21 -5
- package/src/index.ts +37 -0
- package/src/iso-block-locator.ts +34 -0
- package/src/mmtp-container-parser.ts +6 -4
- package/src/mmtp-mode-selection.ts +80 -0
- package/src/mmtp-router.ts +226 -45
- package/src/multicast-manager.ts +126 -0
- package/src/phase14-catalog-override.ts +14 -3
- package/src/repair-fetch.ts +23 -0
- package/test-vectors/catalog/README.md +36 -2
- package/test-vectors/catalog/mmtp-siblings/ambiguous-sibling.json +158 -0
- package/test-vectors/catalog/mmtp-siblings/ladder-bitrate-only.json +231 -0
- package/test-vectors/catalog/mmtp-siblings/ladder-four-rungs.json +405 -0
- package/test-vectors/catalog/mmtp-siblings/ladder-other-names.json +231 -0
- package/test-vectors/catalog/mmtp-siblings/mmtp-mode-unknown.json +143 -0
- package/test-vectors/catalog/mmtp-siblings/multicast-endpoint-lists-datagram-track.json +143 -0
- package/test-vectors/catalog/mmtp-siblings/no-sibling.json +79 -0
- package/test-vectors/catalog/mmtp-siblings/rendition-mismatch.json +143 -0
- package/test-vectors/catalog/mmtp-siblings/stream-delivery-mode.json +143 -0
- package/test-vectors/catalog/mmtp-siblings/timescale-mismatch.json +143 -0
- package/test-vectors/catalog/mmtp-siblings/valid-pair.json +142 -0
- package/test-vectors/catalog/section-codes.json +3 -3
- package/test-vectors/catalog-timing.json +742 -1
- package/test-vectors/catalog-validation.json +266 -7
- package/test-vectors/moq/mmtp-mode-selection.json +259 -0
package/src/multicast-manager.ts
CHANGED
|
@@ -215,6 +215,13 @@ export interface MulticastEndpointConfig {
|
|
|
215
215
|
keyframeIntervalTicks?: number;
|
|
216
216
|
/** Raw catalog `keyframeIntervalMs` (never a resolved cadence). */
|
|
217
217
|
keyframeIntervalMs?: number;
|
|
218
|
+
/**
|
|
219
|
+
* The track's catalog group duration in ms (`catalogGroupDurationMs`). An
|
|
220
|
+
* "mfu-datagram" leg's duplicate ledgers remember a packet for the block
|
|
221
|
+
* span, the reorder tolerance and one group; pass it for every leg track,
|
|
222
|
+
* audio included, which has no keyframe interval to stand in for it.
|
|
223
|
+
*/
|
|
224
|
+
groupDurationMs?: number;
|
|
218
225
|
/** Catalog-derived lower bound for packet-silence failback (for example, keyframe repair cadence). */
|
|
219
226
|
minimumFailbackWindowMs?: number;
|
|
220
227
|
}
|
|
@@ -580,6 +587,11 @@ export interface BlockPolicyStats {
|
|
|
580
587
|
stalls: number;
|
|
581
588
|
concealedBlocks: number;
|
|
582
589
|
concealedGaps: number;
|
|
590
|
+
/**
|
|
591
|
+
* Gaps the FEC deadline of a run no repair delimited released (counted in
|
|
592
|
+
* `concealedGaps` or `stalls` too; their decisions name no block).
|
|
593
|
+
*/
|
|
594
|
+
undelimitedRunGaps: number;
|
|
583
595
|
concealedFrames: number;
|
|
584
596
|
concealedAudioMs: number;
|
|
585
597
|
vanishedBlocks: number;
|
|
@@ -626,6 +638,7 @@ function newBlockPolicyStats(
|
|
|
626
638
|
stalls: 0,
|
|
627
639
|
concealedBlocks: 0,
|
|
628
640
|
concealedGaps: 0,
|
|
641
|
+
undelimitedRunGaps: 0,
|
|
629
642
|
concealedFrames: 0,
|
|
630
643
|
concealedAudioMs: 0,
|
|
631
644
|
vanishedBlocks: 0,
|
|
@@ -1124,6 +1137,35 @@ function fecReorderWindowFrames(
|
|
|
1124
1137
|
}
|
|
1125
1138
|
|
|
1126
1139
|
/** Catalog track descriptor for configureMultiTrack(). */
|
|
1140
|
+
/**
|
|
1141
|
+
* The counters of an "mfu-datagram" leg, under the names every player
|
|
1142
|
+
* publishes: both spread `MulticastManager.datagramLegDiagnostics(...)` into
|
|
1143
|
+
* the FEC stats object they expose (hang `getFecStats()`, moqtail
|
|
1144
|
+
* `__MOQTAIL_STATS__.fecStats`), so a lane reads one shape from either. A
|
|
1145
|
+
* player that started no leg publishes none of these keys: an absent counter
|
|
1146
|
+
* is not a zero.
|
|
1147
|
+
*/
|
|
1148
|
+
export interface DatagramLegDiagnostics {
|
|
1149
|
+
/** SUBSCRIBE_OK received on the datagram track and not ended (`FecStateEvidence.datagramLegJoined`). */
|
|
1150
|
+
readonly datagramLegJoined: boolean
|
|
1151
|
+
/** Leg packets dropped because their packet id is not the leg's (`MmtpRouter.datagramLegIngressDropCount`). */
|
|
1152
|
+
readonly datagramLegIngressDrops: number
|
|
1153
|
+
/** Repair datagrams that overflowed the player's ring before the first source packet named the owner packet id. */
|
|
1154
|
+
readonly datagramLegRepairBeforePacketId: number
|
|
1155
|
+
/** Datagrams the MoQ session dropped after SUBSCRIBE_OK because their track alias was unknown. */
|
|
1156
|
+
readonly datagramUnknownAlias: number
|
|
1157
|
+
/** `WebTransport.datagrams.maxDatagramSize` of the session the leg rides; null when the browser states none. */
|
|
1158
|
+
readonly transport: { readonly maxDatagramSize: number | null }
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/** What only the player can count for `DatagramLegDiagnostics`; libmmt adds its own counter. */
|
|
1162
|
+
export interface DatagramLegPlayerCounters {
|
|
1163
|
+
readonly joined: boolean
|
|
1164
|
+
readonly repairBeforePacketId: number
|
|
1165
|
+
readonly unknownAlias: number
|
|
1166
|
+
readonly maxDatagramSize?: number | null
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1127
1169
|
export interface MultiTrackCatalogTrack {
|
|
1128
1170
|
name: string;
|
|
1129
1171
|
altGroup?: number;
|
|
@@ -1531,6 +1573,9 @@ export class MulticastManager {
|
|
|
1531
1573
|
reason,
|
|
1532
1574
|
});
|
|
1533
1575
|
};
|
|
1576
|
+
this.#fec.onUndelimitedRunGap = (packetId, catalogTrackName) => {
|
|
1577
|
+
this.#statsFor(packetId, catalogTrackName).undelimitedRunGaps++;
|
|
1578
|
+
};
|
|
1534
1579
|
this.#fec.onBlockVanished = (_sbn, packetId, catalogTrackName) => {
|
|
1535
1580
|
this.#statsFor(packetId, catalogTrackName).vanishedBlocks++;
|
|
1536
1581
|
};
|
|
@@ -1880,6 +1925,7 @@ export class MulticastManager {
|
|
|
1880
1925
|
| "timescale"
|
|
1881
1926
|
| "keyframeIntervalTicks"
|
|
1882
1927
|
| "keyframeIntervalMs"
|
|
1928
|
+
| "groupDurationMs"
|
|
1883
1929
|
>,
|
|
1884
1930
|
catalogTrackName?: string,
|
|
1885
1931
|
): void {
|
|
@@ -1914,6 +1960,7 @@ export class MulticastManager {
|
|
|
1914
1960
|
assertPositiveGeometry("timescale", config.timescale);
|
|
1915
1961
|
assertPositiveGeometry("keyframeIntervalTicks", config.keyframeIntervalTicks);
|
|
1916
1962
|
assertPositiveGeometry("keyframeIntervalMs", config.keyframeIntervalMs);
|
|
1963
|
+
assertPositiveGeometry("groupDurationMs", config.groupDurationMs);
|
|
1917
1964
|
assertNonNegativeGeometry("fecRepairSymbols", config.fecRepairSymbols);
|
|
1918
1965
|
// A tolerance is the network path's allowance, added to the encoder's
|
|
1919
1966
|
// span. These are public entry points: the catalog parser validates what it
|
|
@@ -1969,6 +2016,7 @@ export class MulticastManager {
|
|
|
1969
2016
|
...(trackKind === undefined ? {} : { trackKind }),
|
|
1970
2017
|
...(config.codec === undefined ? {} : { codec: config.codec }),
|
|
1971
2018
|
...(geometry === undefined ? {} : { geometry }),
|
|
2019
|
+
...(config.groupDurationMs === undefined ? {} : { groupDurationMs: config.groupDurationMs }),
|
|
1972
2020
|
};
|
|
1973
2021
|
this.#fec.configureTrack(packetId, fecConfig, catalogTrackName);
|
|
1974
2022
|
this.#configureTrackMapper(packetId, fecConfig);
|
|
@@ -2877,6 +2925,84 @@ export class MulticastManager {
|
|
|
2877
2925
|
this.#transport.feedPacket(data, ingress, sourceAddress);
|
|
2878
2926
|
}
|
|
2879
2927
|
|
|
2928
|
+
/**
|
|
2929
|
+
* Start an "mfu-datagram" leg (draft-ramadan-moq-mmt-02 4.3.1): a
|
|
2930
|
+
* subscription whose objects arrive as datagrams, a lossy unicast path.
|
|
2931
|
+
* Arms the join-boundary rules exactly as a multicast join does (the leg
|
|
2932
|
+
* starts at an arbitrary datagram), keeping configured tracks, decoders
|
|
2933
|
+
* and diagnostics. No MulticastTransport is involved: no takeover, no
|
|
2934
|
+
* failback watchdog, no bridge. While the leg is up the player publishes
|
|
2935
|
+
* `datagramLegDiagnostics(...)` in its FEC stats (`DatagramLegDiagnostics`:
|
|
2936
|
+
* `datagramLegJoined`, `datagramLegIngressDrops`,
|
|
2937
|
+
* `datagramLegRepairBeforePacketId`, `datagramUnknownAlias`,
|
|
2938
|
+
* `transport.maxDatagramSize`), the same keys in every player.
|
|
2939
|
+
*/
|
|
2940
|
+
startDatagramLeg(options: {
|
|
2941
|
+
/**
|
|
2942
|
+
* How long after a frame arrives it must leave the release gate when the
|
|
2943
|
+
* gap before it holds delta data alone (the presentation delay less the
|
|
2944
|
+
* decode lead; mmt-02 6.1 step 6): the gap is decided at the earlier of
|
|
2945
|
+
* this and the FEC block deadline. Absent: the block deadline alone.
|
|
2946
|
+
*/
|
|
2947
|
+
presentationBudgetMs?: (packetId: number, catalogTrackName?: string) => number;
|
|
2948
|
+
} = {}): void {
|
|
2949
|
+
this.#router.setDatagramLegPresentationBudget(options.presentationBudgetMs ?? null);
|
|
2950
|
+
this.#fec.beginLegJoin();
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* Feed one object of an "mfu-datagram" subscription (one MMTP packet) in
|
|
2955
|
+
* arrival order. `ingress.tracks` names the datagram catalog track for the
|
|
2956
|
+
* packet id; the router restores serial order, holds FEC sources until a
|
|
2957
|
+
* repair states their block, and declares loss at the block deadline
|
|
2958
|
+
* (mmt-02 5.3.3). Bypasses MulticastTransport, unlike `feedPacket`.
|
|
2959
|
+
*/
|
|
2960
|
+
feedDatagramLegPacket(packet: Uint8Array, ingress?: MmtpIngressContext): void {
|
|
2961
|
+
this.#router.feedPacket(packet, "moq-datagram", ingress);
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
/**
|
|
2965
|
+
* Feed one repair object of an "mfu-datagram" track's repair track (sent
|
|
2966
|
+
* as datagrams, mmt-02 4.3.1): the repair track's own packet id names no
|
|
2967
|
+
* owner, so the subscription supplies it, as `router.feedRepairPacket`
|
|
2968
|
+
* does for a MoQ repair; the symbol counts as in-band (`RepairVia`
|
|
2969
|
+
* `inband`), unlike a FETCHed repair.
|
|
2970
|
+
*/
|
|
2971
|
+
feedDatagramLegRepair(packet: Uint8Array, ownerPacketId: number, catalogTrackName: string, repairTrackName?: string): void {
|
|
2972
|
+
this.#router.feedRepairPacket(packet, ownerPacketId, catalogTrackName, repairTrackName, "moq-datagram");
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
/**
|
|
2976
|
+
* End the "mfu-datagram" leg: call it when the subscription is dropped and
|
|
2977
|
+
* before the first packet of the path that replaces it (the ordered switch
|
|
2978
|
+
* to multicast, a fallback to the "mfu" track). The leg's presentation
|
|
2979
|
+
* bound and ledger retention stop applying; tracks, decoders, FEC state
|
|
2980
|
+
* and diagnostics stay, so the next path continues without a new epoch.
|
|
2981
|
+
*/
|
|
2982
|
+
stopDatagramLeg(): void {
|
|
2983
|
+
this.#router.endDatagramLeg();
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
/** "mfu-datagram" leg packets dropped because their packet id is not the leg's (`MmtpRouter.datagramLegIngressDropCount`). */
|
|
2987
|
+
get datagramLegIngressDropCount(): number {
|
|
2988
|
+
return this.#router.datagramLegIngressDropCount;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
/**
|
|
2992
|
+
* The leg's diagnostics as one object with the shared names
|
|
2993
|
+
* (`DatagramLegDiagnostics`): the player supplies what it alone counts and
|
|
2994
|
+
* spreads the result into its published FEC stats while a leg is up.
|
|
2995
|
+
*/
|
|
2996
|
+
datagramLegDiagnostics(player: DatagramLegPlayerCounters): DatagramLegDiagnostics {
|
|
2997
|
+
return {
|
|
2998
|
+
datagramLegJoined: player.joined,
|
|
2999
|
+
datagramLegIngressDrops: this.#router.datagramLegIngressDropCount,
|
|
3000
|
+
datagramLegRepairBeforePacketId: player.repairBeforePacketId,
|
|
3001
|
+
datagramUnknownAlias: player.unknownAlias,
|
|
3002
|
+
transport: { maxDatagramSize: player.maxDatagramSize ?? null },
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
|
|
2880
3006
|
/**
|
|
2881
3007
|
* Declare how packets given to feedPacket() reach this manager. A consumer
|
|
2882
3008
|
* that owns the multicast socket itself declares its own leg; join()
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* runtime unless the test harness opts in.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
+
import { isMmtpMode, type MmtpMode } from "@blockcast/mmt-base";
|
|
37
38
|
import type { FecCatalogConfig } from "./carp-catalog.js";
|
|
38
39
|
|
|
39
40
|
// ---------------------------------------------------------------------------
|
|
@@ -57,7 +58,7 @@ export interface Phase14OverrideTrack {
|
|
|
57
58
|
source?: string;
|
|
58
59
|
instanceId?: number;
|
|
59
60
|
/** Required when packaging is `mmtp`; the current publisher emits MFU mode. */
|
|
60
|
-
mmtpMode?:
|
|
61
|
+
mmtpMode?: MmtpMode;
|
|
61
62
|
/** Required when packaging is `mmtp`; copied into synthesized CMSF tracks. */
|
|
62
63
|
timescale?: number;
|
|
63
64
|
/** Required when packaging is `mmtp`; copied into synthesized CMSF tracks. */
|
|
@@ -308,11 +309,17 @@ export function mergeOverrideIntoCmsfTracks(
|
|
|
308
309
|
if (ot.role !== undefined && existing.role === undefined) existing.role = ot.role;
|
|
309
310
|
if (existing.packaging === "mmtp") {
|
|
310
311
|
const mode = existing.mmtpMode ?? ot.mmtpMode;
|
|
311
|
-
if (mode
|
|
312
|
+
if (mode === undefined) {
|
|
312
313
|
throw new Error(
|
|
313
314
|
`[phase14-catalog-override] track "${ot.name}" has packaging='mmtp' but no valid mmtpMode`,
|
|
314
315
|
);
|
|
315
316
|
}
|
|
317
|
+
// mmt-02 13.1: an unknown mode rejects the track, never the
|
|
318
|
+
// catalog (`mmtpTrackIssues`); the override leaves it alone.
|
|
319
|
+
if (!isMmtpMode(mode)) {
|
|
320
|
+
console.warn(`[phase14-catalog-override] track "${ot.name}" has unknown mmtpMode ${JSON.stringify(mode)}; skipping the override`);
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
316
323
|
existing.mmtpMode = mode;
|
|
317
324
|
if (existing.timescale === undefined && ot.timescale !== undefined) existing.timescale = ot.timescale;
|
|
318
325
|
if (existing.groupDurationMs === undefined && ot.groupDurationMs !== undefined) {
|
|
@@ -353,11 +360,15 @@ export function mergeOverrideIntoCmsfTracks(
|
|
|
353
360
|
);
|
|
354
361
|
}
|
|
355
362
|
const mmtpMode = ot.mmtpMode;
|
|
356
|
-
if (packaging === "mmtp" && mmtpMode
|
|
363
|
+
if (packaging === "mmtp" && mmtpMode === undefined) {
|
|
357
364
|
throw new Error(
|
|
358
365
|
`[phase14-catalog-override] track "${ot.name}" has packaging='mmtp' but no valid mmtpMode`,
|
|
359
366
|
);
|
|
360
367
|
}
|
|
368
|
+
if (packaging === "mmtp" && !isMmtpMode(mmtpMode)) {
|
|
369
|
+
console.warn(`[phase14-catalog-override] track "${ot.name}" has unknown mmtpMode ${JSON.stringify(mmtpMode)}; skipping the track`);
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
361
372
|
if (packaging === "mmtp" && !isPositiveInteger(ot.timescale)) {
|
|
362
373
|
throw new Error(
|
|
363
374
|
`[phase14-catalog-override] track "${ot.name}" has packaging='mmtp' but no valid timescale`,
|
package/src/repair-fetch.ts
CHANGED
|
@@ -1353,6 +1353,29 @@ export function wireRepairFetch(mc: RepairFetchHost, opts: WireRepairFetchOption
|
|
|
1353
1353
|
dispatch()
|
|
1354
1354
|
return
|
|
1355
1355
|
}
|
|
1356
|
+
if (event.type === 'gap') {
|
|
1357
|
+
// mmt-02 5.3.3: a receiver cancels a repair it stops waiting for. A
|
|
1358
|
+
// frame the release gate forces out at its hold ceiling (a
|
|
1359
|
+
// discontinuity stall over blocks that never resolved) declares the
|
|
1360
|
+
// loss behind it, so every FETCH of that stream past its deadline is
|
|
1361
|
+
// cancelled here, inside the decision, before the frame leaves the
|
|
1362
|
+
// gate (MulticastManager emits the decision as a lifecycle event
|
|
1363
|
+
// synchronously from the gate's `decide`).
|
|
1364
|
+
if (event.action !== 'stall' || event.reason !== 'discontinuity') return
|
|
1365
|
+
const now = performance.now()
|
|
1366
|
+
let expired = false
|
|
1367
|
+
for (const entry of [...entries.values()]) {
|
|
1368
|
+
if (entry.packetId !== event.stream.packetId) continue
|
|
1369
|
+
if (entry.catalogTrackName !== (event.stream.catalogTrackName ?? undefined)) continue
|
|
1370
|
+
if (!entry.running || entry.deadlineAt > now) continue
|
|
1371
|
+
stop(entry, 'expired')
|
|
1372
|
+
retire(entry)
|
|
1373
|
+
clearEntry(entry)
|
|
1374
|
+
expired = true
|
|
1375
|
+
}
|
|
1376
|
+
if (expired) dispatch()
|
|
1377
|
+
return
|
|
1378
|
+
}
|
|
1356
1379
|
if (event.type !== 'recovered' && event.type !== 'failed') return
|
|
1357
1380
|
const entry = entries.get(
|
|
1358
1381
|
requestKey(event.block.sbn, event.block.packetId, event.block.catalogTrackName ?? undefined),
|
|
@@ -26,7 +26,9 @@ runtime resolver still reads live in `fec-01-runtime/`.
|
|
|
26
26
|
The negatives:
|
|
27
27
|
|
|
28
28
|
- `legacy-selection-params.json`: rendition fields must be flat.
|
|
29
|
-
- `missing-mmtp-fields.json`: MMTP tracks require
|
|
29
|
+
- `missing-mmtp-fields.json`: MMTP tracks require a timescale and a duration
|
|
30
|
+
(the section's `track_timescale`); the missing `mmtpMode` is the track
|
|
31
|
+
admission rule below, which rejects the track, not the catalog.
|
|
30
32
|
- `multicast-packet-id-signaling.json`: an endpoint track's `packetId` is
|
|
31
33
|
1..65535; `packetId` 0 is the MMTP signaling flow and is never a track's.
|
|
32
34
|
- `network-source-object.json`: `networkSource` is always an array.
|
|
@@ -176,7 +178,39 @@ Draft -01 track and root fields (BLO-15076, Blockcast/moqcast-draft@fd962fd):
|
|
|
176
178
|
- `multicast-amt-dns-relay.json`, `multicast-amt-discovery-omitted.json`:
|
|
177
179
|
multicast-01 4.2.1 `discovery: "dns"`, and an omitted `discovery` with a
|
|
178
180
|
hostname relay (read as `"dns"`).
|
|
179
|
-
- `mmtp-mode-mpu.json`: mmt-
|
|
181
|
+
- `mmtp-mode-mpu.json`: mmt-02 13.1, `mmtpMode` is `"mfu"` or `"mfu-datagram"`.
|
|
182
|
+
The schema accepts any non-empty string (a value set there would reject the
|
|
183
|
+
whole catalog); a subscriber rejects the track, never the catalog:
|
|
184
|
+
`validateCmsfMmtpCatalog` removes it from the catalog it returns
|
|
185
|
+
(`rejectedTracks`, `track_mmtp_mode`), and the Rust section names it with
|
|
186
|
+
`rejected_tracks` (`trackRejected` in `section-codes.json`).
|
|
187
|
+
- `mmtp-siblings/`: the shared vector set of the mmt-02 4.3.1 `"mfu-datagram"`
|
|
188
|
+
track, asserted by every implementation of the rules (this validator,
|
|
189
|
+
`mmt_fec::catalog::rejected_tracks` for the mode rule, and the vendored
|
|
190
|
+
copies in hang-mmt-fec, moqtail-ts and pim). Each file is
|
|
191
|
+
`{ generator, sha256, description, catalog, expected }`, with `sha256` that of
|
|
192
|
+
`JSON.stringify({ catalog, expected })` so a vendored copy is checked by
|
|
193
|
+
hash. `expected.tracks` gives every track a verdict: `accepted`, `rejected`
|
|
194
|
+
(with the `code` and JSON `path`), or `dropped` (a `fec-repair` track whose
|
|
195
|
+
`source` was rejected). `expected.pairs` maps each `"mfu"` track to its
|
|
196
|
+
datagram sibling over the accepted tracks; `expected.endpointIssues` is what
|
|
197
|
+
`multicastCatalogIssues` names. Every catalog of the set is valid and passes
|
|
198
|
+
the schema. Two entries are siblings when their whole identity set is equal,
|
|
199
|
+
field by field or absent on both: namespace, `timescale`,
|
|
200
|
+
`presentationAnchorTicks`, group duration (as ticks) and the mmt-02 13.1
|
|
201
|
+
rendition fields `codec`, `width`, `height`, `framerate`, `bitrate`,
|
|
202
|
+
`samplerate`, `channelConfig`, `lang`. A datagram track with exactly one
|
|
203
|
+
sibling pairs; zero or more than one rejects it. Never by name.
|
|
204
|
+
`valid-pair.json`; `ladder-four-rungs.json` and `ladder-bitrate-only.json`
|
|
205
|
+
(rungs share everything but the rendition fields, every rung pairs);
|
|
206
|
+
`ladder-other-names.json` (names unrelated to the rung: a name-based
|
|
207
|
+
implementation fails it); `no-sibling.json`, `timescale-mismatch.json`,
|
|
208
|
+
`rendition-mismatch.json` (another codec on the only candidate: a tie-break
|
|
209
|
+
implementation fails it) and `ambiguous-sibling.json` (two `"mfu"` tracks
|
|
210
|
+
with one description) are `track_mmtp_sibling`; `stream-delivery-mode.json`
|
|
211
|
+
(`track_delivery_mode_conflict`), `mmtp-mode-unknown.json`
|
|
212
|
+
(`track_mmtp_mode`), `multicast-endpoint-lists-datagram-track.json`
|
|
213
|
+
(`multicast_track`: the receiver ignores that endpoint).
|
|
180
214
|
- `presentation-anchor-unsafe.json`: the anchor is a safe (signed) integer.
|
|
181
215
|
- `init-data-inline-without-data.json`: an `"inline"` `initDataList` entry
|
|
182
216
|
carries `data`.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generator": "libmmt mmtp-siblings-v1",
|
|
3
|
+
"sha256": "3bb008c475a6582aea9bf220ab086f3154bc2c97c2534ad5162a84b27e3f59d4",
|
|
4
|
+
"description": "Two \"mfu\" tracks carry one description (they differ in name only), so both are siblings of the datagram track on the whole identity set; names are not read, the pair is ambiguous and the datagram track is rejected.",
|
|
5
|
+
"catalog": {
|
|
6
|
+
"version": 1,
|
|
7
|
+
"streamingFormat": "mmtp",
|
|
8
|
+
"streamingFormatVersion": "draft-ramadan-moq-mmt-02",
|
|
9
|
+
"tracks": [
|
|
10
|
+
{
|
|
11
|
+
"name": "1080p",
|
|
12
|
+
"packaging": "mmtp",
|
|
13
|
+
"isLive": true,
|
|
14
|
+
"codec": "avc1.640028",
|
|
15
|
+
"framerate": 30,
|
|
16
|
+
"width": 1920,
|
|
17
|
+
"height": 1080,
|
|
18
|
+
"mmtpMode": "mfu",
|
|
19
|
+
"timescale": 90000,
|
|
20
|
+
"groupDurationMs": 1000,
|
|
21
|
+
"fec": [
|
|
22
|
+
{
|
|
23
|
+
"instanceId": 0,
|
|
24
|
+
"scheme": "raptorq",
|
|
25
|
+
"blockProfile": "iso-ssbg1-v1",
|
|
26
|
+
"sourceSymbols": 32,
|
|
27
|
+
"repairSymbols": 8,
|
|
28
|
+
"symbolSize": 1096,
|
|
29
|
+
"interleaveDepthMs": 133,
|
|
30
|
+
"reorderToleranceMs": 40,
|
|
31
|
+
"repairTrack": "1080p/repair"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "1080p/repair",
|
|
37
|
+
"packaging": "fec-repair",
|
|
38
|
+
"codec": "application/raptorq",
|
|
39
|
+
"source": "1080p",
|
|
40
|
+
"instanceId": 0,
|
|
41
|
+
"repairLayer": 0,
|
|
42
|
+
"repairSymbols": 8,
|
|
43
|
+
"priority": 240
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "1080p-b",
|
|
47
|
+
"packaging": "mmtp",
|
|
48
|
+
"isLive": true,
|
|
49
|
+
"codec": "avc1.640028",
|
|
50
|
+
"framerate": 30,
|
|
51
|
+
"width": 1920,
|
|
52
|
+
"height": 1080,
|
|
53
|
+
"mmtpMode": "mfu",
|
|
54
|
+
"timescale": 90000,
|
|
55
|
+
"groupDurationMs": 1000
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "1080p/datagram",
|
|
59
|
+
"packaging": "mmtp",
|
|
60
|
+
"isLive": true,
|
|
61
|
+
"codec": "avc1.640028",
|
|
62
|
+
"framerate": 30,
|
|
63
|
+
"width": 1920,
|
|
64
|
+
"height": 1080,
|
|
65
|
+
"mmtpMode": "mfu-datagram",
|
|
66
|
+
"timescale": 90000,
|
|
67
|
+
"groupDurationMs": 1000,
|
|
68
|
+
"fec": [
|
|
69
|
+
{
|
|
70
|
+
"instanceId": 0,
|
|
71
|
+
"scheme": "raptorq",
|
|
72
|
+
"blockProfile": "iso-ssbg1-v1",
|
|
73
|
+
"sourceSymbols": 32,
|
|
74
|
+
"repairSymbols": 8,
|
|
75
|
+
"symbolSize": 1096,
|
|
76
|
+
"interleaveDepthMs": 133,
|
|
77
|
+
"reorderToleranceMs": 40,
|
|
78
|
+
"repairTrack": "1080p/datagram/repair"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"deliveryMode": "datagram"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "1080p/datagram/repair",
|
|
85
|
+
"packaging": "fec-repair",
|
|
86
|
+
"codec": "application/raptorq",
|
|
87
|
+
"source": "1080p/datagram",
|
|
88
|
+
"instanceId": 0,
|
|
89
|
+
"repairLayer": 0,
|
|
90
|
+
"repairSymbols": 8,
|
|
91
|
+
"priority": 240,
|
|
92
|
+
"deliveryMode": "datagram"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "audio",
|
|
96
|
+
"packaging": "mmtp",
|
|
97
|
+
"isLive": true,
|
|
98
|
+
"codec": "mp4a.40.2",
|
|
99
|
+
"samplerate": 48000,
|
|
100
|
+
"channelConfig": "2",
|
|
101
|
+
"mmtpMode": "mfu",
|
|
102
|
+
"timescale": 48000,
|
|
103
|
+
"groupDurationMs": 1000
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"multicast": {
|
|
107
|
+
"endpoints": [
|
|
108
|
+
{
|
|
109
|
+
"sourceAddress": "192.0.2.10",
|
|
110
|
+
"groupAddress": "232.1.1.1",
|
|
111
|
+
"port": 5000,
|
|
112
|
+
"tracks": [
|
|
113
|
+
{
|
|
114
|
+
"name": "1080p",
|
|
115
|
+
"packetId": 1
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "1080p/repair",
|
|
119
|
+
"packetId": 2
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "audio",
|
|
123
|
+
"packetId": 3
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"expected": {
|
|
131
|
+
"catalogValid": true,
|
|
132
|
+
"tracks": {
|
|
133
|
+
"1080p": {
|
|
134
|
+
"verdict": "accepted"
|
|
135
|
+
},
|
|
136
|
+
"1080p/repair": {
|
|
137
|
+
"verdict": "accepted"
|
|
138
|
+
},
|
|
139
|
+
"1080p-b": {
|
|
140
|
+
"verdict": "accepted"
|
|
141
|
+
},
|
|
142
|
+
"1080p/datagram": {
|
|
143
|
+
"verdict": "rejected",
|
|
144
|
+
"code": "track_mmtp_sibling",
|
|
145
|
+
"path": "$.tracks[3]"
|
|
146
|
+
},
|
|
147
|
+
"1080p/datagram/repair": {
|
|
148
|
+
"verdict": "dropped",
|
|
149
|
+
"source": "1080p/datagram"
|
|
150
|
+
},
|
|
151
|
+
"audio": {
|
|
152
|
+
"verdict": "accepted"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"pairs": {},
|
|
156
|
+
"endpointIssues": []
|
|
157
|
+
}
|
|
158
|
+
}
|