@blockcast/mmt-container 0.3.0 → 0.4.0-main.1e94b11199ea

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 (606) hide show
  1. package/README.md +33 -16
  2. package/dist/browser-runtime.js +14816 -14254
  3. package/dist/browser-runtime.js.map +4 -4
  4. package/dist/carp-catalog.d.ts +24 -19
  5. package/dist/carp-catalog.d.ts.map +1 -1
  6. package/dist/carp-catalog.js +32 -14
  7. package/dist/carp-catalog.js.map +4 -4
  8. package/dist/catalog-fec-params.d.ts +88 -28
  9. package/dist/catalog-fec-params.d.ts.map +1 -1
  10. package/dist/catalog-fec-params.js +60 -23
  11. package/dist/catalog-fec-params.js.map +4 -4
  12. package/dist/catalog-network-source.js +1 -7
  13. package/dist/catalog-network-source.js.map +4 -4
  14. package/dist/cmaf-block-assembler.d.ts +0 -2
  15. package/dist/cmaf-block-assembler.d.ts.map +1 -1
  16. package/dist/cmaf-block-assembler.js +0 -1
  17. package/dist/cmaf-block-assembler.js.map +2 -2
  18. package/dist/cmcd-producer.d.ts.map +1 -1
  19. package/dist/cmcd-producer.js +0 -4
  20. package/dist/cmcd-producer.js.map +2 -2
  21. package/dist/delivery-catalog.d.ts +124 -0
  22. package/dist/delivery-catalog.d.ts.map +1 -0
  23. package/dist/delivery-catalog.js +1857 -0
  24. package/dist/delivery-catalog.js.map +7 -0
  25. package/dist/delta-fallback-config.d.ts +42 -0
  26. package/dist/delta-fallback-config.d.ts.map +1 -0
  27. package/dist/delta-fallback-config.js +59 -0
  28. package/dist/delta-fallback-config.js.map +7 -0
  29. package/dist/fec-manager.d.ts +52 -30
  30. package/dist/fec-manager.d.ts.map +1 -1
  31. package/dist/fec-manager.js +338 -293
  32. package/dist/fec-manager.js.map +4 -4
  33. package/dist/fec-state.d.ts +19 -31
  34. package/dist/fec-state.d.ts.map +1 -1
  35. package/dist/fec-state.js +4 -10
  36. package/dist/fec-state.js.map +4 -4
  37. package/dist/fec-worker-setup.d.ts +18 -14
  38. package/dist/fec-worker-setup.d.ts.map +1 -1
  39. package/dist/fec-worker-setup.js +81 -96
  40. package/dist/fec-worker-setup.js.map +4 -4
  41. package/dist/index.d.ts +5 -3
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +16 -0
  44. package/dist/index.js.map +2 -2
  45. package/dist/iso-block-locator.js +1 -7
  46. package/dist/iso-block-locator.js.map +4 -4
  47. package/dist/media-router.d.ts +20 -8
  48. package/dist/media-router.d.ts.map +1 -1
  49. package/dist/media-router.js +46 -21
  50. package/dist/media-router.js.map +2 -2
  51. package/dist/mfu-reassembler.js +24 -30
  52. package/dist/mfu-reassembler.js.map +4 -4
  53. package/dist/mmtp-container-parser.d.ts +14 -11
  54. package/dist/mmtp-container-parser.d.ts.map +1 -1
  55. package/dist/mmtp-container-parser.js +126 -99
  56. package/dist/mmtp-container-parser.js.map +4 -4
  57. package/dist/mmtp-container-parser.no-modules.js +154 -108
  58. package/dist/mmtp-container-parser.no-modules.js.map +4 -4
  59. package/dist/mmtp-decode-pipeline.js +126 -99
  60. package/dist/mmtp-decode-pipeline.js.map +4 -4
  61. package/dist/mmtp-router.d.ts +51 -29
  62. package/dist/mmtp-router.d.ts.map +1 -1
  63. package/dist/mmtp-router.js +260 -326
  64. package/dist/mmtp-router.js.map +4 -4
  65. package/dist/multicast-input.js +1 -7
  66. package/dist/multicast-input.js.map +4 -4
  67. package/dist/multicast-manager.d.ts +72 -6
  68. package/dist/multicast-manager.d.ts.map +1 -1
  69. package/dist/multicast-manager.js +882 -673
  70. package/dist/multicast-manager.js.map +4 -4
  71. package/dist/multicast-transport.d.ts +1 -1
  72. package/dist/multicast-transport.d.ts.map +1 -1
  73. package/dist/multicast-transport.js +44 -26
  74. package/dist/multicast-transport.js.map +4 -4
  75. package/dist/multicast-unwrap.js +29 -35
  76. package/dist/multicast-unwrap.js.map +4 -4
  77. package/dist/no-modules.js +150 -106
  78. package/dist/no-modules.js.map +4 -4
  79. package/dist/repair-fetch.d.ts +116 -21
  80. package/dist/repair-fetch.d.ts.map +1 -1
  81. package/dist/repair-fetch.js +114 -34
  82. package/dist/repair-fetch.js.map +4 -4
  83. package/dist/repair-layers.d.ts +18 -7
  84. package/dist/repair-layers.d.ts.map +1 -1
  85. package/dist/repair-layers.js +12 -10
  86. package/dist/repair-layers.js.map +4 -4
  87. package/dist/signaling.js +2 -11
  88. package/dist/signaling.js.map +4 -4
  89. package/dist/timestamp-codec.js +24 -30
  90. package/dist/timestamp-codec.js.map +4 -4
  91. package/dist/track-session.d.ts +7 -0
  92. package/dist/track-session.d.ts.map +1 -1
  93. package/dist/track-session.js +15 -8
  94. package/dist/track-session.js.map +2 -2
  95. package/dist/wasm-mfu-reassembler.js +1 -7
  96. package/dist/wasm-mfu-reassembler.js.map +4 -4
  97. package/dist/wasm-mmtp-container-parser.js +126 -99
  98. package/dist/wasm-mmtp-container-parser.js.map +4 -4
  99. package/package.json +7 -14
  100. package/schemas/catalog.schema.json +3 -3
  101. package/src/carp-catalog.ts +51 -24
  102. package/src/catalog-fec-params.ts +173 -64
  103. package/src/cmaf-block-assembler.ts +1 -4
  104. package/src/cmcd-producer.ts +0 -6
  105. package/src/delivery-catalog.ts +498 -0
  106. package/src/delta-fallback-config.ts +72 -0
  107. package/src/fec-manager.ts +457 -334
  108. package/src/fec-state.ts +20 -32
  109. package/src/fec-worker-setup.ts +109 -90
  110. package/src/index.ts +32 -0
  111. package/src/media-router.ts +59 -21
  112. package/src/mmtp-container-parser.ts +106 -20
  113. package/src/mmtp-router.ts +189 -330
  114. package/src/multicast-manager.ts +265 -86
  115. package/src/multicast-transport.ts +16 -9
  116. package/src/repair-fetch.ts +273 -43
  117. package/src/repair-layers.ts +28 -8
  118. package/src/track-session.ts +28 -9
  119. package/test-vectors/catalog/README.md +44 -18
  120. package/test-vectors/catalog/negative/fec-block-profile-retired.json +52 -0
  121. package/test-vectors/catalog/negative/fec-enhancement-repair-removed.json +1 -1
  122. package/test-vectors/catalog/negative/fec-repair-layer-geometry.json +1 -1
  123. package/test-vectors/catalog/negative/fec-repair-layer-missing-symbols.json +1 -1
  124. package/test-vectors/catalog/negative/fec-repair-multiple-depends.json +1 -1
  125. package/test-vectors/catalog/negative/fec-repair-overlay-with-layer.json +1 -1
  126. package/test-vectors/catalog/negative/fec-repair-priority-out-of-band.json +1 -1
  127. package/test-vectors/catalog/negative/fec-repair-source-symbols-without-scope.json +1 -1
  128. package/test-vectors/catalog/negative/multicast-endpoint-relay-address.json +39 -0
  129. package/test-vectors/catalog/negative/multicast-network-source-empty.json +1 -1
  130. package/test-vectors/catalog/negative/raptorq-source-symbols-over-max.json +1 -1
  131. package/test-vectors/catalog/negative/raptorq-unaligned-symbol.json +2 -1
  132. package/test-vectors/catalog/positive/fec-layered-repair.json +2 -2
  133. package/test-vectors/catalog/positive/fec-multicast.json +2 -1
  134. package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +38 -0
  135. package/test-vectors/catalog/positive/multicast-native-ssm-no-network-source.json +2 -1
  136. package/test-vectors/catalog/section-codes.json +33 -0
  137. package/test-vectors/catalog-timing.json +356 -0
  138. package/test-vectors/catalog-validation.json +40 -5
  139. package/test-vectors/delivery-catalog/README.md +11 -0
  140. package/test-vectors/delivery-catalog/negative/missing-block-profile.json +58 -0
  141. package/test-vectors/delivery-catalog/negative/packet-id-signaling.json +59 -0
  142. package/test-vectors/delivery-catalog/negative/retired-k-padded-block-profile.json +59 -0
  143. package/test-vectors/delivery-catalog/positive/dash.json +56 -0
  144. package/test-vectors/delivery-catalog/positive/mmtp-source-only.json +43 -0
  145. package/node_modules/@blockcast/fec-worker/README.md +0 -223
  146. package/node_modules/@blockcast/fec-worker/dist/.build-stamp +0 -0
  147. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts +0 -38
  148. package/node_modules/@blockcast/fec-worker/dist/block-order.d.ts.map +0 -1
  149. package/node_modules/@blockcast/fec-worker/dist/block-order.js +0 -78
  150. package/node_modules/@blockcast/fec-worker/dist/block-order.js.map +0 -1
  151. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts +0 -93
  152. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.d.ts.map +0 -1
  153. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js +0 -346
  154. package/node_modules/@blockcast/fec-worker/dist/fec-worker-client.js.map +0 -1
  155. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts +0 -380
  156. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.d.ts.map +0 -1
  157. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js +0 -11
  158. package/node_modules/@blockcast/fec-worker/dist/fec-worker-types.js.map +0 -1
  159. package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts +0 -14
  160. package/node_modules/@blockcast/fec-worker/dist/fec-worker.d.ts.map +0 -1
  161. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js +0 -859
  162. package/node_modules/@blockcast/fec-worker/dist/fec-worker.js.map +0 -7
  163. package/node_modules/@blockcast/fec-worker/dist/index.d.ts +0 -10
  164. package/node_modules/@blockcast/fec-worker/dist/index.d.ts.map +0 -1
  165. package/node_modules/@blockcast/fec-worker/dist/index.js +0 -8
  166. package/node_modules/@blockcast/fec-worker/dist/index.js.map +0 -1
  167. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts +0 -20
  168. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.d.ts.map +0 -1
  169. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js +0 -370
  170. package/node_modules/@blockcast/fec-worker/dist/shred-fec-worker.js.map +0 -7
  171. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts +0 -104
  172. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.d.ts.map +0 -1
  173. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js +0 -181
  174. package/node_modules/@blockcast/fec-worker/dist/shred-worker-client.js.map +0 -1
  175. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts +0 -194
  176. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.d.ts.map +0 -1
  177. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js +0 -62
  178. package/node_modules/@blockcast/fec-worker/dist/shred-worker-types.js.map +0 -1
  179. package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts +0 -9
  180. package/node_modules/@blockcast/fec-worker/dist/transfer.d.ts.map +0 -1
  181. package/node_modules/@blockcast/fec-worker/dist/transfer.js +0 -13
  182. package/node_modules/@blockcast/fec-worker/dist/transfer.js.map +0 -1
  183. package/node_modules/@blockcast/fec-worker/package.json +0 -59
  184. package/node_modules/@blockcast/fec-worker/src/block-order.ts +0 -93
  185. package/node_modules/@blockcast/fec-worker/src/fec-worker-client.ts +0 -392
  186. package/node_modules/@blockcast/fec-worker/src/fec-worker-types.ts +0 -399
  187. package/node_modules/@blockcast/fec-worker/src/fec-worker.ts +0 -1502
  188. package/node_modules/@blockcast/fec-worker/src/index.ts +0 -35
  189. package/node_modules/@blockcast/fec-worker/src/shred-fec-worker.ts +0 -589
  190. package/node_modules/@blockcast/fec-worker/src/shred-worker-client.ts +0 -222
  191. package/node_modules/@blockcast/fec-worker/src/shred-worker-types.ts +0 -209
  192. package/node_modules/@blockcast/fec-worker/src/transfer.ts +0 -12
  193. package/node_modules/@blockcast/mmt-alta-parse/README.md +0 -181
  194. package/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  195. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +0 -57
  196. package/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +0 -1
  197. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js +0 -115
  198. package/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +0 -1
  199. package/node_modules/@blockcast/mmt-alta-parse/package.json +0 -50
  200. package/node_modules/@blockcast/mmt-alta-parse/src/index.ts +0 -136
  201. package/node_modules/@blockcast/mmt-base/README.md +0 -134
  202. package/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  203. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +0 -55
  204. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +0 -1
  205. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +0 -128
  206. package/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +0 -1
  207. package/node_modules/@blockcast/mmt-base/dist/index.d.ts +0 -7
  208. package/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +0 -1
  209. package/node_modules/@blockcast/mmt-base/dist/index.js +0 -7
  210. package/node_modules/@blockcast/mmt-base/dist/index.js.map +0 -1
  211. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +0 -292
  212. package/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +0 -1
  213. package/node_modules/@blockcast/mmt-base/dist/mmtp.js +0 -612
  214. package/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +0 -1
  215. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +0 -18
  216. package/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +0 -1
  217. package/node_modules/@blockcast/mmt-base/dist/net-constants.js +0 -18
  218. package/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +0 -1
  219. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +0 -47
  220. package/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +0 -1
  221. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js +0 -54
  222. package/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +0 -1
  223. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -57
  224. package/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +0 -1
  225. package/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -98
  226. package/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +0 -1
  227. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +0 -312
  228. package/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +0 -1
  229. package/node_modules/@blockcast/mmt-base/dist/signalling.js +0 -637
  230. package/node_modules/@blockcast/mmt-base/dist/signalling.js.map +0 -1
  231. package/node_modules/@blockcast/mmt-base/package.json +0 -49
  232. package/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +0 -145
  233. package/node_modules/@blockcast/mmt-base/src/index.ts +0 -6
  234. package/node_modules/@blockcast/mmt-base/src/mmtp.ts +0 -892
  235. package/node_modules/@blockcast/mmt-base/src/net-constants.ts +0 -17
  236. package/node_modules/@blockcast/mmt-base/src/ntp-short.ts +0 -67
  237. package/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -107
  238. package/node_modules/@blockcast/mmt-base/src/signalling.ts +0 -862
  239. package/node_modules/@blockcast/mmt-fec/README.md +0 -271
  240. package/node_modules/@blockcast/mmt-fec/dist/.build-stamp +0 -0
  241. package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts +0 -82
  242. package/node_modules/@blockcast/mmt-fec/dist/block-manager.d.ts.map +0 -1
  243. package/node_modules/@blockcast/mmt-fec/dist/block-manager.js +0 -296
  244. package/node_modules/@blockcast/mmt-fec/dist/block-manager.js.map +0 -1
  245. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts +0 -106
  246. package/node_modules/@blockcast/mmt-fec/dist/block-processor.d.ts.map +0 -1
  247. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js +0 -288
  248. package/node_modules/@blockcast/mmt-fec/dist/block-processor.js.map +0 -1
  249. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts +0 -46
  250. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.d.ts.map +0 -1
  251. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js +0 -96
  252. package/node_modules/@blockcast/mmt-fec/dist/cmaf-recovery.js.map +0 -1
  253. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts +0 -33
  254. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.d.ts.map +0 -1
  255. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js +0 -57
  256. package/node_modules/@blockcast/mmt-fec/dist/cmaf-symbols.js.map +0 -1
  257. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts +0 -205
  258. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.d.ts.map +0 -1
  259. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js +0 -240
  260. package/node_modules/@blockcast/mmt-fec/dist/fec-block-mapper.js.map +0 -1
  261. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts +0 -28
  262. package/node_modules/@blockcast/mmt-fec/dist/index.d.ts.map +0 -1
  263. package/node_modules/@blockcast/mmt-fec/dist/index.js +0 -28
  264. package/node_modules/@blockcast/mmt-fec/dist/index.js.map +0 -1
  265. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts +0 -20
  266. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.d.ts.map +0 -1
  267. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js +0 -28
  268. package/node_modules/@blockcast/mmt-fec/dist/loc-symbols.js.map +0 -1
  269. package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts +0 -258
  270. package/node_modules/@blockcast/mmt-fec/dist/oti.d.ts.map +0 -1
  271. package/node_modules/@blockcast/mmt-fec/dist/oti.js +0 -382
  272. package/node_modules/@blockcast/mmt-fec/dist/oti.js.map +0 -1
  273. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts +0 -41
  274. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.d.ts.map +0 -1
  275. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js +0 -81
  276. package/node_modules/@blockcast/mmt-fec/dist/reorder-buffer.js.map +0 -1
  277. package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts +0 -82
  278. package/node_modules/@blockcast/mmt-fec/dist/repair-group.d.ts.map +0 -1
  279. package/node_modules/@blockcast/mmt-fec/dist/repair-group.js +0 -170
  280. package/node_modules/@blockcast/mmt-fec/dist/repair-group.js.map +0 -1
  281. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/README.md +0 -181
  282. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/.build-stamp +0 -0
  283. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts +0 -57
  284. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.d.ts.map +0 -1
  285. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js +0 -115
  286. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/dist/index.js.map +0 -1
  287. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/package.json +0 -50
  288. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-alta-parse/src/index.ts +0 -136
  289. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/README.md +0 -134
  290. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/.build-stamp +0 -0
  291. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts +0 -55
  292. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.d.ts.map +0 -1
  293. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js +0 -128
  294. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/fec-block-profile.js.map +0 -1
  295. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts +0 -7
  296. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.d.ts.map +0 -1
  297. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js +0 -7
  298. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/index.js.map +0 -1
  299. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts +0 -292
  300. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.d.ts.map +0 -1
  301. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js +0 -612
  302. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/mmtp.js.map +0 -1
  303. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts +0 -18
  304. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.d.ts.map +0 -1
  305. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js +0 -18
  306. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/net-constants.js.map +0 -1
  307. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts +0 -47
  308. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.d.ts.map +0 -1
  309. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js +0 -54
  310. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/ntp-short.js.map +0 -1
  311. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts +0 -57
  312. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.d.ts.map +0 -1
  313. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js +0 -98
  314. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/serial-number.js.map +0 -1
  315. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts +0 -312
  316. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.d.ts.map +0 -1
  317. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js +0 -637
  318. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/dist/signalling.js.map +0 -1
  319. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/package.json +0 -49
  320. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/fec-block-profile.ts +0 -145
  321. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/index.ts +0 -6
  322. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/mmtp.ts +0 -892
  323. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/net-constants.ts +0 -17
  324. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/ntp-short.ts +0 -67
  325. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/serial-number.ts +0 -107
  326. package/node_modules/@blockcast/mmt-fec/node_modules/@blockcast/mmt-base/src/signalling.ts +0 -862
  327. package/node_modules/@blockcast/mmt-fec/package.json +0 -79
  328. package/node_modules/@blockcast/mmt-fec/src/block-manager.ts +0 -371
  329. package/node_modules/@blockcast/mmt-fec/src/block-processor.ts +0 -439
  330. package/node_modules/@blockcast/mmt-fec/src/cmaf-recovery.ts +0 -127
  331. package/node_modules/@blockcast/mmt-fec/src/cmaf-symbols.ts +0 -68
  332. package/node_modules/@blockcast/mmt-fec/src/fec-block-mapper.ts +0 -310
  333. package/node_modules/@blockcast/mmt-fec/src/index.ts +0 -94
  334. package/node_modules/@blockcast/mmt-fec/src/loc-symbols.ts +0 -34
  335. package/node_modules/@blockcast/mmt-fec/src/oti.ts +0 -463
  336. package/node_modules/@blockcast/mmt-fec/src/reorder-buffer.ts +0 -101
  337. package/node_modules/@blockcast/mmt-fec/src/repair-group.ts +0 -195
  338. package/node_modules/@blockcast/mmt-manifest-verify/dist/.build-stamp +0 -0
  339. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts +0 -28
  340. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.d.ts.map +0 -1
  341. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js +0 -128
  342. package/node_modules/@blockcast/mmt-manifest-verify/dist/admission.js.map +0 -1
  343. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts +0 -4
  344. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.d.ts.map +0 -1
  345. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js +0 -4
  346. package/node_modules/@blockcast/mmt-manifest-verify/dist/index.js.map +0 -1
  347. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts +0 -37
  348. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.d.ts.map +0 -1
  349. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js +0 -179
  350. package/node_modules/@blockcast/mmt-manifest-verify/dist/source-auth.js.map +0 -1
  351. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts +0 -99
  352. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.d.ts.map +0 -1
  353. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js +0 -492
  354. package/node_modules/@blockcast/mmt-manifest-verify/dist/verifier.js.map +0 -1
  355. package/node_modules/@blockcast/mmt-manifest-verify/package.json +0 -45
  356. package/node_modules/@blockcast/mmt-manifest-verify/src/admission.ts +0 -171
  357. package/node_modules/@blockcast/mmt-manifest-verify/src/index.ts +0 -3
  358. package/node_modules/@blockcast/mmt-manifest-verify/src/source-auth.ts +0 -230
  359. package/node_modules/@blockcast/mmt-manifest-verify/src/verifier.ts +0 -669
  360. package/node_modules/@noble/hashes/LICENSE +0 -21
  361. package/node_modules/@noble/hashes/README.md +0 -521
  362. package/node_modules/@noble/hashes/_assert.d.ts +0 -17
  363. package/node_modules/@noble/hashes/_assert.d.ts.map +0 -1
  364. package/node_modules/@noble/hashes/_assert.js +0 -18
  365. package/node_modules/@noble/hashes/_assert.js.map +0 -1
  366. package/node_modules/@noble/hashes/_blake.d.ts +0 -14
  367. package/node_modules/@noble/hashes/_blake.d.ts.map +0 -1
  368. package/node_modules/@noble/hashes/_blake.js +0 -50
  369. package/node_modules/@noble/hashes/_blake.js.map +0 -1
  370. package/node_modules/@noble/hashes/_md.d.ts +0 -51
  371. package/node_modules/@noble/hashes/_md.d.ts.map +0 -1
  372. package/node_modules/@noble/hashes/_md.js +0 -162
  373. package/node_modules/@noble/hashes/_md.js.map +0 -1
  374. package/node_modules/@noble/hashes/_u64.d.ts +0 -55
  375. package/node_modules/@noble/hashes/_u64.d.ts.map +0 -1
  376. package/node_modules/@noble/hashes/_u64.js +0 -90
  377. package/node_modules/@noble/hashes/_u64.js.map +0 -1
  378. package/node_modules/@noble/hashes/argon2.d.ts +0 -32
  379. package/node_modules/@noble/hashes/argon2.d.ts.map +0 -1
  380. package/node_modules/@noble/hashes/argon2.js +0 -401
  381. package/node_modules/@noble/hashes/argon2.js.map +0 -1
  382. package/node_modules/@noble/hashes/blake1.d.ts +0 -106
  383. package/node_modules/@noble/hashes/blake1.d.ts.map +0 -1
  384. package/node_modules/@noble/hashes/blake1.js +0 -459
  385. package/node_modules/@noble/hashes/blake1.js.map +0 -1
  386. package/node_modules/@noble/hashes/blake2.d.ts +0 -116
  387. package/node_modules/@noble/hashes/blake2.d.ts.map +0 -1
  388. package/node_modules/@noble/hashes/blake2.js +0 -420
  389. package/node_modules/@noble/hashes/blake2.js.map +0 -1
  390. package/node_modules/@noble/hashes/blake2b.d.ts +0 -11
  391. package/node_modules/@noble/hashes/blake2b.d.ts.map +0 -1
  392. package/node_modules/@noble/hashes/blake2b.js +0 -14
  393. package/node_modules/@noble/hashes/blake2b.js.map +0 -1
  394. package/node_modules/@noble/hashes/blake2s.d.ts +0 -20
  395. package/node_modules/@noble/hashes/blake2s.d.ts.map +0 -1
  396. package/node_modules/@noble/hashes/blake2s.js +0 -24
  397. package/node_modules/@noble/hashes/blake2s.js.map +0 -1
  398. package/node_modules/@noble/hashes/blake3.d.ts +0 -54
  399. package/node_modules/@noble/hashes/blake3.d.ts.map +0 -1
  400. package/node_modules/@noble/hashes/blake3.js +0 -255
  401. package/node_modules/@noble/hashes/blake3.js.map +0 -1
  402. package/node_modules/@noble/hashes/crypto.d.ts +0 -2
  403. package/node_modules/@noble/hashes/crypto.d.ts.map +0 -1
  404. package/node_modules/@noble/hashes/crypto.js +0 -5
  405. package/node_modules/@noble/hashes/crypto.js.map +0 -1
  406. package/node_modules/@noble/hashes/cryptoNode.d.ts +0 -2
  407. package/node_modules/@noble/hashes/cryptoNode.d.ts.map +0 -1
  408. package/node_modules/@noble/hashes/cryptoNode.js +0 -18
  409. package/node_modules/@noble/hashes/cryptoNode.js.map +0 -1
  410. package/node_modules/@noble/hashes/eskdf.d.ts +0 -47
  411. package/node_modules/@noble/hashes/eskdf.d.ts.map +0 -1
  412. package/node_modules/@noble/hashes/eskdf.js +0 -166
  413. package/node_modules/@noble/hashes/eskdf.js.map +0 -1
  414. package/node_modules/@noble/hashes/esm/_assert.d.ts +0 -17
  415. package/node_modules/@noble/hashes/esm/_assert.d.ts.map +0 -1
  416. package/node_modules/@noble/hashes/esm/_assert.js +0 -15
  417. package/node_modules/@noble/hashes/esm/_assert.js.map +0 -1
  418. package/node_modules/@noble/hashes/esm/_blake.d.ts +0 -14
  419. package/node_modules/@noble/hashes/esm/_blake.d.ts.map +0 -1
  420. package/node_modules/@noble/hashes/esm/_blake.js +0 -45
  421. package/node_modules/@noble/hashes/esm/_blake.js.map +0 -1
  422. package/node_modules/@noble/hashes/esm/_md.d.ts +0 -51
  423. package/node_modules/@noble/hashes/esm/_md.d.ts.map +0 -1
  424. package/node_modules/@noble/hashes/esm/_md.js +0 -155
  425. package/node_modules/@noble/hashes/esm/_md.js.map +0 -1
  426. package/node_modules/@noble/hashes/esm/_u64.d.ts +0 -55
  427. package/node_modules/@noble/hashes/esm/_u64.d.ts.map +0 -1
  428. package/node_modules/@noble/hashes/esm/_u64.js +0 -67
  429. package/node_modules/@noble/hashes/esm/_u64.js.map +0 -1
  430. package/node_modules/@noble/hashes/esm/argon2.d.ts +0 -32
  431. package/node_modules/@noble/hashes/esm/argon2.d.ts.map +0 -1
  432. package/node_modules/@noble/hashes/esm/argon2.js +0 -392
  433. package/node_modules/@noble/hashes/esm/argon2.js.map +0 -1
  434. package/node_modules/@noble/hashes/esm/blake1.d.ts +0 -106
  435. package/node_modules/@noble/hashes/esm/blake1.d.ts.map +0 -1
  436. package/node_modules/@noble/hashes/esm/blake1.js +0 -452
  437. package/node_modules/@noble/hashes/esm/blake1.js.map +0 -1
  438. package/node_modules/@noble/hashes/esm/blake2.d.ts +0 -116
  439. package/node_modules/@noble/hashes/esm/blake2.d.ts.map +0 -1
  440. package/node_modules/@noble/hashes/esm/blake2.js +0 -413
  441. package/node_modules/@noble/hashes/esm/blake2.js.map +0 -1
  442. package/node_modules/@noble/hashes/esm/blake2b.d.ts +0 -11
  443. package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +0 -1
  444. package/node_modules/@noble/hashes/esm/blake2b.js +0 -11
  445. package/node_modules/@noble/hashes/esm/blake2b.js.map +0 -1
  446. package/node_modules/@noble/hashes/esm/blake2s.d.ts +0 -20
  447. package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +0 -1
  448. package/node_modules/@noble/hashes/esm/blake2s.js +0 -21
  449. package/node_modules/@noble/hashes/esm/blake2s.js.map +0 -1
  450. package/node_modules/@noble/hashes/esm/blake3.d.ts +0 -54
  451. package/node_modules/@noble/hashes/esm/blake3.d.ts.map +0 -1
  452. package/node_modules/@noble/hashes/esm/blake3.js +0 -251
  453. package/node_modules/@noble/hashes/esm/blake3.js.map +0 -1
  454. package/node_modules/@noble/hashes/esm/crypto.d.ts +0 -2
  455. package/node_modules/@noble/hashes/esm/crypto.d.ts.map +0 -1
  456. package/node_modules/@noble/hashes/esm/crypto.js +0 -2
  457. package/node_modules/@noble/hashes/esm/crypto.js.map +0 -1
  458. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts +0 -2
  459. package/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +0 -1
  460. package/node_modules/@noble/hashes/esm/cryptoNode.js +0 -15
  461. package/node_modules/@noble/hashes/esm/cryptoNode.js.map +0 -1
  462. package/node_modules/@noble/hashes/esm/eskdf.d.ts +0 -47
  463. package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +0 -1
  464. package/node_modules/@noble/hashes/esm/eskdf.js +0 -160
  465. package/node_modules/@noble/hashes/esm/eskdf.js.map +0 -1
  466. package/node_modules/@noble/hashes/esm/hkdf.d.ts +0 -36
  467. package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +0 -1
  468. package/node_modules/@noble/hashes/esm/hkdf.js +0 -82
  469. package/node_modules/@noble/hashes/esm/hkdf.js.map +0 -1
  470. package/node_modules/@noble/hashes/esm/hmac.d.ts +0 -35
  471. package/node_modules/@noble/hashes/esm/hmac.d.ts.map +0 -1
  472. package/node_modules/@noble/hashes/esm/hmac.js +0 -86
  473. package/node_modules/@noble/hashes/esm/hmac.js.map +0 -1
  474. package/node_modules/@noble/hashes/esm/index.d.ts +0 -2
  475. package/node_modules/@noble/hashes/esm/index.d.ts.map +0 -1
  476. package/node_modules/@noble/hashes/esm/index.js +0 -33
  477. package/node_modules/@noble/hashes/esm/index.js.map +0 -1
  478. package/node_modules/@noble/hashes/esm/legacy.d.ts +0 -71
  479. package/node_modules/@noble/hashes/esm/legacy.d.ts.map +0 -1
  480. package/node_modules/@noble/hashes/esm/legacy.js +0 -281
  481. package/node_modules/@noble/hashes/esm/legacy.js.map +0 -1
  482. package/node_modules/@noble/hashes/esm/package.json +0 -10
  483. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +0 -23
  484. package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +0 -1
  485. package/node_modules/@noble/hashes/esm/pbkdf2.js +0 -97
  486. package/node_modules/@noble/hashes/esm/pbkdf2.js.map +0 -1
  487. package/node_modules/@noble/hashes/esm/ripemd160.d.ts +0 -13
  488. package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +0 -1
  489. package/node_modules/@noble/hashes/esm/ripemd160.js +0 -13
  490. package/node_modules/@noble/hashes/esm/ripemd160.js.map +0 -1
  491. package/node_modules/@noble/hashes/esm/scrypt.d.ts +0 -34
  492. package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +0 -1
  493. package/node_modules/@noble/hashes/esm/scrypt.js +0 -228
  494. package/node_modules/@noble/hashes/esm/scrypt.js.map +0 -1
  495. package/node_modules/@noble/hashes/esm/sha1.d.ts +0 -11
  496. package/node_modules/@noble/hashes/esm/sha1.d.ts.map +0 -1
  497. package/node_modules/@noble/hashes/esm/sha1.js +0 -11
  498. package/node_modules/@noble/hashes/esm/sha1.js.map +0 -1
  499. package/node_modules/@noble/hashes/esm/sha2.d.ts +0 -159
  500. package/node_modules/@noble/hashes/esm/sha2.d.ts.map +0 -1
  501. package/node_modules/@noble/hashes/esm/sha2.js +0 -375
  502. package/node_modules/@noble/hashes/esm/sha2.js.map +0 -1
  503. package/node_modules/@noble/hashes/esm/sha256.d.ts +0 -20
  504. package/node_modules/@noble/hashes/esm/sha256.d.ts.map +0 -1
  505. package/node_modules/@noble/hashes/esm/sha256.js +0 -20
  506. package/node_modules/@noble/hashes/esm/sha256.js.map +0 -1
  507. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +0 -142
  508. package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +0 -1
  509. package/node_modules/@noble/hashes/esm/sha3-addons.js +0 -393
  510. package/node_modules/@noble/hashes/esm/sha3-addons.js.map +0 -1
  511. package/node_modules/@noble/hashes/esm/sha3.d.ts +0 -53
  512. package/node_modules/@noble/hashes/esm/sha3.d.ts.map +0 -1
  513. package/node_modules/@noble/hashes/esm/sha3.js +0 -234
  514. package/node_modules/@noble/hashes/esm/sha3.js.map +0 -1
  515. package/node_modules/@noble/hashes/esm/sha512.d.ts +0 -26
  516. package/node_modules/@noble/hashes/esm/sha512.d.ts.map +0 -1
  517. package/node_modules/@noble/hashes/esm/sha512.js +0 -26
  518. package/node_modules/@noble/hashes/esm/sha512.js.map +0 -1
  519. package/node_modules/@noble/hashes/esm/utils.d.ts +0 -161
  520. package/node_modules/@noble/hashes/esm/utils.d.ts.map +0 -1
  521. package/node_modules/@noble/hashes/esm/utils.js +0 -281
  522. package/node_modules/@noble/hashes/esm/utils.js.map +0 -1
  523. package/node_modules/@noble/hashes/hkdf.d.ts +0 -36
  524. package/node_modules/@noble/hashes/hkdf.d.ts.map +0 -1
  525. package/node_modules/@noble/hashes/hkdf.js +0 -88
  526. package/node_modules/@noble/hashes/hkdf.js.map +0 -1
  527. package/node_modules/@noble/hashes/hmac.d.ts +0 -35
  528. package/node_modules/@noble/hashes/hmac.d.ts.map +0 -1
  529. package/node_modules/@noble/hashes/hmac.js +0 -91
  530. package/node_modules/@noble/hashes/hmac.js.map +0 -1
  531. package/node_modules/@noble/hashes/index.d.ts +0 -1
  532. package/node_modules/@noble/hashes/index.d.ts.map +0 -1
  533. package/node_modules/@noble/hashes/index.js +0 -33
  534. package/node_modules/@noble/hashes/index.js.map +0 -1
  535. package/node_modules/@noble/hashes/legacy.d.ts +0 -71
  536. package/node_modules/@noble/hashes/legacy.d.ts.map +0 -1
  537. package/node_modules/@noble/hashes/legacy.js +0 -287
  538. package/node_modules/@noble/hashes/legacy.js.map +0 -1
  539. package/node_modules/@noble/hashes/package.json +0 -266
  540. package/node_modules/@noble/hashes/pbkdf2.d.ts +0 -23
  541. package/node_modules/@noble/hashes/pbkdf2.d.ts.map +0 -1
  542. package/node_modules/@noble/hashes/pbkdf2.js +0 -101
  543. package/node_modules/@noble/hashes/pbkdf2.js.map +0 -1
  544. package/node_modules/@noble/hashes/ripemd160.d.ts +0 -13
  545. package/node_modules/@noble/hashes/ripemd160.d.ts.map +0 -1
  546. package/node_modules/@noble/hashes/ripemd160.js +0 -16
  547. package/node_modules/@noble/hashes/ripemd160.js.map +0 -1
  548. package/node_modules/@noble/hashes/scrypt.d.ts +0 -34
  549. package/node_modules/@noble/hashes/scrypt.d.ts.map +0 -1
  550. package/node_modules/@noble/hashes/scrypt.js +0 -232
  551. package/node_modules/@noble/hashes/scrypt.js.map +0 -1
  552. package/node_modules/@noble/hashes/sha1.d.ts +0 -11
  553. package/node_modules/@noble/hashes/sha1.d.ts.map +0 -1
  554. package/node_modules/@noble/hashes/sha1.js +0 -14
  555. package/node_modules/@noble/hashes/sha1.js.map +0 -1
  556. package/node_modules/@noble/hashes/sha2.d.ts +0 -159
  557. package/node_modules/@noble/hashes/sha2.d.ts.map +0 -1
  558. package/node_modules/@noble/hashes/sha2.js +0 -384
  559. package/node_modules/@noble/hashes/sha2.js.map +0 -1
  560. package/node_modules/@noble/hashes/sha256.d.ts +0 -20
  561. package/node_modules/@noble/hashes/sha256.d.ts.map +0 -1
  562. package/node_modules/@noble/hashes/sha256.js +0 -23
  563. package/node_modules/@noble/hashes/sha256.js.map +0 -1
  564. package/node_modules/@noble/hashes/sha3-addons.d.ts +0 -142
  565. package/node_modules/@noble/hashes/sha3-addons.d.ts.map +0 -1
  566. package/node_modules/@noble/hashes/sha3-addons.js +0 -402
  567. package/node_modules/@noble/hashes/sha3-addons.js.map +0 -1
  568. package/node_modules/@noble/hashes/sha3.d.ts +0 -53
  569. package/node_modules/@noble/hashes/sha3.d.ts.map +0 -1
  570. package/node_modules/@noble/hashes/sha3.js +0 -239
  571. package/node_modules/@noble/hashes/sha3.js.map +0 -1
  572. package/node_modules/@noble/hashes/sha512.d.ts +0 -26
  573. package/node_modules/@noble/hashes/sha512.d.ts.map +0 -1
  574. package/node_modules/@noble/hashes/sha512.js +0 -29
  575. package/node_modules/@noble/hashes/sha512.js.map +0 -1
  576. package/node_modules/@noble/hashes/src/_assert.ts +0 -22
  577. package/node_modules/@noble/hashes/src/_blake.ts +0 -50
  578. package/node_modules/@noble/hashes/src/_md.ts +0 -176
  579. package/node_modules/@noble/hashes/src/_u64.ts +0 -91
  580. package/node_modules/@noble/hashes/src/argon2.ts +0 -497
  581. package/node_modules/@noble/hashes/src/blake1.ts +0 -534
  582. package/node_modules/@noble/hashes/src/blake2.ts +0 -486
  583. package/node_modules/@noble/hashes/src/blake2b.ts +0 -10
  584. package/node_modules/@noble/hashes/src/blake2s.ts +0 -20
  585. package/node_modules/@noble/hashes/src/blake3.ts +0 -272
  586. package/node_modules/@noble/hashes/src/crypto.ts +0 -9
  587. package/node_modules/@noble/hashes/src/cryptoNode.ts +0 -15
  588. package/node_modules/@noble/hashes/src/eskdf.ts +0 -187
  589. package/node_modules/@noble/hashes/src/hkdf.ts +0 -88
  590. package/node_modules/@noble/hashes/src/hmac.ts +0 -94
  591. package/node_modules/@noble/hashes/src/index.ts +0 -31
  592. package/node_modules/@noble/hashes/src/legacy.ts +0 -293
  593. package/node_modules/@noble/hashes/src/pbkdf2.ts +0 -122
  594. package/node_modules/@noble/hashes/src/ripemd160.ts +0 -12
  595. package/node_modules/@noble/hashes/src/scrypt.ts +0 -257
  596. package/node_modules/@noble/hashes/src/sha1.ts +0 -10
  597. package/node_modules/@noble/hashes/src/sha2.ts +0 -402
  598. package/node_modules/@noble/hashes/src/sha256.ts +0 -24
  599. package/node_modules/@noble/hashes/src/sha3-addons.ts +0 -499
  600. package/node_modules/@noble/hashes/src/sha3.ts +0 -258
  601. package/node_modules/@noble/hashes/src/sha512.ts +0 -34
  602. package/node_modules/@noble/hashes/src/utils.ts +0 -395
  603. package/node_modules/@noble/hashes/utils.d.ts +0 -161
  604. package/node_modules/@noble/hashes/utils.d.ts.map +0 -1
  605. package/node_modules/@noble/hashes/utils.js +0 -313
  606. package/node_modules/@noble/hashes/utils.js.map +0 -1
@@ -1,463 +0,0 @@
1
- /**
2
- * RFC 6330 Object Transmission Information (OTI) utilities.
3
- *
4
- * Shared OTI encoding/decoding for both moq-lib and moqtail players.
5
- * Eliminates duplicated OTI byte manipulation across codebases.
6
- */
7
-
8
- import { parseMoqRepairFrame } from "@blockcast/mmt-base";
9
-
10
- export interface OTIParams {
11
- /** Transfer length F (total source block size in bytes) */
12
- transferLength: number;
13
- /** Symbol size T (bytes per symbol) */
14
- symbolSize: number;
15
- /** Number of source blocks Z */
16
- sourceBlocks: number;
17
- /** Number of sub-blocks N */
18
- subBlocks: number;
19
- /** Symbol alignment Al */
20
- alignment: number;
21
- }
22
-
23
- /**
24
- * Build a 12-byte RFC 6330 Common + Scheme-Specific OTI from parameters.
25
- *
26
- * Wire format (per RFC 6330 §4.3.1 + §4.3.3):
27
- * byte 0: F high byte (bit 32 — transfer length is 40-bit)
28
- * bytes 1-4: F low 32 bits (big-endian)
29
- * byte 5: reserved (0)
30
- * bytes 6-7: T (symbol size, big-endian)
31
- * byte 8: Z (source blocks)
32
- * bytes 9-10: N (sub-blocks, big-endian)
33
- * byte 11: Al (alignment)
34
- */
35
- export function buildOTI(params: OTIParams): Uint8Array {
36
- const {
37
- transferLength: F,
38
- symbolSize: T,
39
- sourceBlocks: Z,
40
- subBlocks: N,
41
- alignment: Al,
42
- } = params;
43
- validateOTIFields(F, T, Z, N, Al);
44
- const oti = new Uint8Array(12);
45
- // F: 40-bit big-endian (byte 0 = high, bytes 1-4 = low 32)
46
- oti[0] = (F / 0x100000000) & 0xFF;
47
- oti[1] = (F >>> 24) & 0xFF;
48
- oti[2] = (F >>> 16) & 0xFF;
49
- oti[3] = (F >>> 8) & 0xFF;
50
- oti[4] = F & 0xFF;
51
- // byte 5: reserved
52
- oti[6] = (T >>> 8) & 0xFF;
53
- oti[7] = T & 0xFF;
54
- oti[8] = Z & 0xFF;
55
- oti[9] = (N >>> 8) & 0xFF;
56
- oti[10] = N & 0xFF;
57
- oti[11] = Al & 0xFF;
58
- return oti;
59
- }
60
-
61
- /**
62
- * Build OTI from catalog FEC config (K and T).
63
- * F = K × T (interleaved encoder convention from FFmpeg moqenc_mmt.c).
64
- */
65
- export function buildOTIFromCatalog(K: number, T: number): Uint8Array {
66
- if (!Number.isInteger(K) || K <= 0 || K > 56_403) {
67
- throw new Error(`K must be an integer in 1..56403 (got ${K})`);
68
- }
69
- return buildOTI({
70
- transferLength: K * T,
71
- symbolSize: T,
72
- sourceBlocks: 1,
73
- subBlocks: 1,
74
- alignment: 8,
75
- });
76
- }
77
-
78
- /**
79
- * Parse a 12-byte OTI into structured parameters.
80
- */
81
- export function parseOTI(oti: Uint8Array): OTIParams & { K: number } {
82
- if (oti.length !== 12) throw new Error(`OTI must be exactly 12 bytes (got ${oti.length})`);
83
- if (oti[5] !== 0) throw new Error(`OTI reserved byte 5 must be zero (got ${oti[5]})`);
84
- const F = ((oti[0] & 0xFF) * 0x100000000) +
85
- (((oti[1] << 24) | (oti[2] << 16) | (oti[3] << 8) | oti[4]) >>> 0);
86
- const T = (oti[6] << 8) | oti[7];
87
- const Z = oti[8];
88
- const N = (oti[9] << 8) | oti[10];
89
- const Al = oti[11];
90
- validateOTIFields(F, T, Z, N, Al);
91
- const K = Math.ceil(Math.ceil(F / T) / Z);
92
- return { transferLength: F, symbolSize: T, sourceBlocks: Z, subBlocks: N, alignment: Al, K };
93
- }
94
-
95
- function validateOTIFields(F: number, T: number, Z: number, N: number, Al: number): void {
96
- if (!Number.isSafeInteger(F) || F <= 0 || F > 0xffffffffff) {
97
- throw new Error(`F must be a positive 40-bit integer (got ${F})`);
98
- }
99
- if (!Number.isInteger(T) || T <= 0 || T > 0xffff) {
100
- throw new Error(`T must be an integer in 1..65535 (got ${T})`);
101
- }
102
- if (!Number.isInteger(Z) || Z <= 0 || Z > 0xff) {
103
- throw new Error(`Z must be an integer in 1..255 (got ${Z})`);
104
- }
105
- if (!Number.isInteger(N) || N <= 0 || N > 0xffff) {
106
- throw new Error(`N must be an integer in 1..65535 (got ${N})`);
107
- }
108
- if (!Number.isInteger(Al) || Al <= 0 || Al > 0xff || T % Al !== 0) {
109
- throw new Error(`Al must be an integer in 1..255 that divides T (got Al=${Al}, T=${T})`);
110
- }
111
- const K = Math.ceil(Math.ceil(F / T) / Z);
112
- if (K > 56_403) {
113
- throw new Error(`OTI requires K=${K}, above the RFC 6330 systematic limit 56403`);
114
- }
115
- }
116
-
117
- /**
118
- * Resolve a catalog FEC block's span in milliseconds.
119
- *
120
- * The catalog carries exactly ONE interleave field: `interleaveDepthMs`, the
121
- * full FEC block span in MILLISECONDS (draft-ramadan-moq-fec §5.1). Receivers
122
- * derive D -- the MEDIA UNITS per block, not a block count -- with
123
- * `deriveFecInterleaveDepth`. Reading D as a block count is BLO-35597.
124
- *
125
- * Absent, non-finite or non-positive → undefined; callers treat that as
126
- * unconfigured and error rather than guess. Finiteness is checked separately
127
- * from `> 0` because `Infinity` satisfies `> 0`: a JSON catalog cannot spell
128
- * `Infinity`, but any overflowing literal (`1e999`) parses to it, and it would
129
- * then reach `fecBlockBudgetMs` as an unbounded span. The legacy
130
- * `interleaveDepth` frame-count key and
131
- * the `interleaveMs` alias were removed in the BLO-14526 clean cut — producers
132
- * emit milliseconds only, and there is deliberately NO fallback read.
133
- */
134
- export type FecInterleaveCatalog = {
135
- interleaveDepthMs?: number;
136
- };
137
-
138
- export function catalogFecInterleaveMs(
139
- fec: FecInterleaveCatalog | undefined,
140
- ): number | undefined {
141
- const ms = fec?.interleaveDepthMs;
142
- return typeof ms === "number" && ms > 0 && Number.isFinite(ms) ? ms : undefined;
143
- }
144
-
145
- /**
146
- * Derive the integer FEC interleave depth D from a catalog block span and the
147
- * duration of one media unit.
148
- *
149
- * `interleaveDepthMs` is nearest-millisecond catalog signaling while media
150
- * unit durations are commonly fractional. Invert that quantization with
151
- * positive-value round-half-up semantics:
152
- *
153
- * D = max(1, floor(interleaveDepthMs / mediaUnitDurationMs + 0.5))
154
- *
155
- * `Math.ceil` is not equivalent: 4000 / 33.333 is slightly greater than 120,
156
- * but represents D=120 rather than D=121.
157
- */
158
- export function deriveFecInterleaveDepth(
159
- interleaveDepthMs: number,
160
- mediaUnitDurationMs: number,
161
- ): number {
162
- if (!Number.isFinite(interleaveDepthMs) || interleaveDepthMs <= 0) {
163
- throw new Error(`[FEC] interleaveDepthMs must be finite and > 0 (got ${interleaveDepthMs})`);
164
- }
165
- if (!Number.isFinite(mediaUnitDurationMs) || mediaUnitDurationMs <= 0) {
166
- throw new Error(`[FEC] mediaUnitDurationMs must be finite and > 0 (got ${mediaUnitDurationMs})`);
167
- }
168
- return Math.max(1, Math.floor(interleaveDepthMs / mediaUnitDurationMs + 0.5));
169
- }
170
-
171
- /**
172
- * Compute the full FEC block completion timeout from the catalog block span.
173
- *
174
- * The catalog's `interleaveDepthMs` IS the full FEC block span in
175
- * milliseconds (draft-ramadan-moq-fec §5.1): producers emit
176
- * D × unit-duration, and every symbol of a block — source and repair —
177
- * arrives within that span. The full-block timeout is therefore
178
- * K-INDEPENDENT:
179
- *
180
- * timeout = interleaveDepthMs * safetyFactor
181
- *
182
- * A caller that genuinely needs a per-sub-block deadline scales the block
183
- * span by K_sub / K. Never scale it by a symbol count: the span already
184
- * covers every symbol of the block.
185
- *
186
- * @param interleaveDepthMs - Full FEC block span in ms (catalog fec.interleaveDepthMs)
187
- * @param safetyFactor - Jitter margin (default 3.0)
188
- * @returns Timeout in milliseconds
189
- */
190
- export function computeFecTimeout(
191
- interleaveDepthMs: number,
192
- safetyFactor: number = 3.0,
193
- ): number {
194
- // Finite, not merely > 0, and on BOTH arguments: the product is the caller's
195
- // expiry deadline, so a non-finite either side makes every `now > deadline`
196
- // comparison false and the block never expires -- strictly worse than
197
- // expiring late. `NaN <= 0` is false, so a bare `> 0` guard passes it
198
- // through. Both values reach here from JSON (the catalog span, and the
199
- // safety factor via test-vectors/catalog-validation.json), where an
200
- // overflowing literal such as `1e999` parses to Infinity -- JSON has no
201
- // Infinity literal, so there is no other way to spell it.
202
- if (!Number.isFinite(interleaveDepthMs) || interleaveDepthMs <= 0) {
203
- throw new Error(`[FEC] interleaveDepthMs must be a finite value > 0 (got ${interleaveDepthMs}ms). Fix encoder config.`);
204
- }
205
- if (!Number.isFinite(safetyFactor) || safetyFactor <= 0) {
206
- throw new Error(`[FEC] safetyFactor must be a finite value > 0 (got ${safetyFactor}). Fix encoder config.`);
207
- }
208
- // interleaveDepthMs IS the block span. K=4, D=4 at 30fps:
209
- // interleaveDepthMs = 133ms → timeout = ceil(133 * 3) = 399ms.
210
- return Math.ceil(interleaveDepthMs * safetyFactor);
211
- }
212
-
213
- /**
214
- * Absolute deadline for one FEC block.
215
- *
216
- * deadline = firstAcceptedAtMs + interleaveDepthMs + reorderToleranceMs
217
- *
218
- * Two properties matter, and both are contract, not preference:
219
- *
220
- * 1. The anchor is an ABSOLUTE receiver-local timestamp of the first accepted
221
- * packet of the block -- not "now when we noticed", and not a duration a
222
- * caller starts counting at an unspecified moment. A relative timeout
223
- * cannot say WHEN a block was due, so it cannot yield playback latency and
224
- * it cannot be compared across two consumers that started their timers at
225
- * different instants.
226
- *
227
- * 2. The reorder/jitter allowance is ADDITIVE and SIGNALED, never a multiplier
228
- * on the span. Jitter is a property of the network path; the FEC block span
229
- * is a property of the encoder. Multiplying them couples two independent
230
- * quantities: at a 133ms video span a x3 factor grants 266ms of slack, and
231
- * at a 43ms audio span only 86ms -- for the same network. The tolerance
232
- * therefore arrives as its own catalog value and is added once.
233
- *
234
- * Both arguments are required. There is no default tolerance: a missing value
235
- * is an encoder/catalog bug and must surface at the boundary, not be papered
236
- * over with a constant here.
237
- *
238
- * @param firstAcceptedAtMs - Receiver-local ms timestamp of the block's first accepted packet
239
- * @param interleaveDepthMs - Full FEC block span in ms (catalog fec.interleaveDepthMs)
240
- * @param reorderToleranceMs - Declared jitter/reorder allowance in ms (catalog fec.reorderToleranceMs)
241
- * @returns Absolute receiver-local deadline in milliseconds
242
- */
243
- export function fecBlockDeadlineMs(params: {
244
- firstAcceptedAtMs: number;
245
- interleaveDepthMs: number;
246
- reorderToleranceMs: number;
247
- }): number {
248
- const { firstAcceptedAtMs, interleaveDepthMs, reorderToleranceMs } = params;
249
- if (!Number.isFinite(firstAcceptedAtMs)) {
250
- throw new Error(`[FEC] firstAcceptedAtMs must be finite (got ${firstAcceptedAtMs}).`);
251
- }
252
- return firstAcceptedAtMs + fecBlockBudgetMs(interleaveDepthMs, reorderToleranceMs);
253
- }
254
-
255
- /**
256
- * Relative budget for one FEC block: span + declared tolerance.
257
- *
258
- * Only for consumers whose interface genuinely takes a duration (the WASM
259
- * reassembler's `timeoutMs`). Anything that can hold a timestamp should use
260
- * `fecBlockDeadlineMs` instead, so the anchor stays explicit and latency stays
261
- * extractable. This is deliberately NOT `span * factor` -- see the note on
262
- * `fecBlockDeadlineMs` for why the tolerance is additive.
263
- */
264
- export function fecBlockBudgetMs(interleaveDepthMs: number, reorderToleranceMs: number): number {
265
- // Finite, not merely > 0: Infinity satisfies `> 0` and would yield an
266
- // infinite budget, which fecBlockDeadlineMs then turns into a deadline no
267
- // block can ever miss -- the eviction bound silently stops bounding. The
268
- // tolerance check below already required finiteness; this is the same bar
269
- // for the encoder's span.
270
- if (!Number.isFinite(interleaveDepthMs) || !(interleaveDepthMs > 0)) {
271
- throw new Error(
272
- `[FEC] interleaveDepthMs must be a finite value > 0 (got ${interleaveDepthMs}ms). Fix encoder config.`,
273
- );
274
- }
275
- if (!(reorderToleranceMs >= 0) || !Number.isFinite(reorderToleranceMs)) {
276
- throw new Error(
277
- `[FEC] reorderToleranceMs must be a finite value >= 0 (got ${reorderToleranceMs}ms). ` +
278
- `It is a catalog value (fec.reorderToleranceMs), not a local default.`,
279
- );
280
- }
281
- return Math.ceil(interleaveDepthMs + reorderToleranceMs);
282
- }
283
-
284
- /**
285
- * How many FEC blocks a receiver must retain, in SBN distance.
286
- *
287
- * THE ONE derivation of "the interleave horizon". Every site that retires a
288
- * block by SBN distance consumes this: the Worker/WASM decoder's retention
289
- * (`interleaveDepth` -> `cleanup_by_sbn`) and FECManager's ordered-relay
290
- * settlement horizon. They are not two quantities that happen to agree -- a
291
- * settlement that fires inside the decoder's retention kills a block the
292
- * decoder would still have recovered, so the invariant is:
293
- *
294
- * ordered-relay settlement must never fire on a block the decoder would
295
- * still accept -- manager horizon >= decoder retention.
296
- *
297
- * Deriving it twice is what broke it (BLO-35597): `deriveFecInterleaveDepth`
298
- * returns D, MEDIA UNITS per block, and reading that as a block count made the
299
- * two horizons disagree the moment either side moved. Add a consumer here
300
- * rather than re-deriving at the call site.
301
- *
302
- * The count is the blocks that can be in flight within one block's delivery
303
- * budget, plus the one being filled.
304
- *
305
- * That is DELIBERATELY two blocks of slack, not an exact minimum. The decoder
306
- * retains `depth + 1` blocks, not `depth` -- `cleanup_by_sbn` retires only
307
- * blocks strictly behind `current_sbn - interleave_depth`, so the newest block
308
- * and the `depth` behind it all survive. The smallest depth satisfying the
309
- * invariant is therefore `ceil(W/S) - 1`. The slack is bought on purpose: it
310
- * costs retained-block memory and the depth-scaled caps (`maxBlocks`,
311
- * `pendingVerifyCap` in fec-worker), and it buys headroom against a catalog
312
- * whose signaled span runs slightly short of the real one -- the failure this
313
- * whole issue is about. Do not "tighten" it to the minimum without a measured
314
- * reason; being one block short is what fails a block, being two long is not.
315
- *
316
- * The cost ceiling is relative, not absolute: the slack is always two blocks
317
- * of whatever the retention already is, so it scales with the geometry rather
318
- * than with the stream. On the live ISS 720p/33ms catalog that is two blocks
319
- * of six (a third of the buffer, the expensive end); at a 255-block retention
320
- * it is two of 255 (under 1%). If you come here to tighten it, the number to
321
- * weigh is the ratio at YOUR geometry -- tightening buys most where retention
322
- * is small, which is also where being one block short is most likely.
323
- *
324
- * @param deliveryWindowMs - The block's own delivery budget (computeFecDeliveryWindowMs / fecBlockBudgetMs)
325
- * @param interleaveDepthMs - Full FEC block span in ms (catalog fec.interleaveDepthMs)
326
- * @returns Block count in 2..=255 for every geometry a catalog can express.
327
- * The floor is 2, not 1: both inputs are guarded `> 0`, so `ceil(quotient)`
328
- * is `>= 1` and the result `>= 2`. A consumer branching on a `1` case is
329
- * reading a contract no real geometry produces. The one arithmetic exception
330
- * is a quotient that underflows to exactly `0` (`Number.MIN_VALUE` over
331
- * 33ms), which returns 1 -- reachable only by calling this directly with
332
- * values a catalog cannot produce. NOT a denormal INPUT specifically: the
333
- * underflow is a property of the QUOTIENT, so two normal operands reach it
334
- * too (`1e-300` over `1e308` returns 1; min normal is ~2.225e-308). Do not
335
- * re-narrow this to "a denormal" -- the guards below admit both of those.
336
- * That a catalog cannot produce such values is a proof, not a judgement
337
- * about plausible values: BOTH branches of `computeFecDeliveryWindowMs` are
338
- * `Math.ceil`-wrapped (one directly, the other via `fecBlockBudgetMs`), so
339
- * every catalog-derived `deliveryWindowMs` is an integer `>= 1`; the quotient
340
- * is then `>= 1/interleaveDepthMs`, which no FINITE span can push below
341
- * `Number.MIN_VALUE`. Documented rather than guarded -- a comparison on the
342
- * per-symbol path for an input the type can express and the system cannot
343
- * produce, and clamping would be the `Math.min(0xff, ...)` anti-pattern this
344
- * change removed.
345
- */
346
- export function deriveFecRetentionBlocks(
347
- deliveryWindowMs: number,
348
- interleaveDepthMs: number,
349
- ): number {
350
- const blocks = tryDeriveFecRetentionBlocks(deliveryWindowMs, interleaveDepthMs);
351
- if (blocks !== undefined) return blocks;
352
-
353
- // Undefined means one of three things. Re-test to say which -- this is the
354
- // throwing path, so the cost is irrelevant and the diagnosis is the point.
355
- if (!Number.isFinite(interleaveDepthMs) || !(interleaveDepthMs > 0)) {
356
- throw new Error(
357
- `[FEC] interleaveDepthMs must be a finite value > 0 (got ${interleaveDepthMs}ms). Fix encoder config.`,
358
- );
359
- }
360
- if (!Number.isFinite(deliveryWindowMs) || !(deliveryWindowMs > 0)) {
361
- throw new Error(
362
- `[FEC] deliveryWindowMs must be a finite value > 0 (got ${deliveryWindowMs}ms). ` +
363
- `It is derived from catalog geometry, not a local default.`,
364
- );
365
- }
366
- // Fail closed rather than clamp. 255 is the ceiling the WASM decoder and the
367
- // ISO/IEC 23008-1 AL-FEC signaling byte both accept; silently clamping to it
368
- // would hand back a retention SHORTER than the caller's own delivery window
369
- // -- the exact skew this function exists to remove, reintroduced invisibly
370
- // and only on out-of-range catalogs, where it is hardest to notice.
371
- //
372
- // This is the RESIDUAL, not a tested branch: it is reached by elimination
373
- // once the two guards above have failed to match. That is exact only while
374
- // `tryDeriveFecRetentionBlocks` returns `undefined` in exactly three places.
375
- // Add a fourth and this arm mis-diagnoses it as a ceiling violation AND
376
- // prints a computed block count that is not the reason -- so if you grow a
377
- // case there, add the matching arm here.
378
- throw new Error(
379
- `[FEC] retention of ${Math.ceil(deliveryWindowMs / interleaveDepthMs) + 1} blocks exceeds the 255 the decoder and the ` +
380
- `ISO/IEC 23008-1 AL-FEC signaling byte accept ` +
381
- `(deliveryWindowMs=${deliveryWindowMs}ms over interleaveDepthMs=${interleaveDepthMs}ms). ` +
382
- `Fix the catalog geometry: a span this short cannot carry a window this wide.`,
383
- );
384
- }
385
-
386
- /**
387
- * The ceiling the WASM decoder and the ISO/IEC 23008-1 AL-FEC signaling byte
388
- * both accept. One owner: do not re-state `0xff` against a block count
389
- * anywhere else.
390
- */
391
- export const MAX_FEC_RETENTION_BLOCKS = 0xff;
392
-
393
- /**
394
- * `deriveFecRetentionBlocks` without the throw: the block count, or `undefined`
395
- * when the geometry cannot define one.
396
- *
397
- * THIS is the arithmetic; the throwing variant is this plus a diagnosis of
398
- * which guard failed. Callers reached from a **per-symbol** path must use this
399
- * one. An out-of-range `timeoutMs` does not narrow back on its own, so there
400
- * the throwing variant is not a rare error but steady state, and it would
401
- * construct an `Error` with a stack capture and unwind it for every symbol on
402
- * the stream.
403
- */
404
- export function tryDeriveFecRetentionBlocks(
405
- deliveryWindowMs: number,
406
- interleaveDepthMs: number,
407
- ): number | undefined {
408
- if (!Number.isFinite(interleaveDepthMs) || !(interleaveDepthMs > 0)) return undefined;
409
- if (!Number.isFinite(deliveryWindowMs) || !(deliveryWindowMs > 0)) return undefined;
410
- const blocks = Math.ceil(deliveryWindowMs / interleaveDepthMs) + 1;
411
- return blocks > MAX_FEC_RETENTION_BLOCKS ? undefined : blocks;
412
- }
413
-
414
- /**
415
- * Playback latency for a block, from the same anchor the deadline uses.
416
- *
417
- * latency = presentedAtMs - firstAcceptedAtMs
418
- *
419
- * Both timestamps are receiver-local, so this needs NO publisher/receiver
420
- * clock agreement. That is the point of anchoring the deadline absolutely:
421
- * publisher-stamped media time and receiver BCTM disagree by roughly the
422
- * quantity we are trying to measure, which makes any cross-host subtraction
423
- * unusable at a 33ms target. This subtraction is immune to that skew.
424
- *
425
- * It measures first-accepted-packet to presentation. It is NOT glass-to-glass
426
- * and must not be reported as such -- capture and encode sit outside both
427
- * timestamps.
428
- */
429
- export function playbackLatencyMs(params: { presentedAtMs: number; firstAcceptedAtMs: number }): number {
430
- const { presentedAtMs, firstAcceptedAtMs } = params;
431
- if (!Number.isFinite(presentedAtMs) || !Number.isFinite(firstAcceptedAtMs)) {
432
- throw new Error(`[FEC] playback latency needs two finite timestamps (got ${presentedAtMs}, ${firstAcceptedAtMs}).`);
433
- }
434
- if (presentedAtMs < firstAcceptedAtMs) {
435
- throw new Error(
436
- `[FEC] presentedAtMs ${presentedAtMs} precedes firstAcceptedAtMs ${firstAcceptedAtMs}; ` +
437
- `the two timestamps must come from one receiver-local clock.`,
438
- );
439
- }
440
- return presentedAtMs - firstAcceptedAtMs;
441
- }
442
-
443
- /**
444
- * Extract FEC parameters from an MMTP repair packet.
445
- *
446
- * Per ISO/IEC 23008-1 Section C.5.3, the 13-byte Repair FEC Payload ID
447
- * follows the complete MMTP header, including optional C/X fields.
448
- *
449
- * Returns raw fields — caller passes directly to WASM add_repair(ss_start, ssb_length, rs_id, data).
450
- * No SBN/ESI derivation — the WASM decoder handles block assignment.
451
- */
452
- export function parseRepairPacket(packet: Uint8Array): {
453
- ssStart: number; ssbLength: number; rsId: number; repairData: Uint8Array;
454
- } | null {
455
- const parsed = parseMoqRepairFrame(packet);
456
- if (!parsed) return null;
457
- return {
458
- ssStart: parsed.ssStart,
459
- ssbLength: parsed.ssbLength,
460
- rsId: parsed.rsId,
461
- repairData: parsed.symbolData,
462
- };
463
- }
@@ -1,101 +0,0 @@
1
- /**
2
- * ReorderBuffer — container-agnostic frame reorder buffer for FEC-interleaved streams.
3
- *
4
- * FEC interleaving causes frames to complete out of decode order (e.g., frame N+3
5
- * before N+1). H.264 P-frames reference the previous frame, so feeding out-of-order
6
- * frames to VideoDecoder produces green artifacts from reference frame mismatch.
7
- *
8
- * This buffer accumulates frames and flushes them in sequence order.
9
- * - In-order frames flush immediately (zero added latency for well-ordered streams).
10
- * - Out-of-order frames buffer until the gap is filled or the buffer is full.
11
- * - Keyframes flush all pending frames first (random access point).
12
- * - Safety timeout force-flushes stalled buffers (missing frame that will never arrive).
13
- *
14
- * Used by WebCodecs decode path. NOT needed for MSE (browser handles ordering internally).
15
- */
16
-
17
- export interface ReorderBufferConfig<T> {
18
- /** Maximum frames to buffer before force-flushing oldest. */
19
- maxSize: number;
20
- /** Extract sequence number from a frame. */
21
- getSequence: (frame: T) => number;
22
- /** Check if a frame is a keyframe (flushes all pending). Optional. */
23
- isKeyframe?: (frame: T) => boolean;
24
- }
25
-
26
- export class ReorderBuffer<T> {
27
- readonly #config: ReorderBufferConfig<T>;
28
- #buffer: T[] = [];
29
- #lastFlushedSeq = -1;
30
-
31
- constructor(config: ReorderBufferConfig<T>) {
32
- this.#config = config;
33
- }
34
-
35
- /**
36
- * Push a frame into the buffer. Returns frames ready to decode (in sequence order).
37
- * May return 0 frames (buffered), 1 frame (in-order), or multiple (gap filled / flush).
38
- */
39
- push(frame: T): T[] {
40
- const { getSequence, isKeyframe, maxSize } = this.#config;
41
-
42
- // Keyframe: flush all pending in order, then emit keyframe
43
- if (isKeyframe?.(frame)) {
44
- const flushed = this.flushAll();
45
- this.#lastFlushedSeq = getSequence(frame);
46
- flushed.push(frame);
47
- return flushed;
48
- }
49
-
50
- const seq = getSequence(frame);
51
-
52
- // Drop truly stale frames (older than what we've already flushed)
53
- if (seq > 0 && seq <= this.#lastFlushedSeq) {
54
- return [];
55
- }
56
-
57
- // Insert into buffer (maintain sorted order)
58
- this.#buffer.push(frame);
59
- this.#buffer.sort((a, b) => getSequence(a) - getSequence(b));
60
-
61
- // Flush in-order frames from front
62
- const flushed: T[] = [];
63
- while (this.#buffer.length > 0) {
64
- const frontSeq = getSequence(this.#buffer[0]);
65
-
66
- // Flush if: next expected seq, OR nothing flushed yet (bootstrap), OR buffer full
67
- if (frontSeq <= this.#lastFlushedSeq + 1 || this.#lastFlushedSeq < 0 || this.#buffer.length >= maxSize) {
68
- const f = this.#buffer.shift()!;
69
- this.#lastFlushedSeq = getSequence(f);
70
- flushed.push(f);
71
- } else {
72
- break; // gap — wait for missing frame
73
- }
74
- }
75
-
76
- return flushed;
77
- }
78
-
79
- /**
80
- * Flush all pending frames in sequence order. Call on keyframe or cleanup.
81
- */
82
- flushAll(): T[] {
83
- this.#buffer.sort((a, b) => this.#config.getSequence(a) - this.#config.getSequence(b));
84
- const flushed = this.#buffer.splice(0);
85
- if (flushed.length > 0) {
86
- this.#lastFlushedSeq = this.#config.getSequence(flushed[flushed.length - 1]);
87
- }
88
- return flushed;
89
- }
90
-
91
- /** Number of frames currently buffered (waiting for gap to fill). */
92
- get pending(): number {
93
- return this.#buffer.length;
94
- }
95
-
96
- /** Reset buffer state. */
97
- reset(): void {
98
- this.#buffer = [];
99
- this.#lastFlushedSeq = -1;
100
- }
101
- }