@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.
Files changed (167) hide show
  1. package/README.md +44 -58
  2. package/dist/abr-controller.d.ts +34 -4
  3. package/dist/abr-controller.d.ts.map +1 -1
  4. package/dist/abr-controller.js +66 -17
  5. package/dist/abr-controller.js.map +1 -1
  6. package/dist/amt-gateway.d.ts.map +1 -1
  7. package/dist/amt-gateway.js +3 -4
  8. package/dist/amt-gateway.js.map +1 -1
  9. package/dist/driad-discovery.d.ts.map +1 -1
  10. package/dist/driad-discovery.js +3 -6
  11. package/dist/driad-discovery.js.map +1 -1
  12. package/dist/endpoint-config.d.ts +68 -0
  13. package/dist/endpoint-config.d.ts.map +1 -1
  14. package/dist/endpoint-config.js +118 -3
  15. package/dist/endpoint-config.js.map +1 -1
  16. package/dist/index.d.ts +10 -8
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +8 -11
  19. package/dist/index.js.map +1 -1
  20. package/dist/mmt-transport.no-modules.js +881 -60
  21. package/dist/mmt-transport.no-modules.js.map +4 -4
  22. package/dist/moqt-priority.d.ts +39 -0
  23. package/dist/moqt-priority.d.ts.map +1 -0
  24. package/dist/moqt-priority.js +41 -0
  25. package/dist/moqt-priority.js.map +1 -0
  26. package/dist/multicast-catalog-policy.d.ts +96 -0
  27. package/dist/multicast-catalog-policy.d.ts.map +1 -0
  28. package/dist/multicast-catalog-policy.js +660 -0
  29. package/dist/multicast-catalog-policy.js.map +1 -0
  30. package/dist/multicast-orchestrator.d.ts +24 -0
  31. package/dist/multicast-orchestrator.d.ts.map +1 -1
  32. package/dist/multicast-orchestrator.js +102 -9
  33. package/dist/multicast-orchestrator.js.map +1 -1
  34. package/dist/multicast-signaling-reconciler.d.ts +37 -0
  35. package/dist/multicast-signaling-reconciler.d.ts.map +1 -0
  36. package/dist/multicast-signaling-reconciler.js +161 -0
  37. package/dist/multicast-signaling-reconciler.js.map +1 -0
  38. package/dist/multicast-subscription-pool.d.ts.map +1 -1
  39. package/dist/multicast-subscription-pool.js +37 -10
  40. package/dist/multicast-subscription-pool.js.map +1 -1
  41. package/dist/multicast-tier.d.ts +19 -0
  42. package/dist/multicast-tier.d.ts.map +1 -1
  43. package/dist/multicast-tier.js +21 -4
  44. package/dist/multicast-tier.js.map +1 -1
  45. package/dist/no-modules.d.ts +40 -3
  46. package/dist/no-modules.d.ts.map +1 -1
  47. package/dist/no-modules.js +30 -3
  48. package/dist/no-modules.js.map +1 -1
  49. package/dist/packet-batch.d.ts +13 -0
  50. package/dist/packet-batch.d.ts.map +1 -0
  51. package/dist/packet-batch.js +14 -0
  52. package/dist/packet-batch.js.map +1 -0
  53. package/dist/stall-detector.d.ts +10 -0
  54. package/dist/stall-detector.d.ts.map +1 -1
  55. package/dist/stall-detector.js +21 -0
  56. package/dist/stall-detector.js.map +1 -1
  57. package/dist/takeover.d.ts +3 -0
  58. package/dist/takeover.d.ts.map +1 -1
  59. package/dist/takeover.js +35 -2
  60. package/dist/takeover.js.map +1 -1
  61. package/dist/transport-manager.d.ts +21 -17
  62. package/dist/transport-manager.d.ts.map +1 -1
  63. package/dist/transport-manager.js +63 -29
  64. package/dist/transport-manager.js.map +1 -1
  65. package/dist/types.d.ts +98 -123
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/types.js +12 -50
  68. package/dist/types.js.map +1 -1
  69. package/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
  70. package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  71. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
  72. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
  73. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
  74. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
  75. package/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
  76. package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
  77. package/node_modules/@blockcast/mmt-base/README.md +134 -0
  78. package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  79. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +55 -0
  80. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -0
  81. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +128 -0
  82. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -0
  83. package/node_modules/@blockcast/mmt-base/dist/index.d.ts +7 -0
  84. package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
  85. package/node_modules/@blockcast/mmt-base/dist/index.js +7 -0
  86. package/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
  87. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +292 -0
  88. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
  89. package/node_modules/@blockcast/mmt-base/dist/mmtp.js +612 -0
  90. package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
  91. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +18 -0
  92. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +1 -0
  93. package/node_modules/@blockcast/mmt-base/dist/net-constants.js +18 -0
  94. package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +1 -0
  95. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +47 -0
  96. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +1 -0
  97. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +54 -0
  98. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +1 -0
  99. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +57 -0
  100. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -0
  101. package/node_modules/@blockcast/mmt-base/dist/serial-number.js +98 -0
  102. package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -0
  103. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +312 -0
  104. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -0
  105. package/node_modules/@blockcast/mmt-base/dist/signalling.js +637 -0
  106. package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -0
  107. package/node_modules/@blockcast/mmt-base/package.json +49 -0
  108. package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +145 -0
  109. package/node_modules/@blockcast/mmt-base/src/index.ts +6 -0
  110. package/node_modules/@blockcast/mmt-base/src/mmtp.ts +892 -0
  111. package/node_modules/@blockcast/mmt-base/src/net-constants.ts +17 -0
  112. package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +67 -0
  113. package/node_modules/@blockcast/mmt-base/src/serial-number.ts +107 -0
  114. package/node_modules/@blockcast/mmt-base/src/signalling.ts +862 -0
  115. package/package.json +13 -6
  116. package/src/abr-controller.ts +81 -17
  117. package/src/amt-gateway.ts +3 -5
  118. package/src/driad-discovery.ts +3 -6
  119. package/src/endpoint-config.ts +157 -3
  120. package/src/index.ts +54 -33
  121. package/src/moqt-priority.ts +51 -0
  122. package/src/multicast-catalog-policy.ts +753 -0
  123. package/src/multicast-orchestrator.ts +114 -10
  124. package/src/multicast-signaling-reconciler.ts +156 -0
  125. package/src/multicast-subscription-pool.ts +46 -11
  126. package/src/multicast-tier.ts +30 -3
  127. package/src/no-modules.ts +54 -2
  128. package/src/packet-batch.ts +17 -0
  129. package/src/stall-detector.ts +37 -0
  130. package/src/takeover.ts +41 -3
  131. package/src/transport-manager.ts +64 -34
  132. package/src/types.ts +103 -160
  133. package/dist/endpoint-config.test.d.ts +0 -2
  134. package/dist/endpoint-config.test.d.ts.map +0 -1
  135. package/dist/endpoint-config.test.js +0 -39
  136. package/dist/endpoint-config.test.js.map +0 -1
  137. package/dist/fec-client.d.ts +0 -442
  138. package/dist/fec-client.d.ts.map +0 -1
  139. package/dist/fec-client.js +0 -789
  140. package/dist/fec-client.js.map +0 -1
  141. package/dist/fec-client.test.d.ts +0 -8
  142. package/dist/fec-client.test.d.ts.map +0 -1
  143. package/dist/fec-client.test.js +0 -112
  144. package/dist/fec-client.test.js.map +0 -1
  145. package/dist/multicast-subscription-pool.test.d.ts +0 -2
  146. package/dist/multicast-subscription-pool.test.d.ts.map +0 -1
  147. package/dist/multicast-subscription-pool.test.js +0 -108
  148. package/dist/multicast-subscription-pool.test.js.map +0 -1
  149. package/dist/multicast-tier.test.d.ts +0 -2
  150. package/dist/multicast-tier.test.d.ts.map +0 -1
  151. package/dist/multicast-tier.test.js +0 -75
  152. package/dist/multicast-tier.test.js.map +0 -1
  153. package/dist/stall-detector.test.d.ts +0 -2
  154. package/dist/stall-detector.test.d.ts.map +0 -1
  155. package/dist/stall-detector.test.js +0 -33
  156. package/dist/stall-detector.test.js.map +0 -1
  157. package/dist/transport-manager.test.d.ts +0 -2
  158. package/dist/transport-manager.test.d.ts.map +0 -1
  159. package/dist/transport-manager.test.js +0 -155
  160. package/dist/transport-manager.test.js.map +0 -1
  161. package/src/endpoint-config.test.ts +0 -54
  162. package/src/fec-client.test.ts +0 -140
  163. package/src/fec-client.ts +0 -1103
  164. package/src/multicast-subscription-pool.test.ts +0 -115
  165. package/src/multicast-tier.test.ts +0 -80
  166. package/src/stall-detector.test.ts +0 -34
  167. package/src/transport-manager.test.ts +0 -192
@@ -0,0 +1,39 @@
1
+ declare const subscriberPriorityBrand: unique symbol;
2
+ declare const publisherPriorityBrand: unique symbol;
3
+ export type MoqtSubscriberPriority = number & {
4
+ readonly [subscriberPriorityBrand]: true;
5
+ };
6
+ export type MoqtPublisherPriority = number & {
7
+ readonly [publisherPriorityBrand]: true;
8
+ };
9
+ /** Validate a protocol-native MOQT subscriber priority without transforming it. */
10
+ export declare function moqtSubscriberPriority(value: number): MoqtSubscriberPriority;
11
+ /** Validate a protocol-native MOQT publisher priority without transforming it. */
12
+ export declare function moqtPublisherPriority(value: number): MoqtPublisherPriority;
13
+ /** Shared media subscription policy on MOQT's native lower-number-wins scale. */
14
+ export declare const MOQT_SUBSCRIBER_PRIORITY: Readonly<{
15
+ catalog: MoqtSubscriberPriority;
16
+ /**
17
+ * @deprecated A repair FETCH's SUBSCRIBER_PRIORITY is derived per request
18
+ * from the catalog source and repair priorities (draft-ramadan-moq-fec
19
+ * §11.4.5), not a player constant. Use the `subscriberPriority` that
20
+ * `@blockcast/mmt-container`'s `wireRepairFetch` puts on each
21
+ * `RepairFetchRequest` (`repairFetchSubscriberPriority`).
22
+ */
23
+ deadlineRepair: MoqtSubscriberPriority;
24
+ audio: MoqtSubscriberPriority;
25
+ video: MoqtSubscriberPriority;
26
+ /**
27
+ * @deprecated See `deadlineRepair`: use the request's catalog-derived
28
+ * `RepairFetchRequest.subscriberPriority` (draft-ramadan-moq-fec §11.4.5).
29
+ */
30
+ backgroundRepair: MoqtSubscriberPriority;
31
+ }>;
32
+ /** Publisher priority bands from draft-ramadan-moq-fec section 10. */
33
+ export declare const MOQT_PUBLISHER_PRIORITY: Readonly<{
34
+ catalog: MoqtPublisherPriority;
35
+ source: MoqtPublisherPriority;
36
+ repair: MoqtPublisherPriority;
37
+ }>;
38
+ export {};
39
+ //# sourceMappingURL=moqt-priority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moqt-priority.d.ts","sourceRoot":"","sources":["../src/moqt-priority.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,MAAM,CAAC;AACrD,OAAO,CAAC,MAAM,sBAAsB,EAAE,OAAO,MAAM,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAC3F,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AASzF,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAE5E;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAE1E;AAED,iFAAiF;AACjF,eAAO,MAAM,wBAAwB;;IAEpC;;;;;;OAMG;;;;IAIH;;;OAGG;;EAEF,CAAC;AAEH,sEAAsE;AACtE,eAAO,MAAM,uBAAuB;;;;EAIlC,CAAC"}
@@ -0,0 +1,41 @@
1
+ const MAX_MOQT_PRIORITY = 0xff;
2
+ function moqtPriority(value, field) {
3
+ if (!Number.isInteger(value) || value < 0 || value > MAX_MOQT_PRIORITY) {
4
+ throw new RangeError(`${field} must be an integer in [0, ${MAX_MOQT_PRIORITY}], got ${value}`);
5
+ }
6
+ return value;
7
+ }
8
+ /** Validate a protocol-native MOQT subscriber priority without transforming it. */
9
+ export function moqtSubscriberPriority(value) {
10
+ return moqtPriority(value, "MOQT subscriber priority");
11
+ }
12
+ /** Validate a protocol-native MOQT publisher priority without transforming it. */
13
+ export function moqtPublisherPriority(value) {
14
+ return moqtPriority(value, "MOQT publisher priority");
15
+ }
16
+ /** Shared media subscription policy on MOQT's native lower-number-wins scale. */
17
+ export const MOQT_SUBSCRIBER_PRIORITY = Object.freeze({
18
+ catalog: moqtSubscriberPriority(0),
19
+ /**
20
+ * @deprecated A repair FETCH's SUBSCRIBER_PRIORITY is derived per request
21
+ * from the catalog source and repair priorities (draft-ramadan-moq-fec
22
+ * §11.4.5), not a player constant. Use the `subscriberPriority` that
23
+ * `@blockcast/mmt-container`'s `wireRepairFetch` puts on each
24
+ * `RepairFetchRequest` (`repairFetchSubscriberPriority`).
25
+ */
26
+ deadlineRepair: moqtSubscriberPriority(0),
27
+ audio: moqtSubscriberPriority(1),
28
+ video: moqtSubscriberPriority(2),
29
+ /**
30
+ * @deprecated See `deadlineRepair`: use the request's catalog-derived
31
+ * `RepairFetchRequest.subscriberPriority` (draft-ramadan-moq-fec §11.4.5).
32
+ */
33
+ backgroundRepair: moqtSubscriberPriority(3),
34
+ });
35
+ /** Publisher priority bands from draft-ramadan-moq-fec section 10. */
36
+ export const MOQT_PUBLISHER_PRIORITY = Object.freeze({
37
+ catalog: moqtPublisherPriority(32),
38
+ source: moqtPublisherPriority(128),
39
+ repair: moqtPublisherPriority(240),
40
+ });
41
+ //# sourceMappingURL=moqt-priority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moqt-priority.js","sourceRoot":"","sources":["../src/moqt-priority.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAQ/B,SAAS,YAAY,CAAC,KAAa,EAAE,KAAa;IACjD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,iBAAiB,EAAE,CAAC;QACxE,MAAM,IAAI,UAAU,CAAC,GAAG,KAAK,8BAA8B,iBAAiB,UAAU,KAAK,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,sBAAsB,CAAC,KAAa;IACnD,OAAO,YAAY,CAAC,KAAK,EAAE,0BAA0B,CAA2B,CAAC;AAClF,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAClD,OAAO,YAAY,CAAC,KAAK,EAAE,yBAAyB,CAA0B,CAAC;AAChF,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAClC;;;;;;OAMG;IACH,cAAc,EAAE,sBAAsB,CAAC,CAAC,CAAC;IACzC,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAChC,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAChC;;;OAGG;IACH,gBAAgB,EAAE,sBAAsB,CAAC,CAAC,CAAC;CAC3C,CAAC,CAAC;AAEH,sEAAsE;AACtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,EAAE,CAAC;IAClC,MAAM,EAAE,qBAAqB,CAAC,GAAG,CAAC;IAClC,MAAM,EAAE,qBAAqB,CAAC,GAAG,CAAC;CAClC,CAAC,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { type MulticastSignalingEndpoint } from "./multicast-signaling-reconciler.js";
2
+ import type { MulticastTierEndpoint } from "./multicast-tier.js";
3
+ import type { QualityLevel } from "./types.js";
4
+ type Catalog = Record<string, any>;
5
+ export interface PlayerMulticastConfig {
6
+ group: string;
7
+ source: string;
8
+ port: number;
9
+ mode?: string;
10
+ amtRelay?: string;
11
+ amtRelayPort?: number;
12
+ amtNetworkSource?: unknown;
13
+ packetIds?: number[];
14
+ }
15
+ export interface MulticastTrackSelection {
16
+ containerKind?: string;
17
+ rendition?: string;
18
+ }
19
+ export declare function hasMulticastCatalogBaseline(catalog: Catalog): boolean;
20
+ export declare function hasUnicastMediaRenditions(catalog: Catalog): boolean;
21
+ export declare function isMulticastOnlyCatalog(catalog: Catalog): boolean;
22
+ export declare function requiresMulticastCapability(catalog: Catalog, capabilities?: {
23
+ multicast?: boolean;
24
+ }): boolean;
25
+ export declare function isRecoverableMulticastSignalReadError(error: unknown): boolean;
26
+ export declare function withMulticastEndpoints(catalog: Catalog, endpoints: MulticastSignalingEndpoint[], version: number): Catalog;
27
+ export declare function selectMulticastCandidate(catalog: Catalog, endpoints?: MulticastSignalingEndpoint[], search?: string | URLSearchParams): MulticastSignalingEndpoint | null;
28
+ export declare function selectMulticastCandidateForTracks(catalog: Catalog, endpoints?: MulticastSignalingEndpoint[], selection?: MulticastTrackSelection): MulticastSignalingEndpoint | null;
29
+ export declare function endpointToMulticastConfig(endpoint: MulticastSignalingEndpoint | Record<string, any> | null | undefined, catalog: Catalog, selection?: MulticastTrackSelection): PlayerMulticastConfig | null;
30
+ export declare function selectEndpointPacketIds(endpoint: MulticastSignalingEndpoint | Record<string, any> | null | undefined, catalog: Catalog, search?: string | URLSearchParams): number[] | null;
31
+ export declare function selectEndpointPacketIdsForTracks(endpoint: MulticastSignalingEndpoint | Record<string, any> | null | undefined, catalog: Catalog, selection?: MulticastTrackSelection): number[] | null;
32
+ /** Read the player's explicit multicast override from `mc_*` URL parameters.
33
+ * Throws when an override carries a retired unprefixed alias
34
+ * (`assertNoRetiredMulticastUrlParams`). */
35
+ export declare function readPlayerMulticastConfig(search?: string | URLSearchParams): PlayerMulticastConfig | null;
36
+ export declare function normalizeMulticastConfig(config: Partial<PlayerMulticastConfig> | null | undefined): PlayerMulticastConfig | null;
37
+ export declare function sameMulticastConfig(a: Partial<PlayerMulticastConfig> | null | undefined, b: Partial<PlayerMulticastConfig> | null | undefined): boolean;
38
+ /** An omitted `urlConfig` is read from `location.search` by
39
+ * `readPlayerMulticastConfig`, which throws on a retired unprefixed alias
40
+ * inside an override. */
41
+ export declare function urlOverrideBlocksMulticastCandidate(candidateConfig: Partial<PlayerMulticastConfig> | null | undefined, urlConfig?: PlayerMulticastConfig | null): boolean;
42
+ /** Preserve catalog track selection while applying explicit URL transport policy.
43
+ * An omitted `urlConfig` is read from `location.search` by
44
+ * `readPlayerMulticastConfig`, which throws on a retired unprefixed alias
45
+ * inside an override. */
46
+ export declare function mergeUrlMulticastPolicy(candidateConfig: Partial<PlayerMulticastConfig> | null | undefined, urlConfig?: PlayerMulticastConfig | null): PlayerMulticastConfig | null;
47
+ /** True when an endpoint carries at least one track that is not a repair
48
+ * track, i.e. it can serve media on its own. A repair-layer endpoint carries
49
+ * only `fec-repair` tracks and is joined by the loss-driven layer policy, so
50
+ * it must be excluded from the bandwidth ladder (`selectMulticastTier`).
51
+ * An endpoint listing no tracks is treated as carrying media: that is the
52
+ * pre-layer signalling shape, and a naming-era catalog with no repair tracks
53
+ * declared classifies every endpoint as media.
54
+ *
55
+ * Throws on a catalog carrying the retired `commonTrackFields` or per-track
56
+ * `selectionParams`: repair membership cannot be derived from such a catalog,
57
+ * and classifying it as all-media would make repair-only endpoints joinable. */
58
+ export declare function endpointCarriesMedia(catalog: Catalog, endpoint: {
59
+ tracks?: {
60
+ name?: string;
61
+ }[];
62
+ } | null | undefined): boolean;
63
+ /** Catalog signalling endpoints as bandwidth-ladder endpoints, classified.
64
+ *
65
+ * Every ladder caller must build its `MulticastTierEndpoint[]` through this
66
+ * rather than hand-shaping them from the catalog: `carriesMedia` is optional
67
+ * and an unset one is treated as carrying media, so an endpoint that was
68
+ * never classified stays selectable as a tier and joining it would leave the
69
+ * receiver with repair symbols and no media. Classifying at the one place
70
+ * endpoints are converted is what makes that impossible to forget.
71
+ *
72
+ * `bandwidth` is carried through only when the endpoint declares a positive
73
+ * finite number and is never synthesized, so an endpoint that omits it stays
74
+ * unranked exactly as before. Only the fields the ladder reads are copied;
75
+ * signalling-only keys stay behind. */
76
+ export declare function catalogTierEndpoints(catalog: Catalog, endpoints?: MulticastSignalingEndpoint[]): MulticastTierEndpoint[];
77
+ /** The ABR ladder a catalog advertises, for `TransportManager.connect()`'s
78
+ * `abrLadder`: one rung per rendition of `role` (the role's `renditions` map
79
+ * and any `tracks` entry with that role), named by its catalog track name
80
+ * and costed at its catalog `bitrate`. `width`, `height` and `fps` are copied
81
+ * from `codedWidth`, `codedHeight` and `framerate` only when the catalog
82
+ * states them as positive numbers; none is defaulted. Rungs keep catalog
83
+ * order; the ABR controller walks them by ascending bitrate.
84
+ *
85
+ * Throws `RangeError` naming the first video rendition whose `bitrate` is not
86
+ * a positive finite number. ABR costs measured throughput against each
87
+ * rung's bitrate, so a rung without one cannot drive it, and the coded-size
88
+ * or name rank `videoRenditionRank` falls back to orders renditions without
89
+ * pricing them. A catalog that omits `bitrate` therefore has no ABR ladder:
90
+ * have its publisher state one per rendition, or connect with a ladder of
91
+ * only the renditions the caller can price. A catalog with no video
92
+ * rendition yields an empty ladder, which `connect()` refuses. Pass `"audio"`
93
+ * for an audio-only stream; the default is `"video"`. */
94
+ export declare function catalogQualityLadder(catalog: Catalog, role?: "video" | "audio"): QualityLevel[];
95
+ export {};
96
+ //# sourceMappingURL=multicast-catalog-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multicast-catalog-policy.d.ts","sourceRoot":"","sources":["../src/multicast-catalog-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAGrE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAGnE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEhE;AAED,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,OAAO,EAChB,YAAY,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,OAAO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