@blockcast/mmt-container 0.1.0 → 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 (799) hide show
  1. package/README.md +524 -0
  2. package/dist/.build-stamp +0 -0
  3. package/dist/__tests__/test-utils.d.ts +71 -0
  4. package/dist/__tests__/test-utils.d.ts.map +1 -0
  5. package/dist/align.d.ts +152 -0
  6. package/dist/align.d.ts.map +1 -0
  7. package/dist/align.js +88 -0
  8. package/dist/align.js.map +7 -0
  9. package/dist/audio-init-parser.d.ts +66 -0
  10. package/dist/audio-init-parser.d.ts.map +1 -0
  11. package/dist/audio-init-parser.js +118 -0
  12. package/dist/audio-init-parser.js.map +7 -0
  13. package/dist/audio-ring-buffer.d.ts +50 -0
  14. package/dist/audio-ring-buffer.d.ts.map +1 -0
  15. package/dist/audio-ring-buffer.js +80 -0
  16. package/dist/audio-ring-buffer.js.map +7 -0
  17. package/dist/authored-timing.d.ts +32 -0
  18. package/dist/authored-timing.d.ts.map +1 -0
  19. package/dist/authored-timing.js +32 -0
  20. package/dist/authored-timing.js.map +7 -0
  21. package/dist/block-policy.d.ts +314 -0
  22. package/dist/block-policy.d.ts.map +1 -0
  23. package/dist/block-policy.js +466 -0
  24. package/dist/block-policy.js.map +7 -0
  25. package/dist/browser-runtime.js +26549 -0
  26. package/dist/browser-runtime.js.map +7 -0
  27. package/dist/carp-catalog.d.ts +429 -0
  28. package/dist/carp-catalog.d.ts.map +1 -0
  29. package/dist/carp-catalog.js +985 -0
  30. package/dist/carp-catalog.js.map +7 -0
  31. package/dist/catalog-fec-params.d.ts +275 -0
  32. package/dist/catalog-fec-params.d.ts.map +1 -0
  33. package/dist/catalog-fec-params.js +702 -0
  34. package/dist/catalog-fec-params.js.map +7 -0
  35. package/dist/catalog-network-source.d.ts +42 -0
  36. package/dist/catalog-network-source.d.ts.map +1 -0
  37. package/dist/catalog-network-source.js +47 -0
  38. package/dist/catalog-network-source.js.map +7 -0
  39. package/dist/catalog-validator.d.ts +18 -0
  40. package/dist/catalog-validator.d.ts.map +1 -0
  41. package/dist/catalog-validator.js +7747 -0
  42. package/dist/catalog-validator.js.map +7 -0
  43. package/dist/cmaf-block-assembler.d.ts +285 -0
  44. package/dist/cmaf-block-assembler.d.ts.map +1 -0
  45. package/dist/cmaf-block-assembler.js +1966 -0
  46. package/dist/cmaf-block-assembler.js.map +7 -0
  47. package/dist/cmaf-group-batcher.d.ts +38 -0
  48. package/dist/cmaf-group-batcher.d.ts.map +1 -0
  49. package/dist/cmaf-group-batcher.js +176 -0
  50. package/dist/cmaf-group-batcher.js.map +7 -0
  51. package/dist/cmcd-producer.d.ts +104 -0
  52. package/dist/cmcd-producer.d.ts.map +1 -0
  53. package/dist/cmcd-producer.js +183 -0
  54. package/dist/cmcd-producer.js.map +7 -0
  55. package/dist/codec-utils.d.ts +384 -0
  56. package/dist/codec-utils.d.ts.map +1 -0
  57. package/dist/codec-utils.js +1546 -0
  58. package/dist/codec-utils.js.map +7 -0
  59. package/dist/conceal-timeline.d.ts +146 -0
  60. package/dist/conceal-timeline.d.ts.map +1 -0
  61. package/dist/conceal-timeline.js +137 -0
  62. package/dist/conceal-timeline.js.map +7 -0
  63. package/dist/delivery-gap.d.ts +75 -0
  64. package/dist/delivery-gap.d.ts.map +1 -0
  65. package/dist/delivery-gap.js +88 -0
  66. package/dist/delivery-gap.js.map +7 -0
  67. package/dist/duplicate-ledger.d.ts +197 -0
  68. package/dist/duplicate-ledger.d.ts.map +1 -0
  69. package/dist/duplicate-ledger.js +226 -0
  70. package/dist/duplicate-ledger.js.map +7 -0
  71. package/dist/fec-codec.d.ts +32 -0
  72. package/dist/fec-codec.d.ts.map +1 -0
  73. package/dist/fec-codec.js +47 -0
  74. package/dist/fec-codec.js.map +7 -0
  75. package/dist/fec-manager.d.ts +583 -0
  76. package/dist/fec-manager.d.ts.map +1 -0
  77. package/dist/fec-manager.js +3899 -0
  78. package/dist/fec-manager.js.map +7 -0
  79. package/dist/fec-starvation-detector.d.ts +59 -0
  80. package/dist/fec-starvation-detector.d.ts.map +1 -0
  81. package/dist/fec-starvation-detector.js +60 -0
  82. package/dist/fec-starvation-detector.js.map +7 -0
  83. package/dist/fec-state.d.ts +131 -0
  84. package/dist/fec-state.d.ts.map +1 -0
  85. package/dist/fec-state.js +87 -0
  86. package/dist/fec-state.js.map +7 -0
  87. package/dist/fec-worker-setup.d.ts +94 -0
  88. package/dist/fec-worker-setup.d.ts.map +1 -0
  89. package/dist/fec-worker-setup.js +673 -0
  90. package/dist/fec-worker-setup.js.map +7 -0
  91. package/dist/fmp4-completion.d.ts +30 -0
  92. package/dist/fmp4-completion.d.ts.map +1 -0
  93. package/dist/fmp4-completion.js +21 -0
  94. package/dist/fmp4-completion.js.map +7 -0
  95. package/dist/fmp4-reader.d.ts +37 -0
  96. package/dist/fmp4-reader.d.ts.map +1 -0
  97. package/dist/fmp4-reader.js +100 -0
  98. package/dist/fmp4-reader.js.map +7 -0
  99. package/dist/index.d.ts +44 -3
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +460 -14
  102. package/dist/index.js.map +7 -1
  103. package/dist/iso-block-locator.d.ts +118 -0
  104. package/dist/iso-block-locator.d.ts.map +1 -0
  105. package/dist/iso-block-locator.js +289 -0
  106. package/dist/iso-block-locator.js.map +7 -0
  107. package/dist/iso-bmff-timing.d.ts +78 -0
  108. package/dist/iso-bmff-timing.d.ts.map +1 -0
  109. package/dist/iso-bmff-timing.js +593 -0
  110. package/dist/iso-bmff-timing.js.map +7 -0
  111. package/dist/loc.d.ts +70 -75
  112. package/dist/loc.d.ts.map +1 -1
  113. package/dist/loc.js +106 -192
  114. package/dist/loc.js.map +7 -1
  115. package/dist/manifest-auth-plan.d.ts +30 -0
  116. package/dist/manifest-auth-plan.d.ts.map +1 -0
  117. package/dist/manifest-auth-plan.js +1266 -0
  118. package/dist/manifest-auth-plan.js.map +7 -0
  119. package/dist/media-router.d.ts +262 -0
  120. package/dist/media-router.d.ts.map +1 -0
  121. package/dist/media-router.js +584 -0
  122. package/dist/media-router.js.map +7 -0
  123. package/dist/mfu-reassembler.d.ts +313 -9
  124. package/dist/mfu-reassembler.d.ts.map +1 -1
  125. package/dist/mfu-reassembler.js +3051 -285
  126. package/dist/mfu-reassembler.js.map +7 -1
  127. package/dist/mfu-reassembly-policy.d.ts +24 -0
  128. package/dist/mfu-reassembly-policy.d.ts.map +1 -0
  129. package/dist/mfu-reassembly-policy.js +99 -0
  130. package/dist/mfu-reassembly-policy.js.map +7 -0
  131. package/dist/mmtp-container-parser.d.ts +568 -0
  132. package/dist/mmtp-container-parser.d.ts.map +1 -0
  133. package/dist/mmtp-container-parser.js +6580 -0
  134. package/dist/mmtp-container-parser.js.map +7 -0
  135. package/dist/mmtp-container-parser.no-modules.js +9616 -0
  136. package/dist/mmtp-container-parser.no-modules.js.map +7 -0
  137. package/dist/mmtp-decode-pipeline.d.ts +138 -0
  138. package/dist/mmtp-decode-pipeline.d.ts.map +1 -0
  139. package/dist/mmtp-decode-pipeline.js +6814 -0
  140. package/dist/mmtp-decode-pipeline.js.map +7 -0
  141. package/dist/mmtp-router.d.ts +679 -0
  142. package/dist/mmtp-router.d.ts.map +1 -0
  143. package/dist/mmtp-router.js +11278 -0
  144. package/dist/mmtp-router.js.map +7 -0
  145. package/dist/mmtp-to-cmaf.d.ts +187 -0
  146. package/dist/mmtp-to-cmaf.d.ts.map +1 -0
  147. package/dist/mmtp-to-cmaf.js +716 -0
  148. package/dist/mmtp-to-cmaf.js.map +7 -0
  149. package/dist/multicast-auth-catalog.d.ts +115 -0
  150. package/dist/multicast-auth-catalog.d.ts.map +1 -0
  151. package/dist/multicast-auth-catalog.js +202 -0
  152. package/dist/multicast-auth-catalog.js.map +7 -0
  153. package/dist/multicast-input.d.ts +141 -0
  154. package/dist/multicast-input.d.ts.map +1 -0
  155. package/dist/multicast-input.js +390 -0
  156. package/dist/multicast-input.js.map +7 -0
  157. package/dist/multicast-manager.d.ts +669 -0
  158. package/dist/multicast-manager.d.ts.map +1 -0
  159. package/dist/multicast-manager.js +19101 -0
  160. package/dist/multicast-manager.js.map +7 -0
  161. package/dist/multicast-transport.d.ts +271 -0
  162. package/dist/multicast-transport.d.ts.map +1 -0
  163. package/dist/multicast-transport.js +2264 -0
  164. package/dist/multicast-transport.js.map +7 -0
  165. package/dist/multicast-unwrap.d.ts +57 -0
  166. package/dist/multicast-unwrap.d.ts.map +1 -0
  167. package/dist/multicast-unwrap.js +418 -0
  168. package/dist/multicast-unwrap.js.map +7 -0
  169. package/dist/no-modules.d.ts +10 -0
  170. package/dist/no-modules.d.ts.map +1 -0
  171. package/dist/no-modules.js +9491 -0
  172. package/dist/no-modules.js.map +7 -0
  173. package/dist/phase14-catalog-override.d.ts +126 -0
  174. package/dist/phase14-catalog-override.d.ts.map +1 -0
  175. package/dist/phase14-catalog-override.js +155 -0
  176. package/dist/phase14-catalog-override.js.map +7 -0
  177. package/dist/repair-fetch.d.ts +270 -0
  178. package/dist/repair-fetch.d.ts.map +1 -0
  179. package/dist/repair-fetch.js +381 -0
  180. package/dist/repair-fetch.js.map +7 -0
  181. package/dist/repair-layers.d.ts +158 -0
  182. package/dist/repair-layers.d.ts.map +1 -0
  183. package/dist/repair-layers.js +344 -0
  184. package/dist/repair-layers.js.map +7 -0
  185. package/dist/sample-combiner.d.ts +212 -0
  186. package/dist/sample-combiner.d.ts.map +1 -0
  187. package/dist/sample-combiner.js +595 -0
  188. package/dist/sample-combiner.js.map +7 -0
  189. package/dist/signaling.d.ts +29 -0
  190. package/dist/signaling.d.ts.map +1 -0
  191. package/dist/signaling.js +572 -0
  192. package/dist/signaling.js.map +7 -0
  193. package/dist/source-auth.d.ts +2 -0
  194. package/dist/source-auth.d.ts.map +1 -0
  195. package/dist/source-auth.js +1209 -0
  196. package/dist/source-auth.js.map +7 -0
  197. package/dist/switching-set-alignment.d.ts +61 -0
  198. package/dist/switching-set-alignment.d.ts.map +1 -0
  199. package/dist/switching-set-alignment.js +70 -0
  200. package/dist/switching-set-alignment.js.map +7 -0
  201. package/dist/timestamp-codec.d.ts +34 -0
  202. package/dist/timestamp-codec.d.ts.map +1 -0
  203. package/dist/timestamp-codec.js +473 -0
  204. package/dist/timestamp-codec.js.map +7 -0
  205. package/dist/track-pipeline-setup.d.ts +83 -0
  206. package/dist/track-pipeline-setup.d.ts.map +1 -0
  207. package/dist/track-pipeline-setup.js +291 -0
  208. package/dist/track-pipeline-setup.js.map +7 -0
  209. package/dist/track-pipeline.d.ts +121 -0
  210. package/dist/track-pipeline.d.ts.map +1 -0
  211. package/dist/track-pipeline.js +209 -0
  212. package/dist/track-pipeline.js.map +7 -0
  213. package/dist/track-session.d.ts +414 -0
  214. package/dist/track-session.d.ts.map +1 -0
  215. package/dist/track-session.js +754 -0
  216. package/dist/track-session.js.map +7 -0
  217. package/dist/transport-pool.d.ts +69 -0
  218. package/dist/transport-pool.d.ts.map +1 -0
  219. package/dist/transport-pool.js +74 -0
  220. package/dist/transport-pool.js.map +7 -0
  221. package/dist/wasm-mfu-reassembler.d.ts +97 -0
  222. package/dist/wasm-mfu-reassembler.d.ts.map +1 -0
  223. package/dist/wasm-mfu-reassembler.js +2133 -0
  224. package/dist/wasm-mfu-reassembler.js.map +7 -0
  225. package/dist/wasm-mmtp-container-parser.d.ts +10 -0
  226. package/dist/wasm-mmtp-container-parser.d.ts.map +1 -0
  227. package/dist/wasm-mmtp-container-parser.js +6834 -0
  228. package/dist/wasm-mmtp-container-parser.js.map +7 -0
  229. package/node_modules/@blockcast/fec-worker/README.md +223 -0
  230. package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
  231. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts +38 -0
  232. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts.map +1 -0
  233. package/node_modules/@blockcast/fec-worker/dist/block-order.js +78 -0
  234. package/node_modules/@blockcast/fec-worker/dist/block-order.js.map +1 -0
  235. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +93 -0
  236. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +1 -0
  237. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +346 -0
  238. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +1 -0
  239. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +380 -0
  240. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +1 -0
  241. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +11 -0
  242. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +1 -0
  243. package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +14 -0
  244. package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +1 -0
  245. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +859 -0
  246. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +7 -0
  247. package/node_modules/@blockcast/fec-worker/dist/index.d.ts +10 -0
  248. package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +1 -0
  249. package/node_modules/@blockcast/fec-worker/dist/index.js +8 -0
  250. package/node_modules/@blockcast/fec-worker/dist/index.js.map +1 -0
  251. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +20 -0
  252. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +1 -0
  253. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +370 -0
  254. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +7 -0
  255. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +104 -0
  256. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +1 -0
  257. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +181 -0
  258. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +1 -0
  259. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +194 -0
  260. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +1 -0
  261. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +62 -0
  262. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +1 -0
  263. package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +9 -0
  264. package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +1 -0
  265. package/node_modules/@blockcast/fec-worker/dist/transfer.js +13 -0
  266. package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +1 -0
  267. package/node_modules/@blockcast/fec-worker/package.json +59 -0
  268. package/node_modules/@blockcast/fec-worker/src/block-order.ts +93 -0
  269. package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +392 -0
  270. package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +399 -0
  271. package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +1502 -0
  272. package/node_modules/@blockcast/fec-worker/src/index.ts +35 -0
  273. package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +589 -0
  274. package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +222 -0
  275. package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +209 -0
  276. package/node_modules/@blockcast/fec-worker/src/transfer.ts +12 -0
  277. package/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
  278. package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  279. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
  280. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
  281. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
  282. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
  283. package/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
  284. package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
  285. package/node_modules/@blockcast/mmt-base/README.md +134 -0
  286. package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  287. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +55 -0
  288. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -0
  289. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +128 -0
  290. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -0
  291. package/node_modules/@blockcast/mmt-base/dist/index.d.ts +7 -0
  292. package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
  293. package/node_modules/@blockcast/mmt-base/dist/index.js +7 -0
  294. package/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
  295. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +292 -0
  296. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
  297. package/node_modules/@blockcast/mmt-base/dist/mmtp.js +612 -0
  298. package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
  299. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +18 -0
  300. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +1 -0
  301. package/node_modules/@blockcast/mmt-base/dist/net-constants.js +18 -0
  302. package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +1 -0
  303. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +47 -0
  304. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +1 -0
  305. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +54 -0
  306. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +1 -0
  307. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +57 -0
  308. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -0
  309. package/node_modules/@blockcast/mmt-base/dist/serial-number.js +98 -0
  310. package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -0
  311. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +312 -0
  312. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -0
  313. package/node_modules/@blockcast/mmt-base/dist/signalling.js +637 -0
  314. package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -0
  315. package/node_modules/@blockcast/mmt-base/package.json +49 -0
  316. package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +145 -0
  317. package/node_modules/@blockcast/mmt-base/src/index.ts +6 -0
  318. package/node_modules/@blockcast/mmt-base/src/mmtp.ts +892 -0
  319. package/node_modules/@blockcast/mmt-base/src/net-constants.ts +17 -0
  320. package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +67 -0
  321. package/node_modules/@blockcast/mmt-base/src/serial-number.ts +107 -0
  322. package/node_modules/@blockcast/mmt-base/src/signalling.ts +862 -0
  323. package/node_modules/@blockcast/mmt-fec/README.md +271 -0
  324. package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
  325. package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +82 -0
  326. package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +1 -0
  327. package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +296 -0
  328. package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +1 -0
  329. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +106 -0
  330. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +1 -0
  331. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +288 -0
  332. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +1 -0
  333. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +46 -0
  334. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +1 -0
  335. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +96 -0
  336. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +1 -0
  337. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +33 -0
  338. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +1 -0
  339. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +57 -0
  340. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +1 -0
  341. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +205 -0
  342. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +1 -0
  343. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +240 -0
  344. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +1 -0
  345. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +28 -0
  346. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +1 -0
  347. package/node_modules/@blockcast/mmt-fec/dist/index.js +28 -0
  348. package/node_modules/@blockcast/mmt-fec/dist/index.js.map +1 -0
  349. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +20 -0
  350. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +1 -0
  351. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +28 -0
  352. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +1 -0
  353. package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +258 -0
  354. package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +1 -0
  355. package/node_modules/@blockcast/mmt-fec/dist/oti.js +382 -0
  356. package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +1 -0
  357. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +41 -0
  358. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +1 -0
  359. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +81 -0
  360. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +1 -0
  361. package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts +82 -0
  362. package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts.map +1 -0
  363. package/node_modules/@blockcast/mmt-fec/dist/repair-group.js +170 -0
  364. package/node_modules/@blockcast/mmt-fec/dist/repair-group.js.map +1 -0
  365. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +181 -0
  366. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  367. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +57 -0
  368. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +1 -0
  369. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +115 -0
  370. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +1 -0
  371. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +50 -0
  372. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +136 -0
  373. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +134 -0
  374. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  375. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +55 -0
  376. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +1 -0
  377. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +128 -0
  378. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +1 -0
  379. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +7 -0
  380. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +1 -0
  381. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +7 -0
  382. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +1 -0
  383. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +292 -0
  384. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +1 -0
  385. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +612 -0
  386. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +1 -0
  387. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +18 -0
  388. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +1 -0
  389. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js +18 -0
  390. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +1 -0
  391. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +47 -0
  392. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +1 -0
  393. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js +54 -0
  394. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +1 -0
  395. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +57 -0
  396. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +1 -0
  397. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js +98 -0
  398. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +1 -0
  399. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +312 -0
  400. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +1 -0
  401. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js +637 -0
  402. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js.map +1 -0
  403. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +49 -0
  404. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +145 -0
  405. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +6 -0
  406. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +892 -0
  407. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/net-constants.ts +17 -0
  408. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/ntp-short.ts +67 -0
  409. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/serial-number.ts +107 -0
  410. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/signalling.ts +862 -0
  411. package/node_modules/@blockcast/mmt-fec/package.json +79 -0
  412. package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +371 -0
  413. package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +439 -0
  414. package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +127 -0
  415. package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +68 -0
  416. package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +310 -0
  417. package/node_modules/@blockcast/mmt-fec/src/index.ts +94 -0
  418. package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +34 -0
  419. package/node_modules/@blockcast/mmt-fec/src/oti.ts +463 -0
  420. package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +101 -0
  421. package/node_modules/@blockcast/mmt-fec/src/repair-group.ts +195 -0
  422. package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
  423. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +28 -0
  424. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +1 -0
  425. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +128 -0
  426. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +1 -0
  427. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +4 -0
  428. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +1 -0
  429. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +4 -0
  430. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +1 -0
  431. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +37 -0
  432. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +1 -0
  433. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +179 -0
  434. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +1 -0
  435. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +99 -0
  436. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +1 -0
  437. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +492 -0
  438. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +1 -0
  439. package/node_modules/@blockcast/mmt-manifest-verify/package.json +45 -0
  440. package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +171 -0
  441. package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +3 -0
  442. package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +230 -0
  443. package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +669 -0
  444. package/node_modules/@noble/hashes/LICENSE +21 -0
  445. package/node_modules/@noble/hashes/README.md +521 -0
  446. package/node_modules/@noble/hashes/_assert.d.ts +17 -0
  447. package/node_modules/@noble/hashes/_assert.d.ts.map +1 -0
  448. package/node_modules/@noble/hashes/_assert.js +18 -0
  449. package/node_modules/@noble/hashes/_assert.js.map +1 -0
  450. package/node_modules/@noble/hashes/_blake.d.ts +14 -0
  451. package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
  452. package/node_modules/@noble/hashes/_blake.js +50 -0
  453. package/node_modules/@noble/hashes/_blake.js.map +1 -0
  454. package/node_modules/@noble/hashes/_md.d.ts +51 -0
  455. package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
  456. package/node_modules/@noble/hashes/_md.js +162 -0
  457. package/node_modules/@noble/hashes/_md.js.map +1 -0
  458. package/node_modules/@noble/hashes/_u64.d.ts +55 -0
  459. package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
  460. package/node_modules/@noble/hashes/_u64.js +90 -0
  461. package/node_modules/@noble/hashes/_u64.js.map +1 -0
  462. package/node_modules/@noble/hashes/argon2.d.ts +32 -0
  463. package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
  464. package/node_modules/@noble/hashes/argon2.js +401 -0
  465. package/node_modules/@noble/hashes/argon2.js.map +1 -0
  466. package/node_modules/@noble/hashes/blake1.d.ts +106 -0
  467. package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
  468. package/node_modules/@noble/hashes/blake1.js +459 -0
  469. package/node_modules/@noble/hashes/blake1.js.map +1 -0
  470. package/node_modules/@noble/hashes/blake2.d.ts +116 -0
  471. package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
  472. package/node_modules/@noble/hashes/blake2.js +420 -0
  473. package/node_modules/@noble/hashes/blake2.js.map +1 -0
  474. package/node_modules/@noble/hashes/blake2b.d.ts +11 -0
  475. package/node_modules/@noble/hashes/blake2b.d.ts.map +1 -0
  476. package/node_modules/@noble/hashes/blake2b.js +14 -0
  477. package/node_modules/@noble/hashes/blake2b.js.map +1 -0
  478. package/node_modules/@noble/hashes/blake2s.d.ts +20 -0
  479. package/node_modules/@noble/hashes/blake2s.d.ts.map +1 -0
  480. package/node_modules/@noble/hashes/blake2s.js +24 -0
  481. package/node_modules/@noble/hashes/blake2s.js.map +1 -0
  482. package/node_modules/@noble/hashes/blake3.d.ts +54 -0
  483. package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
  484. package/node_modules/@noble/hashes/blake3.js +255 -0
  485. package/node_modules/@noble/hashes/blake3.js.map +1 -0
  486. package/node_modules/@noble/hashes/crypto.d.ts +2 -0
  487. package/node_modules/@noble/hashes/crypto.d.ts.map +1 -0
  488. package/node_modules/@noble/hashes/crypto.js +5 -0
  489. package/node_modules/@noble/hashes/crypto.js.map +1 -0
  490. package/node_modules/@noble/hashes/cryptoNode.d.ts +2 -0
  491. package/node_modules/@noble/hashes/cryptoNode.d.ts.map +1 -0
  492. package/node_modules/@noble/hashes/cryptoNode.js +18 -0
  493. package/node_modules/@noble/hashes/cryptoNode.js.map +1 -0
  494. package/node_modules/@noble/hashes/eskdf.d.ts +47 -0
  495. package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
  496. package/node_modules/@noble/hashes/eskdf.js +166 -0
  497. package/node_modules/@noble/hashes/eskdf.js.map +1 -0
  498. package/node_modules/@noble/hashes/esm/_assert.d.ts +17 -0
  499. package/node_modules/@noble/hashes/esm/_assert.d.ts.map +1 -0
  500. package/node_modules/@noble/hashes/esm/_assert.js +15 -0
  501. package/node_modules/@noble/hashes/esm/_assert.js.map +1 -0
  502. package/node_modules/@noble/hashes/esm/_blake.d.ts +14 -0
  503. package/node_modules/@noble/hashes/esm/_blake.d.ts.map +1 -0
  504. package/node_modules/@noble/hashes/esm/_blake.js +45 -0
  505. package/node_modules/@noble/hashes/esm/_blake.js.map +1 -0
  506. package/node_modules/@noble/hashes/esm/_md.d.ts +51 -0
  507. package/node_modules/@noble/hashes/esm/_md.d.ts.map +1 -0
  508. package/node_modules/@noble/hashes/esm/_md.js +155 -0
  509. package/node_modules/@noble/hashes/esm/_md.js.map +1 -0
  510. package/node_modules/@noble/hashes/esm/_u64.d.ts +55 -0
  511. package/node_modules/@noble/hashes/esm/_u64.d.ts.map +1 -0
  512. package/node_modules/@noble/hashes/esm/_u64.js +67 -0
  513. package/node_modules/@noble/hashes/esm/_u64.js.map +1 -0
  514. package/node_modules/@noble/hashes/esm/argon2.d.ts +32 -0
  515. package/node_modules/@noble/hashes/esm/argon2.d.ts.map +1 -0
  516. package/node_modules/@noble/hashes/esm/argon2.js +392 -0
  517. package/node_modules/@noble/hashes/esm/argon2.js.map +1 -0
  518. package/node_modules/@noble/hashes/esm/blake1.d.ts +106 -0
  519. package/node_modules/@noble/hashes/esm/blake1.d.ts.map +1 -0
  520. package/node_modules/@noble/hashes/esm/blake1.js +452 -0
  521. package/node_modules/@noble/hashes/esm/blake1.js.map +1 -0
  522. package/node_modules/@noble/hashes/esm/blake2.d.ts +116 -0
  523. package/node_modules/@noble/hashes/esm/blake2.d.ts.map +1 -0
  524. package/node_modules/@noble/hashes/esm/blake2.js +413 -0
  525. package/node_modules/@noble/hashes/esm/blake2.js.map +1 -0
  526. package/node_modules/@noble/hashes/esm/blake2b.d.ts +11 -0
  527. package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +1 -0
  528. package/node_modules/@noble/hashes/esm/blake2b.js +11 -0
  529. package/node_modules/@noble/hashes/esm/blake2b.js.map +1 -0
  530. package/node_modules/@noble/hashes/esm/blake2s.d.ts +20 -0
  531. package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +1 -0
  532. package/node_modules/@noble/hashes/esm/blake2s.js +21 -0
  533. package/node_modules/@noble/hashes/esm/blake2s.js.map +1 -0
  534. package/node_modules/@noble/hashes/esm/blake3.d.ts +54 -0
  535. package/node_modules/@noble/hashes/esm/blake3.d.ts.map +1 -0
  536. package/node_modules/@noble/hashes/esm/blake3.js +251 -0
  537. package/node_modules/@noble/hashes/esm/blake3.js.map +1 -0
  538. package/node_modules/@noble/hashes/esm/crypto.d.ts +2 -0
  539. package/node_modules/@noble/hashes/esm/crypto.d.ts.map +1 -0
  540. package/node_modules/@noble/hashes/esm/crypto.js +2 -0
  541. package/node_modules/@noble/hashes/esm/crypto.js.map +1 -0
  542. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +2 -0
  543. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +1 -0
  544. package/node_modules/@noble/hashes/esm/cryptoNode.js +15 -0
  545. package/node_modules/@noble/hashes/esm/cryptoNode.js.map +1 -0
  546. package/node_modules/@noble/hashes/esm/eskdf.d.ts +47 -0
  547. package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +1 -0
  548. package/node_modules/@noble/hashes/esm/eskdf.js +160 -0
  549. package/node_modules/@noble/hashes/esm/eskdf.js.map +1 -0
  550. package/node_modules/@noble/hashes/esm/hkdf.d.ts +36 -0
  551. package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +1 -0
  552. package/node_modules/@noble/hashes/esm/hkdf.js +82 -0
  553. package/node_modules/@noble/hashes/esm/hkdf.js.map +1 -0
  554. package/node_modules/@noble/hashes/esm/hmac.d.ts +35 -0
  555. package/node_modules/@noble/hashes/esm/hmac.d.ts.map +1 -0
  556. package/node_modules/@noble/hashes/esm/hmac.js +86 -0
  557. package/node_modules/@noble/hashes/esm/hmac.js.map +1 -0
  558. package/node_modules/@noble/hashes/esm/index.d.ts +2 -0
  559. package/node_modules/@noble/hashes/esm/index.d.ts.map +1 -0
  560. package/node_modules/@noble/hashes/esm/index.js +33 -0
  561. package/node_modules/@noble/hashes/esm/index.js.map +1 -0
  562. package/node_modules/@noble/hashes/esm/legacy.d.ts +71 -0
  563. package/node_modules/@noble/hashes/esm/legacy.d.ts.map +1 -0
  564. package/node_modules/@noble/hashes/esm/legacy.js +281 -0
  565. package/node_modules/@noble/hashes/esm/legacy.js.map +1 -0
  566. package/node_modules/@noble/hashes/esm/package.json +10 -0
  567. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +23 -0
  568. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +1 -0
  569. package/node_modules/@noble/hashes/esm/pbkdf2.js +97 -0
  570. package/node_modules/@noble/hashes/esm/pbkdf2.js.map +1 -0
  571. package/node_modules/@noble/hashes/esm/ripemd160.d.ts +13 -0
  572. package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +1 -0
  573. package/node_modules/@noble/hashes/esm/ripemd160.js +13 -0
  574. package/node_modules/@noble/hashes/esm/ripemd160.js.map +1 -0
  575. package/node_modules/@noble/hashes/esm/scrypt.d.ts +34 -0
  576. package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +1 -0
  577. package/node_modules/@noble/hashes/esm/scrypt.js +228 -0
  578. package/node_modules/@noble/hashes/esm/scrypt.js.map +1 -0
  579. package/node_modules/@noble/hashes/esm/sha1.d.ts +11 -0
  580. package/node_modules/@noble/hashes/esm/sha1.d.ts.map +1 -0
  581. package/node_modules/@noble/hashes/esm/sha1.js +11 -0
  582. package/node_modules/@noble/hashes/esm/sha1.js.map +1 -0
  583. package/node_modules/@noble/hashes/esm/sha2.d.ts +159 -0
  584. package/node_modules/@noble/hashes/esm/sha2.d.ts.map +1 -0
  585. package/node_modules/@noble/hashes/esm/sha2.js +375 -0
  586. package/node_modules/@noble/hashes/esm/sha2.js.map +1 -0
  587. package/node_modules/@noble/hashes/esm/sha256.d.ts +20 -0
  588. package/node_modules/@noble/hashes/esm/sha256.d.ts.map +1 -0
  589. package/node_modules/@noble/hashes/esm/sha256.js +20 -0
  590. package/node_modules/@noble/hashes/esm/sha256.js.map +1 -0
  591. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +142 -0
  592. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +1 -0
  593. package/node_modules/@noble/hashes/esm/sha3-addons.js +393 -0
  594. package/node_modules/@noble/hashes/esm/sha3-addons.js.map +1 -0
  595. package/node_modules/@noble/hashes/esm/sha3.d.ts +53 -0
  596. package/node_modules/@noble/hashes/esm/sha3.d.ts.map +1 -0
  597. package/node_modules/@noble/hashes/esm/sha3.js +234 -0
  598. package/node_modules/@noble/hashes/esm/sha3.js.map +1 -0
  599. package/node_modules/@noble/hashes/esm/sha512.d.ts +26 -0
  600. package/node_modules/@noble/hashes/esm/sha512.d.ts.map +1 -0
  601. package/node_modules/@noble/hashes/esm/sha512.js +26 -0
  602. package/node_modules/@noble/hashes/esm/sha512.js.map +1 -0
  603. package/node_modules/@noble/hashes/esm/utils.d.ts +161 -0
  604. package/node_modules/@noble/hashes/esm/utils.d.ts.map +1 -0
  605. package/node_modules/@noble/hashes/esm/utils.js +281 -0
  606. package/node_modules/@noble/hashes/esm/utils.js.map +1 -0
  607. package/node_modules/@noble/hashes/hkdf.d.ts +36 -0
  608. package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
  609. package/node_modules/@noble/hashes/hkdf.js +88 -0
  610. package/node_modules/@noble/hashes/hkdf.js.map +1 -0
  611. package/node_modules/@noble/hashes/hmac.d.ts +35 -0
  612. package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
  613. package/node_modules/@noble/hashes/hmac.js +91 -0
  614. package/node_modules/@noble/hashes/hmac.js.map +1 -0
  615. package/node_modules/@noble/hashes/index.d.ts +1 -0
  616. package/node_modules/@noble/hashes/index.d.ts.map +1 -0
  617. package/node_modules/@noble/hashes/index.js +33 -0
  618. package/node_modules/@noble/hashes/index.js.map +1 -0
  619. package/node_modules/@noble/hashes/legacy.d.ts +71 -0
  620. package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
  621. package/node_modules/@noble/hashes/legacy.js +287 -0
  622. package/node_modules/@noble/hashes/legacy.js.map +1 -0
  623. package/node_modules/@noble/hashes/package.json +266 -0
  624. package/node_modules/@noble/hashes/pbkdf2.d.ts +23 -0
  625. package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
  626. package/node_modules/@noble/hashes/pbkdf2.js +101 -0
  627. package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
  628. package/node_modules/@noble/hashes/ripemd160.d.ts +13 -0
  629. package/node_modules/@noble/hashes/ripemd160.d.ts.map +1 -0
  630. package/node_modules/@noble/hashes/ripemd160.js +16 -0
  631. package/node_modules/@noble/hashes/ripemd160.js.map +1 -0
  632. package/node_modules/@noble/hashes/scrypt.d.ts +34 -0
  633. package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
  634. package/node_modules/@noble/hashes/scrypt.js +232 -0
  635. package/node_modules/@noble/hashes/scrypt.js.map +1 -0
  636. package/node_modules/@noble/hashes/sha1.d.ts +11 -0
  637. package/node_modules/@noble/hashes/sha1.d.ts.map +1 -0
  638. package/node_modules/@noble/hashes/sha1.js +14 -0
  639. package/node_modules/@noble/hashes/sha1.js.map +1 -0
  640. package/node_modules/@noble/hashes/sha2.d.ts +159 -0
  641. package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
  642. package/node_modules/@noble/hashes/sha2.js +384 -0
  643. package/node_modules/@noble/hashes/sha2.js.map +1 -0
  644. package/node_modules/@noble/hashes/sha256.d.ts +20 -0
  645. package/node_modules/@noble/hashes/sha256.d.ts.map +1 -0
  646. package/node_modules/@noble/hashes/sha256.js +23 -0
  647. package/node_modules/@noble/hashes/sha256.js.map +1 -0
  648. package/node_modules/@noble/hashes/sha3-addons.d.ts +142 -0
  649. package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
  650. package/node_modules/@noble/hashes/sha3-addons.js +402 -0
  651. package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
  652. package/node_modules/@noble/hashes/sha3.d.ts +53 -0
  653. package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
  654. package/node_modules/@noble/hashes/sha3.js +239 -0
  655. package/node_modules/@noble/hashes/sha3.js.map +1 -0
  656. package/node_modules/@noble/hashes/sha512.d.ts +26 -0
  657. package/node_modules/@noble/hashes/sha512.d.ts.map +1 -0
  658. package/node_modules/@noble/hashes/sha512.js +29 -0
  659. package/node_modules/@noble/hashes/sha512.js.map +1 -0
  660. package/node_modules/@noble/hashes/src/_assert.ts +22 -0
  661. package/node_modules/@noble/hashes/src/_blake.ts +50 -0
  662. package/node_modules/@noble/hashes/src/_md.ts +176 -0
  663. package/node_modules/@noble/hashes/src/_u64.ts +91 -0
  664. package/node_modules/@noble/hashes/src/argon2.ts +497 -0
  665. package/node_modules/@noble/hashes/src/blake1.ts +534 -0
  666. package/node_modules/@noble/hashes/src/blake2.ts +486 -0
  667. package/node_modules/@noble/hashes/src/blake2b.ts +10 -0
  668. package/node_modules/@noble/hashes/src/blake2s.ts +20 -0
  669. package/node_modules/@noble/hashes/src/blake3.ts +272 -0
  670. package/node_modules/@noble/hashes/src/crypto.ts +9 -0
  671. package/node_modules/@noble/hashes/src/cryptoNode.ts +15 -0
  672. package/node_modules/@noble/hashes/src/eskdf.ts +187 -0
  673. package/node_modules/@noble/hashes/src/hkdf.ts +88 -0
  674. package/node_modules/@noble/hashes/src/hmac.ts +94 -0
  675. package/node_modules/@noble/hashes/src/index.ts +31 -0
  676. package/node_modules/@noble/hashes/src/legacy.ts +293 -0
  677. package/node_modules/@noble/hashes/src/pbkdf2.ts +122 -0
  678. package/node_modules/@noble/hashes/src/ripemd160.ts +12 -0
  679. package/node_modules/@noble/hashes/src/scrypt.ts +257 -0
  680. package/node_modules/@noble/hashes/src/sha1.ts +10 -0
  681. package/node_modules/@noble/hashes/src/sha2.ts +402 -0
  682. package/node_modules/@noble/hashes/src/sha256.ts +24 -0
  683. package/node_modules/@noble/hashes/src/sha3-addons.ts +499 -0
  684. package/node_modules/@noble/hashes/src/sha3.ts +258 -0
  685. package/node_modules/@noble/hashes/src/sha512.ts +34 -0
  686. package/node_modules/@noble/hashes/src/utils.ts +395 -0
  687. package/node_modules/@noble/hashes/utils.d.ts +161 -0
  688. package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
  689. package/node_modules/@noble/hashes/utils.js +313 -0
  690. package/node_modules/@noble/hashes/utils.js.map +1 -0
  691. package/package.json +179 -8
  692. package/schemas/catalog.schema.json +357 -0
  693. package/src/align.ts +239 -0
  694. package/src/audio-init-parser.ts +189 -0
  695. package/src/audio-ring-buffer.ts +120 -0
  696. package/src/authored-timing.ts +63 -0
  697. package/src/block-policy.ts +903 -0
  698. package/src/carp-catalog.ts +1065 -0
  699. package/src/catalog-fec-params.ts +729 -0
  700. package/src/catalog-network-source.ts +74 -0
  701. package/src/catalog-validator.ts +34 -0
  702. package/src/cmaf-block-assembler.ts +1255 -0
  703. package/src/cmaf-group-batcher.ts +104 -0
  704. package/src/cmcd-producer.ts +329 -0
  705. package/src/codec-utils.ts +1984 -0
  706. package/src/conceal-timeline.ts +293 -0
  707. package/src/delivery-gap.ts +147 -0
  708. package/src/duplicate-ledger.ts +372 -0
  709. package/src/fec-codec.ts +61 -0
  710. package/src/fec-manager.ts +4298 -0
  711. package/src/fec-starvation-detector.ts +128 -0
  712. package/src/fec-state.ts +219 -0
  713. package/src/fec-worker-setup.ts +283 -0
  714. package/src/fmp4-completion.ts +47 -0
  715. package/src/fmp4-reader.ts +112 -0
  716. package/src/index.ts +590 -21
  717. package/src/iso-block-locator.ts +329 -0
  718. package/src/iso-bmff-timing.ts +813 -0
  719. package/src/loc.ts +128 -154
  720. package/src/manifest-auth-plan.ts +107 -0
  721. package/src/media-router.ts +841 -0
  722. package/src/mfu-reassembler.ts +3480 -155
  723. package/src/mfu-reassembly-policy.ts +134 -0
  724. package/src/mmtp-container-parser.ts +2380 -0
  725. package/src/mmtp-decode-pipeline.ts +406 -0
  726. package/src/mmtp-router.ts +4860 -0
  727. package/src/mmtp-to-cmaf.ts +977 -0
  728. package/src/multicast-auth-catalog.ts +340 -0
  729. package/src/multicast-input.ts +793 -0
  730. package/src/multicast-manager.ts +2783 -0
  731. package/src/multicast-transport.ts +1058 -0
  732. package/src/multicast-unwrap.ts +132 -0
  733. package/src/no-modules.ts +21 -0
  734. package/src/phase14-catalog-override.ts +336 -0
  735. package/src/repair-fetch.ts +772 -0
  736. package/src/repair-layers.ts +533 -0
  737. package/src/sample-combiner.ts +938 -0
  738. package/src/signaling.ts +78 -0
  739. package/src/source-auth.ts +1 -0
  740. package/src/switching-set-alignment.ts +109 -0
  741. package/src/timestamp-codec.ts +265 -0
  742. package/src/track-pipeline-setup.ts +205 -0
  743. package/src/track-pipeline.ts +332 -0
  744. package/src/track-session.ts +1010 -0
  745. package/src/transport-pool.ts +128 -0
  746. package/src/wasm-mfu-reassembler.ts +405 -0
  747. package/src/wasm-mmtp-container-parser.ts +23 -0
  748. package/test-vectors/align.json +199 -0
  749. package/test-vectors/catalog/README.md +106 -0
  750. package/test-vectors/catalog/negative/archive-origin-with-path.json +33 -0
  751. package/test-vectors/catalog/negative/archive-unknown-field.json +34 -0
  752. package/test-vectors/catalog/negative/fec-block-profile-missing.json +51 -0
  753. package/test-vectors/catalog/negative/fec-block-profile-unknown.json +52 -0
  754. package/test-vectors/catalog/negative/fec-enhancement-repair-removed.json +28 -0
  755. package/test-vectors/catalog/negative/fec-repair-layer-geometry.json +33 -0
  756. package/test-vectors/catalog/negative/fec-repair-layer-missing-symbols.json +31 -0
  757. package/test-vectors/catalog/negative/fec-repair-multiple-depends.json +32 -0
  758. package/test-vectors/catalog/negative/fec-repair-overlay-with-layer.json +34 -0
  759. package/test-vectors/catalog/negative/fec-repair-priority-out-of-band.json +24 -0
  760. package/test-vectors/catalog/negative/fec-repair-source-symbols-without-scope.json +33 -0
  761. package/test-vectors/catalog/negative/legacy-selection-params.json +15 -0
  762. package/test-vectors/catalog/negative/media-track-repair-layer.json +16 -0
  763. package/test-vectors/catalog/negative/missing-mmtp-fields.json +12 -0
  764. package/test-vectors/catalog/negative/multicast-auth-padded-key.json +37 -0
  765. package/test-vectors/catalog/negative/multicast-auth-reused-track-format.json +53 -0
  766. package/test-vectors/catalog/negative/multicast-auth-trailing-pad-bits.json +37 -0
  767. package/test-vectors/catalog/negative/multicast-endpoint-missing-protocol-and-source.json +24 -0
  768. package/test-vectors/catalog/negative/multicast-network-source-empty.json +44 -0
  769. package/test-vectors/catalog/negative/multicast-packet-id-signaling.json +26 -0
  770. package/test-vectors/catalog/negative/network-source-object.json +25 -0
  771. package/test-vectors/catalog/negative/raptorq-source-symbols-over-max.json +24 -0
  772. package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +27 -0
  773. package/test-vectors/catalog/negative/repair-track-legacy-shape.json +19 -0
  774. package/test-vectors/catalog/negative/track-role-empty.json +16 -0
  775. package/test-vectors/catalog/negative/track-role-non-string.json +16 -0
  776. package/test-vectors/catalog/positive/archive-origin.json +34 -0
  777. package/test-vectors/catalog/positive/fec-iso-ssbg1.json +52 -0
  778. package/test-vectors/catalog/positive/fec-layered-repair.json +106 -0
  779. package/test-vectors/catalog/positive/fec-multicast.json +52 -0
  780. package/test-vectors/catalog/positive/flat-av.json +30 -0
  781. package/test-vectors/catalog/positive/multicast-auth-rotation.json +55 -0
  782. package/test-vectors/catalog/positive/multicast-native-ssm-no-network-source.json +43 -0
  783. package/test-vectors/catalog/positive/ticks-and-mixed-timescales.json +39 -0
  784. package/test-vectors/catalog/positive/track-role.json +49 -0
  785. package/test-vectors/catalog/releases/moqcast-native-v16-v1/catalog.json +65 -0
  786. package/test-vectors/catalog/releases/moqcast-native-v16-v1.archive.sha256 +1 -0
  787. package/test-vectors/catalog-multicast-auth-v1.json +26 -0
  788. package/test-vectors/catalog-validation.json +732 -0
  789. package/test-vectors/catalog-validator-public-api.mjs +25 -0
  790. package/test-vectors/generate-source-auth-fixture.mjs +114 -0
  791. package/test-vectors/hevc-x265-repeat-headers-v1.json +40 -0
  792. package/test-vectors/source-auth-v1.json +61 -0
  793. package/test-vectors/source-contiguity-v1.json +131 -0
  794. package/test-vectors/subsample-placement-v1.json +230 -0
  795. package/dist/mmtp.d.ts +0 -73
  796. package/dist/mmtp.d.ts.map +0 -1
  797. package/dist/mmtp.js +0 -210
  798. package/dist/mmtp.js.map +0 -1
  799. package/src/mmtp.ts +0 -277
@@ -0,0 +1,772 @@
1
+ /**
2
+ * D-28 shared repair-fetch scheduler.
3
+ *
4
+ * Player-agnostic orchestration for per-SBN on-demand MoQ FEC repair
5
+ * backfill. Each player (moqtail client, hang watch, Shaka MSF bridge)
6
+ * supplies only its protocol verb via {@link RepairFetchTransport}:
7
+ *
8
+ * - moqtail: standalone FETCH (FetchType.Standalone) for group [sbn, sbn+1)
9
+ * - moq-lite/hang: Subscribe with startGroup=sbn, endGroup=sbn (the relay
10
+ * propagates startGroup upstream to pull the past group from the origin's
11
+ * producer cache)
12
+ *
13
+ * Everything else — registration, fire-time repair-track resolution,
14
+ * keyframe-first admission, preemption, feeding symbols, and in-flight slot
15
+ * release — is identical across players and lives here. The Player owns the
16
+ * scheduler: one per `wireRepairFetch` call, and its disposer aborts
17
+ * everything.
18
+ *
19
+ * Priority (from the block's class, see `repairPriorityForClass`):
20
+ * - P0 (keyframe / unknown) and P1 (audio) dispatch as soon as they are
21
+ * enqueued, with no cap. Each has its own fail deadline, and a cap would
22
+ * turn a recoverable protected block into a stall; their number is
23
+ * already bounded by the blocks one fail window can hold.
24
+ * - P2 (delta) dispatches only while no P0/P1 is queued or in flight,
25
+ * earliest absolute fail deadline first. Enqueuing a P0/P1 aborts every
26
+ * in-flight P2 (`repair-preempted`), which returns to the queue while its
27
+ * block is unresolved. A P2 that never ran before its block resolved is
28
+ * reported as `repair-deferred`.
29
+ * - A block reclassified to a higher class while its P2 fetch is in flight
30
+ * is re-issued at once under the new class's wire priority: the running
31
+ * FETCH is aborted (FETCH_CANCEL) and a new one sent.
32
+ *
33
+ * Wire priority (draft-ramadan-moq-fec §11.4.5): every request carries the
34
+ * MoQ Transport SUBSCRIBER_PRIORITY its FETCH must use, derived from the two
35
+ * catalog priorities `ResolveRepairTarget` returns (see
36
+ * `repairFetchSubscriberPriority`): a keyframe-bearing (or unknown) block's
37
+ * FETCH is sent in the Source Media range at no more than the source
38
+ * track's priority, so it is delivered ahead of every repair track and not
39
+ * shed with repair data; a delta or audio FETCH is sent at no less than the
40
+ * fetched repair track's priority, so it is shed first.
41
+ *
42
+ * Deadline and admission (BLO-35597): a repair FETCH rides the reliable path,
43
+ * so its deadline is the block's PRESENTATION deadline, not the multicast
44
+ * reassembly deadline. The player states how long after a block's first
45
+ * symbol its media can still be presented (`presentationDelayMs`); from the
46
+ * block's receiver-local anchor that gives an absolute deadline, never earlier
47
+ * than the multicast wait and never later than the release gate's hold ceiling
48
+ * (`terminalRetentionMsForPacket`), which bounds how long any successor frame
49
+ * may wait behind the block. A FETCH is sent only when the measured
50
+ * reliable-path RTT (`reliableRttMs`) is less than the time left to that
51
+ * deadline -- a request that cannot come back in time is never sent, rather
52
+ * than sent and cancelled -- and an admitted FETCH holds the block open to
53
+ * that deadline, so the multicast span elapsing never aborts it.
54
+ *
55
+ * The scheduler arms no timers. A fetch ends when its transport completes or
56
+ * throws, when it is preempted, when any later scheduling event finds it past
57
+ * its presentation deadline, when its block resolves (recovered, or failed at
58
+ * that deadline), on track reset, or on dispose.
59
+ */
60
+
61
+ import type { FecBlockProfile } from '@blockcast/mmt-base'
62
+ import { repairPriorityForClass, type BlockClass, type RepairPriority } from './block-policy.js'
63
+ import type { RepairLifecycleObserver } from './multicast-manager.js'
64
+ import { REPAIR_PRIORITY_MIN } from './repair-layers.js'
65
+
66
+ /** The MoQ Transport priority scale: 0..255, a lower value is delivered first. */
67
+ const MOQT_PRIORITY_MAX = 255
68
+
69
+ /**
70
+ * The highest value in the Source Media priority range of
71
+ * draft-ramadan-moq-fec §10 (64..191): one below the repair range, which
72
+ * starts at `REPAIR_PRIORITY_MIN` (192).
73
+ */
74
+ export const SOURCE_MEDIA_PRIORITY_MAX = REPAIR_PRIORITY_MIN - 1
75
+
76
+ /** What `ResolveRepairTarget` returns for one repair-bearing stream. */
77
+ export interface RepairTarget {
78
+ /** The repair track to FETCH (base layer 0 of the block's source). */
79
+ readonly repairTrack: string
80
+ /**
81
+ * The catalog `priority` of the SOURCE track the block belongs to, on the
82
+ * MoQ Transport scale (0..255, lower first), or null when the catalog
83
+ * carries none. Never a player constant: a keyframe repair must not be
84
+ * delivered behind the source it repairs, and only the catalog says what
85
+ * that source's priority is.
86
+ */
87
+ readonly sourcePriority: number | null
88
+ /**
89
+ * The catalog priority of `repairTrack` (MoQ Transport scale). Layer 0
90
+ * that declares none has the value draft-ramadan-moq-fec §10 defines
91
+ * (240); `resolveRepairLayers` / `catalogRepairTarget` already apply it.
92
+ * Null only when the resolver cannot read the repair track's entry.
93
+ */
94
+ readonly repairPriority: number | null
95
+ }
96
+
97
+ /** Resolve a packetId to its repair track and priorities at FIRE TIME.
98
+ *
99
+ * Called on every repair request, never cached by the shell: ABR ladder
100
+ * rungs can share a packetId (e.g. video/720p and video/360p both p:1), so
101
+ * the mapping must reflect the track active when the request fires, not
102
+ * when the shell was wired. Return null when the packetId has no
103
+ * repair-bearing track — the request is released without a fetch.
104
+ * `catalogRepairTarget` builds the answer from a catalog. */
105
+ export type ResolveRepairTarget = (
106
+ packetId: number,
107
+ catalogTrackName?: string,
108
+ ) => RepairTarget | null
109
+
110
+ /** One on-demand repair FETCH, as the scheduler hands it to the transport. */
111
+ export interface RepairFetchRequest {
112
+ /** Repair track whose block `sbn` is fetched. */
113
+ readonly repairTrack: string
114
+ /**
115
+ * The block's key, by `blockProfile` (BLO-35597 D2a):
116
+ * - `k-padded-v1`: the source block number, which IS the repair-track MoQ
117
+ * group id (fetch `[sbn, sbn]`).
118
+ * - `iso-ssbg1-v1`: the block's 32-bit SS_Start. The MoQ group id is the
119
+ * 62-bit `extSsStart(wrapEpoch, sbn)`; a receiver that knows only a lost
120
+ * SS_ID fetches `repairFetchRange(lostSsId, kMax, anchor)`, where `anchor`
121
+ * is `{ previousBlockStart }` (the extended start of the last block
122
+ * delimited before it) or `{ reference }` (an epoch reference). Never use
123
+ * it as a group id directly.
124
+ */
125
+ readonly sbn: number
126
+ /** The block profile `sbn` is keyed by (the catalog `fec.blockProfile`). */
127
+ readonly blockProfile: FecBlockProfile
128
+ /** The source packetId the block belongs to. */
129
+ readonly packetId: number
130
+ /**
131
+ * Aborts when the scheduler no longer wants the group: preemption by
132
+ * keyframe work, reprioritisation, block resolution, track reset, dispose.
133
+ */
134
+ readonly signal: AbortSignal
135
+ /**
136
+ * The SUBSCRIBER_PRIORITY parameter the FETCH MUST carry, on the MoQ
137
+ * Transport scale (0..255, lower delivered first), as
138
+ * draft-ramadan-moq-fec §11.4.5 requires. `undefined` means OMIT the
139
+ * parameter: the catalog carries no priority to derive it from, and the
140
+ * publisher then uses the value draft-ietf-moq-transport-16 §9.2.2.3
141
+ * defines for an omitted parameter (128, inside the Source Media range).
142
+ * A transport never substitutes a value of its own. A transport whose API
143
+ * uses another scale (moq-lite's higher-wins weight, say) maps this one
144
+ * without reordering it against the source and repair subscriptions.
145
+ */
146
+ readonly subscriberPriority: number | undefined
147
+ }
148
+
149
+ /** Protocol-specific fetch of one FEC block's repair group.
150
+ *
151
+ * Yield each repair object payload (MMTP packet bytes, ISO 23008-1 §C.5.3
152
+ * Repair FEC Payload ID framing). Return when the group ends.
153
+ *
154
+ * Put `request.subscriberPriority` on the FETCH (see RepairFetchRequest).
155
+ *
156
+ * When `request.signal` aborts, the transport MUST cancel the FETCH ON THE
157
+ * WIRE, not merely stop reading: send FETCH_CANCEL for its Request ID
158
+ * (draft-ietf-moq-transport-16 §9.18; STOP_SENDING on an open data stream
159
+ * as well, §5.2), and do it from the abort handler itself, before it
160
+ * returns. A relay that is never told keeps sending the group, so a
161
+ * preempted delta repair keeps competing with the keyframe repair that
162
+ * preempted it. The scheduler may issue the next request for the same block
163
+ * (reprioritisation) as soon as it aborts one, and §11.4.5 allows at most
164
+ * one repair FETCH outstanding per block and repair layer, so the cancel
165
+ * must already be queued ahead of that request. A FETCH whose Request ID
166
+ * is not known yet is cancelled as soon as FETCH_OK assigns it. */
167
+ export type RepairFetchTransport = (request: RepairFetchRequest) => AsyncIterable<Uint8Array>
168
+
169
+ /** Why a request could not carry a catalog-derived priority. */
170
+ export type RepairPriorityReason =
171
+ | 'source-priority-absent'
172
+ | 'source-priority-invalid'
173
+ | 'repair-priority-absent'
174
+ | 'repair-priority-invalid'
175
+
176
+ /**
177
+ * The wire priority of one repair request (draft-ramadan-moq-fec §11.4.5).
178
+ *
179
+ * - `carry`: send the FETCH with `subscriberPriority`.
180
+ * - `omit`: send it without SUBSCRIBER_PRIORITY. Only a keyframe-bearing or
181
+ * unknown block's request is ever sent this way: the publisher then uses
182
+ * 128 (draft-ietf-moq-transport-16 §9.2.2.3), which lies in the Source
183
+ * Media range, and without a catalog source priority there is no bound
184
+ * below it to honour.
185
+ * - `decline`: send no FETCH. A delta or audio FETCH MUST carry a priority
186
+ * at least its repair track's, so at least 192, and the omitted value (128)
187
+ * would put best-effort repair ahead of every repair track. Unicast repair
188
+ * is optional for those classes (§11.4.3, §11.4.4); in-band FEC and
189
+ * concealment still apply.
190
+ */
191
+ export type RepairFetchPriority =
192
+ | { readonly kind: 'carry'; readonly subscriberPriority: number }
193
+ | { readonly kind: 'omit'; readonly reason: RepairPriorityReason }
194
+ | { readonly kind: 'decline'; readonly reason: RepairPriorityReason }
195
+
196
+ function isMoqtPriority(value: number): boolean {
197
+ return Number.isSafeInteger(value) && value >= 0 && value <= MOQT_PRIORITY_MAX
198
+ }
199
+
200
+ /**
201
+ * Derive the SUBSCRIBER_PRIORITY of a repair FETCH from the block's class and
202
+ * the catalog priorities of its source and repair tracks
203
+ * (draft-ramadan-moq-fec §11.4.5 and the §10 ranges):
204
+ *
205
+ * - keyframe / unknown: in the Source Media range and no greater than the
206
+ * source track's priority, i.e. min(source, 191); omitted when the catalog
207
+ * carries no source priority.
208
+ * - delta / audio: no lower than the fetched repair track's priority and at
209
+ * least 192, i.e. max(repair, 192); declined when it carries none.
210
+ */
211
+ export function repairFetchSubscriberPriority(
212
+ blockClass: BlockClass,
213
+ target: Pick<RepairTarget, 'sourcePriority' | 'repairPriority'>,
214
+ ): RepairFetchPriority {
215
+ if (repairPriorityForClass(blockClass) === 0) {
216
+ const source = target.sourcePriority
217
+ if (source === null) return { kind: 'omit', reason: 'source-priority-absent' }
218
+ if (!isMoqtPriority(source)) return { kind: 'omit', reason: 'source-priority-invalid' }
219
+ return { kind: 'carry', subscriberPriority: Math.min(source, SOURCE_MEDIA_PRIORITY_MAX) }
220
+ }
221
+ const repair = target.repairPriority
222
+ if (repair === null) return { kind: 'decline', reason: 'repair-priority-absent' }
223
+ if (!isMoqtPriority(repair)) return { kind: 'decline', reason: 'repair-priority-invalid' }
224
+ return { kind: 'carry', subscriberPriority: Math.max(repair, REPAIR_PRIORITY_MIN) }
225
+ }
226
+
227
+ export interface WireRepairFetchOptions {
228
+ resolveTarget: ResolveRepairTarget
229
+ transport: RepairFetchTransport
230
+ /**
231
+ * Maximum transport attempts per block (required). A retry happens only
232
+ * when the transport rejects with an error `shouldRetry` classifies as
233
+ * retryable, before any symbol was fed, while the block's deadline remains.
234
+ */
235
+ attemptLimit: number
236
+ /** Classify a transport error as a transient publisher/relay retention race. */
237
+ shouldRetry?: (error: unknown) => boolean
238
+ /**
239
+ * The measured round-trip time of the reliable path the transport fetches
240
+ * over, in ms (required). Read at every admission, so it tracks the live
241
+ * session. A value that is not finite and positive, or a throw, means the
242
+ * path offers no measurement: nothing can show the FETCH would come back in
243
+ * time, so none is sent (`rtt-unmeasured`). Never a default.
244
+ */
245
+ reliableRttMs: () => number
246
+ /**
247
+ * How long after a block's first symbol arrived its media can still be
248
+ * presented, in ms (required): the player's own playout budget for the
249
+ * stream. Same fail-closed rule as `reliableRttMs`
250
+ * (`presentation-delay-unavailable`).
251
+ */
252
+ presentationDelayMs: (packetId: number, catalogTrackName?: string) => number
253
+ }
254
+
255
+ /** Why the D-28 layer asked for a repair: the block's class at its deadline. */
256
+ export type RepairSubscribeCallback = (
257
+ sbn: number,
258
+ packetId: number,
259
+ catalogTrackName: string | undefined,
260
+ blockClass: BlockClass,
261
+ ) => void
262
+
263
+ /** Why the scheduler sent no FETCH for a block it was asked to repair. */
264
+ export type RepairSkipReason =
265
+ /** The reliable path offered no RTT measurement; arrival cannot be shown. */
266
+ | 'rtt-unmeasured'
267
+ /** The measured RTT is not less than the time left to the deadline. */
268
+ | 'rtt-exceeds-budget'
269
+ /** The player gave no usable presentation delay for the block's stream. */
270
+ | 'presentation-delay-unavailable'
271
+
272
+ /** The subset of MulticastManager the scheduler drives. */
273
+ export interface RepairFetchHost {
274
+ readonly fecManager: {
275
+ blockProfileForPacket(packetId: number): FecBlockProfile | undefined
276
+ repairFetchTimeoutMsForBlock(sbn: number, packetId: number, catalogTrackName?: string): number
277
+ /** Receiver-local time of the block's first accepted symbol, if any. */
278
+ blockAnchorAtMs(sbn: number, packetId: number, catalogTrackName?: string): number | undefined
279
+ /** How long a terminal block stays authoritative: the release-gate hold ceiling. */
280
+ terminalRetentionMsForPacket(packetId: number): number
281
+ /** Keep the block open to `untilAtMs` for an admitted FETCH. */
282
+ holdBlockForRepair(
283
+ sbn: number,
284
+ packetId: number,
285
+ catalogTrackName: string | undefined,
286
+ untilAtMs: number,
287
+ ): boolean
288
+ /** The admitted FETCH ended without delivering: back to the multicast wait. */
289
+ releaseRepairHold(sbn: number, packetId: number, catalogTrackName?: string): void
290
+ }
291
+ onRepairSubscribe(cb: RepairSubscribeCallback): void
292
+ addRepairLifecycleObserver(observer: RepairLifecycleObserver): () => void
293
+ addTrackResetObserver(observer: (packetId: number, catalogTrackName: string) => void): () => void
294
+ clearRepairForBlock(sbn: number, packetId: number, catalogTrackName?: string): void
295
+ processRepairFromMoQ(packet: Uint8Array, ownerPacketId?: number, catalogTrackName?: string): void
296
+ noteRepairScheduling(
297
+ type: 'repair-preempted' | 'repair-deferred',
298
+ sbn: number,
299
+ packetId: number,
300
+ catalogTrackName?: string,
301
+ ): void
302
+ /** A request whose wire priority the catalog could not supply. */
303
+ noteRepairPriority(
304
+ action: 'omitted' | 'declined',
305
+ reason: RepairPriorityReason,
306
+ blockClass: BlockClass,
307
+ sbn: number,
308
+ packetId: number,
309
+ catalogTrackName?: string,
310
+ ): void
311
+ /** A request the scheduler did not send (see RepairSkipReason). */
312
+ noteRepairSkipped(
313
+ reason: RepairSkipReason,
314
+ measurement: { readonly rttMs: number | null; readonly budgetMs: number },
315
+ sbn: number,
316
+ packetId: number,
317
+ catalogTrackName?: string,
318
+ ): void
319
+ }
320
+
321
+ type StopReason = 'preempted' | 'reprioritized' | 'expired' | 'resolved' | 'reset' | 'disposed'
322
+
323
+ interface FetchRun {
324
+ readonly controller: AbortController
325
+ stopped: StopReason | null
326
+ }
327
+
328
+ interface RepairEntry {
329
+ readonly key: string
330
+ readonly sbn: number
331
+ readonly packetId: number
332
+ readonly catalogTrackName?: string
333
+ readonly repairTrack: string
334
+ readonly target: RepairTarget
335
+ /** The block profile `sbn` is keyed by, resolved before the entry is queued. */
336
+ readonly blockProfile: FecBlockProfile
337
+ priority: RepairPriority
338
+ /** SUBSCRIBER_PRIORITY for this entry's class; undefined = omit it. */
339
+ subscriberPriority: number | undefined
340
+ /**
341
+ * Absolute `performance.now()` millisecond by which a FETCH must land: the
342
+ * block's presentation deadline (see the module note).
343
+ */
344
+ readonly deadlineAt: number
345
+ /** Monotonic enqueue order, the EDF tie-break. */
346
+ readonly order: number
347
+ attempts: number
348
+ running: FetchRun | null
349
+ }
350
+
351
+ /**
352
+ * Wire the D-28 repair-fetch scheduler onto a MulticastManager.
353
+ *
354
+ * Call AFTER the manager has a repair-bearing FEC configuration (players gate
355
+ * this on the first fec-setup that carries a repairTrack) — registration arms
356
+ * the per-block repair deadlines in the FEC layer.
357
+ *
358
+ * Returns a dispose function that aborts outstanding fetches and stops new
359
+ * ones from being issued.
360
+ */
361
+ export function wireRepairFetch(mc: RepairFetchHost, opts: WireRepairFetchOptions): () => void {
362
+ if (!Number.isSafeInteger(opts.attemptLimit) || opts.attemptLimit < 1) {
363
+ throw new Error(
364
+ `[RepairFetch] attemptLimit=${String(opts.attemptLimit)} must be a positive integer`,
365
+ )
366
+ }
367
+ if (typeof opts.reliableRttMs !== 'function') {
368
+ throw new Error('[RepairFetch] reliableRttMs is required: repair admission needs the measured reliable-path RTT')
369
+ }
370
+ if (typeof opts.presentationDelayMs !== 'function') {
371
+ throw new Error('[RepairFetch] presentationDelayMs is required: a repair FETCH is due by the block\'s presentation deadline')
372
+ }
373
+ const entries = new Map<string, RepairEntry>()
374
+ const warnedNoTarget = new Set<string>()
375
+ let disposed = false
376
+ let enqueueOrder = 0
377
+
378
+ const requestKey = (sbn: number, packetId: number, catalogTrackName?: string): string =>
379
+ JSON.stringify([packetId, catalogTrackName ?? null, sbn])
380
+ const noTargetKey = (packetId: number, catalogTrackName?: string): string =>
381
+ JSON.stringify([packetId, catalogTrackName ?? null])
382
+
383
+ const clearRepair = (sbn: number, packetId: number, catalogTrackName?: string): void => {
384
+ if (catalogTrackName === undefined) mc.clearRepairForBlock(sbn, packetId)
385
+ else mc.clearRepairForBlock(sbn, packetId, catalogTrackName)
386
+ }
387
+ const note = (type: 'repair-preempted' | 'repair-deferred', entry: RepairEntry): void => {
388
+ mc.noteRepairScheduling(type, entry.sbn, entry.packetId, entry.catalogTrackName)
389
+ }
390
+
391
+ const releaseHold = (entry: RepairEntry): void => {
392
+ if (entry.catalogTrackName === undefined) mc.fecManager.releaseRepairHold(entry.sbn, entry.packetId)
393
+ else mc.fecManager.releaseRepairHold(entry.sbn, entry.packetId, entry.catalogTrackName)
394
+ }
395
+
396
+ const stop = (entry: RepairEntry, reason: StopReason): void => {
397
+ const run = entry.running
398
+ if (!run) return
399
+ entry.running = null
400
+ run.stopped = reason
401
+ run.controller.abort()
402
+ // A preempted delta returns to the queue; until it runs again nothing is
403
+ // in flight that could land, so the block goes back to its multicast wait.
404
+ if (reason === 'preempted') releaseHold(entry)
405
+ }
406
+
407
+ const readRtt = (): number | null => {
408
+ try {
409
+ const rtt = opts.reliableRttMs()
410
+ return Number.isFinite(rtt) && rtt > 0 ? rtt : null
411
+ } catch {
412
+ return null
413
+ }
414
+ }
415
+
416
+ /**
417
+ * RTT admission: send only a FETCH the measured round trip says can land
418
+ * before the entry's deadline. A refused entry is released, not queued: the
419
+ * deadline only gets closer.
420
+ */
421
+ const admit = (entry: RepairEntry, now: number): boolean => {
422
+ const budgetMs = entry.deadlineAt - now
423
+ const rttMs = readRtt()
424
+ if (rttMs !== null && rttMs < budgetMs) return true
425
+ retire(entry)
426
+ releaseHold(entry)
427
+ clearRepair(entry.sbn, entry.packetId, entry.catalogTrackName)
428
+ mc.noteRepairSkipped(
429
+ rttMs === null ? 'rtt-unmeasured' : 'rtt-exceeds-budget',
430
+ { rttMs, budgetMs },
431
+ entry.sbn,
432
+ entry.packetId,
433
+ entry.catalogTrackName,
434
+ )
435
+ return false
436
+ }
437
+
438
+ const retire = (entry: RepairEntry): void => {
439
+ if (entries.get(entry.key) === entry) entries.delete(entry.key)
440
+ }
441
+
442
+ const urgentOutstanding = (): boolean => {
443
+ for (const entry of entries.values()) {
444
+ if (entry.priority < 2) return true
445
+ }
446
+ return false
447
+ }
448
+
449
+ const preemptDeltas = (): void => {
450
+ for (const entry of entries.values()) {
451
+ if (entry.priority !== 2 || !entry.running) continue
452
+ stop(entry, 'preempted')
453
+ note('repair-preempted', entry)
454
+ }
455
+ }
456
+
457
+ /**
458
+ * The wire priority for `blockClass`, or null when no FETCH may be sent.
459
+ * A priority the catalog cannot supply is reported once per request.
460
+ */
461
+ const wirePriority = (
462
+ entry: Pick<RepairEntry, 'target' | 'sbn' | 'packetId' | 'catalogTrackName'>,
463
+ blockClass: BlockClass,
464
+ ): { subscriberPriority: number | undefined } | null => {
465
+ const derived = repairFetchSubscriberPriority(blockClass, entry.target)
466
+ if (derived.kind === 'carry') return { subscriberPriority: derived.subscriberPriority }
467
+ mc.noteRepairPriority(
468
+ derived.kind === 'omit' ? 'omitted' : 'declined',
469
+ derived.reason,
470
+ blockClass,
471
+ entry.sbn,
472
+ entry.packetId,
473
+ entry.catalogTrackName,
474
+ )
475
+ return derived.kind === 'omit' ? { subscriberPriority: undefined } : null
476
+ }
477
+
478
+ /** `counted` is false for a reprioritisation restart, which is no retry. */
479
+ const start = (entry: RepairEntry, counted = true): void => {
480
+ if (!admit(entry, performance.now())) return
481
+ if (counted) entry.attempts++
482
+ const run: FetchRun = { controller: new AbortController(), stopped: null }
483
+ entry.running = run
484
+ // Hold the block open to the presentation deadline while this FETCH can
485
+ // still land: the multicast span elapsing must not abort it.
486
+ mc.fecManager.holdBlockForRepair(
487
+ entry.sbn,
488
+ entry.packetId,
489
+ entry.catalogTrackName,
490
+ entry.deadlineAt,
491
+ )
492
+ void execute(entry, run)
493
+ }
494
+
495
+ const dispatch = (): void => {
496
+ if (disposed) return
497
+ const now = performance.now()
498
+ const queued: RepairEntry[] = []
499
+ for (const entry of [...entries.values()]) {
500
+ if (entry.running) {
501
+ // A fetch still running at its block's fail bound can no longer land
502
+ // in time. Cancel it here rather than trust the transport or the FEC
503
+ // layer's resolution to end it: a hung P0/P1 left running would keep
504
+ // urgentOutstanding() true and gate every P2 for the session.
505
+ if (entry.deadlineAt <= now) {
506
+ stop(entry, 'expired')
507
+ retire(entry)
508
+ clearRepair(entry.sbn, entry.packetId, entry.catalogTrackName)
509
+ }
510
+ continue
511
+ }
512
+ if (entry.deadlineAt <= now) {
513
+ // The block's fail bound has passed; its resolution is imminent and
514
+ // no fetch can land in time.
515
+ retire(entry)
516
+ if (entry.priority === 2 && entry.attempts === 0) note('repair-deferred', entry)
517
+ clearRepair(entry.sbn, entry.packetId, entry.catalogTrackName)
518
+ continue
519
+ }
520
+ queued.push(entry)
521
+ }
522
+ for (const entry of queued) {
523
+ if (entry.priority < 2) start(entry)
524
+ }
525
+ if (urgentOutstanding()) return
526
+ queued
527
+ .filter((entry) => entry.priority === 2)
528
+ .sort((a, b) => a.deadlineAt - b.deadlineAt || a.order - b.order)
529
+ .forEach((entry) => start(entry))
530
+ }
531
+
532
+ const finish = (entry: RepairEntry, run: FetchRun, fed: number, error: unknown): void => {
533
+ if (run.stopped !== null || entry.running !== run || entries.get(entry.key) !== entry) {
534
+ return
535
+ }
536
+ entry.running = null
537
+ if (error === undefined) {
538
+ retire(entry)
539
+ // A fetch that ended without feeding anything cannot resolve the block;
540
+ // release the slot and the hold so failure accounting is not wedged. A
541
+ // fetch that fed symbols leaves resolution to the FEC layer.
542
+ if (fed === 0) {
543
+ releaseHold(entry)
544
+ clearRepair(entry.sbn, entry.packetId, entry.catalogTrackName)
545
+ }
546
+ dispatch()
547
+ return
548
+ }
549
+ const retryable =
550
+ fed === 0 &&
551
+ entry.attempts < opts.attemptLimit &&
552
+ entry.deadlineAt > performance.now() &&
553
+ opts.shouldRetry?.(error) === true
554
+ if (retryable) {
555
+ // Back through the same admission rule: a P2 retry waits for P0/P1.
556
+ dispatch()
557
+ return
558
+ }
559
+ retire(entry)
560
+ if (fed === 0) releaseHold(entry)
561
+ clearRepair(entry.sbn, entry.packetId, entry.catalogTrackName)
562
+ console.warn(
563
+ `[RepairFetch] fetch failed pid=${entry.packetId} sbn=${entry.sbn} track=${entry.repairTrack}:`,
564
+ error,
565
+ )
566
+ dispatch()
567
+ }
568
+
569
+ // The profile the block key is in; a stream reaching repair was configured
570
+ // from its catalog, so an absent profile is a wiring fault, not a default.
571
+ // Resolved when the request arrives (onRepairSubscribe below), never inside
572
+ // execute: there its throw would read as an ordinary fetch failure, warned
573
+ // once per block while the stream silently lost unicast repair.
574
+ const blockProfileOf = (packetId: number): FecBlockProfile => {
575
+ const profile = mc.fecManager.blockProfileForPacket(packetId)
576
+ if (profile === undefined) {
577
+ throw new Error(`[RepairFetch] packetId=${packetId} has no configured fec.blockProfile`)
578
+ }
579
+ return profile
580
+ }
581
+
582
+ const execute = async (entry: RepairEntry, run: FetchRun): Promise<void> => {
583
+ let fed = 0
584
+ try {
585
+ for await (const packet of opts.transport({
586
+ repairTrack: entry.repairTrack,
587
+ sbn: entry.sbn,
588
+ blockProfile: entry.blockProfile,
589
+ packetId: entry.packetId,
590
+ signal: run.controller.signal,
591
+ subscriberPriority: entry.subscriberPriority,
592
+ })) {
593
+ if (run.stopped !== null || entry.running !== run) break
594
+ fed++
595
+ if (entry.catalogTrackName === undefined) {
596
+ mc.processRepairFromMoQ(packet, entry.packetId)
597
+ } else {
598
+ mc.processRepairFromMoQ(packet, entry.packetId, entry.catalogTrackName)
599
+ }
600
+ }
601
+ finish(entry, run, fed, undefined)
602
+ } catch (error) {
603
+ finish(entry, run, fed, error ?? new Error('repair transport rejected'))
604
+ }
605
+ }
606
+
607
+ const removeResetObserver = mc.addTrackResetObserver((packetId, catalogTrackName) => {
608
+ for (const entry of [...entries.values()]) {
609
+ if (entry.packetId !== packetId || entry.catalogTrackName !== catalogTrackName) continue
610
+ retire(entry)
611
+ stop(entry, 'reset')
612
+ }
613
+ // A reset is when the packetId -> repair-track mapping can change, so
614
+ // re-arm the once-per-track warn for the new epoch.
615
+ warnedNoTarget.delete(noTargetKey(packetId, catalogTrackName))
616
+ dispatch()
617
+ })
618
+
619
+ const removeLifecycleObserver = mc.addRepairLifecycleObserver((event) => {
620
+ if (disposed) return
621
+ if (event.type === 'reclassified') {
622
+ const entry = entries.get(
623
+ requestKey(event.block.sbn, event.block.packetId, event.block.catalogTrackName ?? undefined),
624
+ )
625
+ if (!entry || entry.priority !== 2) return
626
+ const promoted = repairPriorityForClass(event.to)
627
+ if (promoted >= entry.priority) return
628
+ const wire = wirePriority(entry, event.to)
629
+ // A block leaves P2 only for P0, whose request is never declined.
630
+ if (wire === null) return
631
+ entry.priority = promoted
632
+ entry.subscriberPriority = wire.subscriberPriority
633
+ if (entry.running) {
634
+ // The running FETCH carries the delta priority. Cancel it and send
635
+ // the block's repair again under its new class (§11.4.5): a keyframe
636
+ // repair must not stay queued behind source media.
637
+ stop(entry, 'reprioritized')
638
+ start(entry, false)
639
+ }
640
+ preemptDeltas()
641
+ dispatch()
642
+ return
643
+ }
644
+ if (event.type !== 'recovered' && event.type !== 'failed') return
645
+ const entry = entries.get(
646
+ requestKey(event.block.sbn, event.block.packetId, event.block.catalogTrackName ?? undefined),
647
+ )
648
+ if (!entry) return
649
+ retire(entry)
650
+ if (entry.running) stop(entry, 'resolved')
651
+ else if (entry.priority === 2 && entry.attempts === 0) note('repair-deferred', entry)
652
+ dispatch()
653
+ })
654
+
655
+ /**
656
+ * The block's presentation deadline, or null when the player gives none.
657
+ *
658
+ * anchor + presentationDelay, clamped below by the multicast wait (the block
659
+ * is open that long whatever happens, so a FETCH landing inside it still
660
+ * counts) and above by anchor + the release gate's hold ceiling (a successor
661
+ * frame may not wait behind a block longer than that). A block no symbol
662
+ * reached has no anchor; its deadline is the multicast wait.
663
+ */
664
+ const presentationDeadlineAt = (
665
+ sbn: number,
666
+ packetId: number,
667
+ catalogTrackName: string | undefined,
668
+ now: number,
669
+ ): number | null => {
670
+ const waitDeadlineAt =
671
+ now + mc.fecManager.repairFetchTimeoutMsForBlock(sbn, packetId, catalogTrackName)
672
+ const anchor = mc.fecManager.blockAnchorAtMs(sbn, packetId, catalogTrackName)
673
+ if (anchor === undefined) return waitDeadlineAt
674
+ let delayMs: number
675
+ try {
676
+ delayMs = opts.presentationDelayMs(packetId, catalogTrackName)
677
+ } catch {
678
+ return null
679
+ }
680
+ if (!(Number.isFinite(delayMs) && delayMs > 0)) return null
681
+ const ceilingAt = anchor + mc.fecManager.terminalRetentionMsForPacket(packetId)
682
+ return Math.max(waitDeadlineAt, Math.min(anchor + delayMs, ceilingAt))
683
+ }
684
+
685
+ mc.onRepairSubscribe((sbn, packetId, catalogTrackName, blockClass) => {
686
+ if (disposed) {
687
+ clearRepair(sbn, packetId, catalogTrackName)
688
+ return
689
+ }
690
+ // Throws on a wiring fault, here and synchronously, before anything is
691
+ // queued (see blockProfileOf).
692
+ const blockProfile = blockProfileOf(packetId)
693
+
694
+ // Fire-time resolution — see ResolveRepairTarget.
695
+ const target = opts.resolveTarget(packetId, catalogTrackName)
696
+ if (!target) {
697
+ // A starved block with no repair target can only resolve via the fail
698
+ // bound. Say so, once per track: a null target is also the documented
699
+ // answer for a rung that carries no repair, and the typed lifecycle
700
+ // events already enumerate every block.
701
+ const warnKey = noTargetKey(packetId, catalogTrackName)
702
+ if (!warnedNoTarget.has(warnKey)) {
703
+ warnedNoTarget.add(warnKey)
704
+ console.warn(
705
+ `[RepairFetch] no repair target for pid=${packetId} sbn=${sbn}` +
706
+ `${catalogTrackName === undefined ? '' : ` track=${catalogTrackName}`}; releasing without a fetch`,
707
+ )
708
+ }
709
+ clearRepair(sbn, packetId, catalogTrackName)
710
+ return
711
+ }
712
+
713
+ const key = requestKey(sbn, packetId, catalogTrackName)
714
+ const previous = entries.get(key)
715
+ if (previous) {
716
+ retire(previous)
717
+ stop(previous, 'reset')
718
+ }
719
+ const identity = {
720
+ target,
721
+ sbn,
722
+ packetId,
723
+ ...(catalogTrackName === undefined ? {} : { catalogTrackName }),
724
+ }
725
+ const wire = wirePriority(identity, blockClass)
726
+ if (wire === null) {
727
+ // No conformant FETCH exists for this block (see RepairFetchPriority).
728
+ clearRepair(sbn, packetId, catalogTrackName)
729
+ return
730
+ }
731
+ const now = performance.now()
732
+ const deadlineAt = presentationDeadlineAt(sbn, packetId, catalogTrackName, now)
733
+ if (deadlineAt === null) {
734
+ clearRepair(sbn, packetId, catalogTrackName)
735
+ mc.noteRepairSkipped(
736
+ 'presentation-delay-unavailable',
737
+ { rttMs: readRtt(), budgetMs: 0 },
738
+ sbn,
739
+ packetId,
740
+ catalogTrackName,
741
+ )
742
+ return
743
+ }
744
+ const entry: RepairEntry = {
745
+ key,
746
+ ...identity,
747
+ repairTrack: target.repairTrack,
748
+ blockProfile,
749
+ priority: repairPriorityForClass(blockClass),
750
+ subscriberPriority: wire.subscriberPriority,
751
+ deadlineAt,
752
+ order: enqueueOrder++,
753
+ attempts: 0,
754
+ running: null,
755
+ }
756
+ entries.set(key, entry)
757
+ if (entry.priority < 2) preemptDeltas()
758
+ dispatch()
759
+ })
760
+
761
+ return () => {
762
+ disposed = true
763
+ removeResetObserver()
764
+ removeLifecycleObserver()
765
+ for (const entry of [...entries.values()]) {
766
+ clearRepair(entry.sbn, entry.packetId, entry.catalogTrackName)
767
+ if (entry.running) releaseHold(entry)
768
+ stop(entry, 'disposed')
769
+ }
770
+ entries.clear()
771
+ }
772
+ }