@blockcast/mmt-base 2.1.0 → 2.2.0-main.0147c1107c71
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 +1 -1
- package/dist/datagram-leg-size.d.ts +30 -0
- package/dist/datagram-leg-size.d.ts.map +1 -0
- package/dist/datagram-leg-size.js +42 -0
- package/dist/datagram-leg-size.js.map +1 -0
- package/dist/event-timeline-catalog.d.ts +21 -0
- package/dist/event-timeline-catalog.d.ts.map +1 -0
- package/dist/event-timeline-catalog.js +45 -0
- package/dist/event-timeline-catalog.js.map +1 -0
- package/dist/fec-bindings.d.ts +13 -1
- package/dist/fec-bindings.d.ts.map +1 -1
- package/dist/fec-bindings.js +29 -6
- package/dist/fec-bindings.js.map +1 -1
- package/dist/fec-catalog.d.ts +4 -1
- package/dist/fec-catalog.d.ts.map +1 -1
- package/dist/fec-catalog.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mmtp-siblings.d.ts +50 -0
- package/dist/mmtp-siblings.d.ts.map +1 -0
- package/dist/mmtp-siblings.js +142 -0
- package/dist/mmtp-siblings.js.map +1 -0
- package/dist/mmtp.d.ts +0 -13
- package/dist/mmtp.d.ts.map +1 -1
- package/dist/mmtp.js +13 -21
- package/dist/mmtp.js.map +1 -1
- package/dist/multicast-catalog.d.ts +20 -0
- package/dist/multicast-catalog.d.ts.map +1 -1
- package/dist/multicast-catalog.js +38 -2
- package/dist/multicast-catalog.js.map +1 -1
- package/dist/signalling.d.ts +8 -6
- package/dist/signalling.d.ts.map +1 -1
- package/dist/signalling.js +7 -5
- package/dist/signalling.js.map +1 -1
- package/package.json +1 -1
- package/src/datagram-leg-size.ts +46 -0
- package/src/event-timeline-catalog.ts +61 -0
- package/src/fec-bindings.ts +43 -7
- package/src/fec-catalog.ts +4 -1
- package/src/index.ts +3 -0
- package/src/mmtp-siblings.ts +161 -0
- package/src/mmtp.ts +15 -37
- package/src/multicast-catalog.ts +46 -1
- package/src/signalling.ts +9 -7
package/src/multicast-catalog.ts
CHANGED
|
@@ -255,8 +255,11 @@ export function multicastCatalogIssues(
|
|
|
255
255
|
|
|
256
256
|
const tracks = Array.isArray(catalog["tracks"]) ? catalog["tracks"] : [];
|
|
257
257
|
const namespaceOf = new Map<string, unknown>();
|
|
258
|
+
const modeOf = new Map<string, unknown>();
|
|
258
259
|
for (const track of tracks) {
|
|
259
|
-
if (isObject(track)
|
|
260
|
+
if (!isObject(track) || typeof track["name"] !== "string") continue;
|
|
261
|
+
namespaceOf.set(track["name"], track["namespace"]);
|
|
262
|
+
modeOf.set(track["name"], track["mmtpMode"]);
|
|
260
263
|
}
|
|
261
264
|
const tagged = (catalog as { [CATALOG_NAMESPACE]?: unknown })[CATALOG_NAMESPACE];
|
|
262
265
|
let referenceNamespace = options.catalogNamespace ?? (typeof tagged === "string" ? tagged : undefined);
|
|
@@ -337,6 +340,12 @@ export function multicastCatalogIssues(
|
|
|
337
340
|
const ref = refs[refIndex];
|
|
338
341
|
const name = isObject(ref) ? ref["name"] : ref;
|
|
339
342
|
if (typeof name !== "string") continue;
|
|
343
|
+
// mmt-02 4.3.1: the "mfu" and "mfu-datagram" tracks carry the same
|
|
344
|
+
// MMTP sub-flow, so an endpoint lists the "mfu" track and never the
|
|
345
|
+
// datagram one; a receiver ignores an endpoint that does.
|
|
346
|
+
if (modeOf.get(name) === "mfu-datagram") {
|
|
347
|
+
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)`);
|
|
348
|
+
}
|
|
340
349
|
const namespace = namespaceOf.get(name);
|
|
341
350
|
if (typeof namespace !== "string") continue;
|
|
342
351
|
referenceNamespace ??= namespace;
|
|
@@ -387,3 +396,39 @@ export function admittedMulticastEndpoints(
|
|
|
387
396
|
const ignored = new Set(issues.map(issue => issue.endpointIndex));
|
|
388
397
|
return new Set(endpoints.map((_, index) => index).filter(index => !ignored.has(index)));
|
|
389
398
|
}
|
|
399
|
+
|
|
400
|
+
/** Resolved ATSC 3.0 tuning (draft -01 4.2.2/4.2.3). Only `frequency` is REQUIRED. */
|
|
401
|
+
export type Atsc3NetworkSource = {
|
|
402
|
+
/** RF centre frequency in kHz. */
|
|
403
|
+
frequency: number;
|
|
404
|
+
plpId?: number;
|
|
405
|
+
serviceId?: number;
|
|
406
|
+
/** SLS of the MMTP service; libmmt does not fetch it. */
|
|
407
|
+
slsUri?: string;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Resolve ATSC 3.0 tuning from a catalog `networkSource` (array or bare-object
|
|
412
|
+
* form): the first `type: "atsc3"` entry with a positive integer `frequency`
|
|
413
|
+
* (kHz). Optional fields are carried only when in range; an entry with no
|
|
414
|
+
* usable frequency is skipped, since it names nothing a tuner can lock to.
|
|
415
|
+
* Draft -01 3 puts the tuner first, so callers prefer this over AMT.
|
|
416
|
+
*
|
|
417
|
+
* Lives here, not in `@blockcast/mmt-container`, so the transport's
|
|
418
|
+
* `endpointToMulticastConfig` and the container read the field one way.
|
|
419
|
+
*/
|
|
420
|
+
export function catalogAtsc3NetworkSource(networkSource: unknown): Atsc3NetworkSource | undefined {
|
|
421
|
+
const entries = Array.isArray(networkSource) ? networkSource : networkSource ? [networkSource] : [];
|
|
422
|
+
for (const ns of entries) {
|
|
423
|
+
if (!isObject(ns)) continue;
|
|
424
|
+
if (ns.type !== "atsc3" || !isIntegerIn(ns.frequency, 1, Number.MAX_SAFE_INTEGER)) continue;
|
|
425
|
+
const slsUri = typeof ns.slsUri === "string" ? ns.slsUri.trim() : "";
|
|
426
|
+
return {
|
|
427
|
+
frequency: ns.frequency,
|
|
428
|
+
...(isIntegerIn(ns.plpId, 0, 63) ? { plpId: ns.plpId } : {}),
|
|
429
|
+
...(isIntegerIn(ns.serviceId, 0, 65535) ? { serviceId: ns.serviceId } : {}),
|
|
430
|
+
...(slsUri ? { slsUri } : {}),
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
return undefined;
|
|
434
|
+
}
|
package/src/signalling.ts
CHANGED
|
@@ -456,9 +456,9 @@ export function parseAlFecMessage(mmtpPacket: Uint8Array): AlFecMessage | null {
|
|
|
456
456
|
|
|
457
457
|
/**
|
|
458
458
|
* Decoder geometry of one FEC flow's AL-FEC message entry under
|
|
459
|
-
* draft-ramadan-moq-mmt-
|
|
459
|
+
* draft-ramadan-moq-mmt-02 Section 8.3 ("iso-ssbg1-v1"): one Asset, coding
|
|
460
460
|
* byte 0x14, fec_code_id_for_repair_flow 3 (RaptorQ) or 1 (Reed-Solomon),
|
|
461
|
-
* and no OTI (draft-ramadan-moq-mmt-
|
|
461
|
+
* and no OTI (draft-ramadan-moq-mmt-02 Section 7.1). K, T and P come from
|
|
462
462
|
* the entry's own fields; a private field, if present, is ignored.
|
|
463
463
|
*/
|
|
464
464
|
export interface AlFecRaptorQFlowConfig {
|
|
@@ -483,18 +483,18 @@ export interface AlFecRaptorQFlowConfig {
|
|
|
483
483
|
|
|
484
484
|
const RAPTORQ_MAX_SOURCE_SYMBOLS = 56_403
|
|
485
485
|
const REPAIR_SYMBOL_ID_MAX = 0x00ff_ffff
|
|
486
|
-
/** The 12-octet MMTP header plus the 2-octet length of the T - 2 construction (moq-
|
|
486
|
+
/** The 12-octet MMTP header plus the 2-octet length of the T - 2 construction (draft-ramadan-moq-mmt-02 Section 7.1). */
|
|
487
487
|
const MIN_REPAIR_SYMBOL_SIZE = 14
|
|
488
488
|
const REED_SOLOMON_MAX_BLOCK = 255
|
|
489
489
|
|
|
490
490
|
/**
|
|
491
|
-
* Validate one parsed FEC flow against draft-ramadan-moq-mmt-
|
|
492
|
-
* and
|
|
491
|
+
* Validate one parsed FEC flow against draft-ramadan-moq-mmt-02 Sections 8.3
|
|
492
|
+
* and 13.2 and return its decoder geometry, or null when the entry is
|
|
493
493
|
* outside them. Fail closed on everything else:
|
|
494
494
|
*
|
|
495
495
|
* - coding byte other than 0x14 (one-stage, ssbg_mode1, ffsrpts_flag 0,
|
|
496
496
|
* fec_payload_id_mode 0). 0x15 is fec_payload_id_mode 1 under Amd 1:2025,
|
|
497
|
-
* which "iso-ssbg1-v1" does not describe (moq-
|
|
497
|
+
* which "iso-ssbg1-v1" does not describe (draft-ramadan-moq-mmt-02 Section 7.1);
|
|
498
498
|
* - number_of_assets other than 1;
|
|
499
499
|
* - fec_code_id_for_repair_flow other than 3 or 1, the retired Blockcast
|
|
500
500
|
* code 2 included (ISO/IEC 23008-10 Table 1);
|
|
@@ -538,9 +538,11 @@ export function alFecRaptorQFlowConfig(flow: AlFecFlow): AlFecRaptorQFlowConfig
|
|
|
538
538
|
|
|
539
539
|
/**
|
|
540
540
|
* `alFecRaptorQFlowConfig` for every entry of a message, index for index,
|
|
541
|
-
* plus the draft-ramadan-moq-mmt-
|
|
541
|
+
* plus the draft-ramadan-moq-mmt-02 Section 13.2 checks that span entries: an
|
|
542
542
|
* entry whose repair_flow_id is another entry's Asset packet_id, and every
|
|
543
543
|
* entry of two that name one repair_flow_id or list one Asset, is null.
|
|
544
|
+
* A repair_flow_id equal to a packet_id this message does not list (another
|
|
545
|
+
* track in the MP table) is the caller's check: it holds the MP table.
|
|
544
546
|
*/
|
|
545
547
|
export function alFecMessageFlowConfigs(message: AlFecMessageBody): (AlFecRaptorQFlowConfig | null)[] {
|
|
546
548
|
const assetCount = new Map<number, number>()
|