werift 0.26.0 → 0.28.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 (552) hide show
  1. package/README.md +182 -8
  2. package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
  3. package/lib/common/src/binary.d.ts +1 -3
  4. package/lib/common/src/binary.js +8 -6
  5. package/lib/common/src/binary.js.map +1 -1
  6. package/lib/common/src/binaryData.js +2 -1
  7. package/lib/common/src/binaryData.js.map +1 -1
  8. package/lib/common/src/event.d.ts +26 -0
  9. package/lib/common/src/event.js +87 -2
  10. package/lib/common/src/event.js.map +1 -1
  11. package/lib/common/src/log.js +5 -7
  12. package/lib/common/src/log.js.map +1 -1
  13. package/lib/common/src/network.d.ts +6 -1
  14. package/lib/common/src/network.js +8 -2
  15. package/lib/common/src/network.js.map +1 -1
  16. package/lib/common/src/transport.d.ts +12 -5
  17. package/lib/common/src/transport.js +13 -7
  18. package/lib/common/src/transport.js.map +1 -1
  19. package/lib/dtls/src/alert.d.ts +49 -0
  20. package/lib/dtls/src/alert.js +103 -0
  21. package/lib/dtls/src/alert.js.map +1 -0
  22. package/lib/dtls/src/client.js +15 -1
  23. package/lib/dtls/src/client.js.map +1 -1
  24. package/lib/dtls/src/context/cipher.d.ts +1 -1
  25. package/lib/dtls/src/context/cipher.js +6 -3
  26. package/lib/dtls/src/context/cipher.js.map +1 -1
  27. package/lib/dtls/src/context/dtls.d.ts +2 -0
  28. package/lib/dtls/src/context/dtls.js +11 -2
  29. package/lib/dtls/src/context/dtls.js.map +1 -1
  30. package/lib/dtls/src/context/transport.d.ts +17 -1
  31. package/lib/dtls/src/context/transport.js +40 -3
  32. package/lib/dtls/src/context/transport.js.map +1 -1
  33. package/lib/dtls/src/flight/client/flight1.js +2 -1
  34. package/lib/dtls/src/flight/client/flight1.js.map +1 -1
  35. package/lib/dtls/src/flight/client/flight5.js +8 -3
  36. package/lib/dtls/src/flight/client/flight5.js.map +1 -1
  37. package/lib/dtls/src/flight/flight.d.ts +6 -1
  38. package/lib/dtls/src/flight/flight.js +18 -5
  39. package/lib/dtls/src/flight/flight.js.map +1 -1
  40. package/lib/dtls/src/flight/server/flight4.js +4 -2
  41. package/lib/dtls/src/flight/server/flight4.js.map +1 -1
  42. package/lib/dtls/src/flight/server/flight6.js +6 -2
  43. package/lib/dtls/src/flight/server/flight6.js.map +1 -1
  44. package/lib/dtls/src/handshake/const.d.ts +17 -13
  45. package/lib/dtls/src/handshake/const.js +16 -14
  46. package/lib/dtls/src/handshake/const.js.map +1 -1
  47. package/lib/dtls/src/handshake/message/alert.js +4 -2
  48. package/lib/dtls/src/handshake/message/alert.js.map +1 -1
  49. package/lib/dtls/src/handshake/message/certificate.js +2 -1
  50. package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
  51. package/lib/dtls/src/handshake/message/changeCipherSpec.js +2 -1
  52. package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
  53. package/lib/dtls/src/handshake/message/client/certificateVerify.js +4 -2
  54. package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
  55. package/lib/dtls/src/handshake/message/client/hello.js +14 -7
  56. package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
  57. package/lib/dtls/src/handshake/message/client/keyExchange.js +2 -1
  58. package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
  59. package/lib/dtls/src/handshake/message/finished.js +2 -1
  60. package/lib/dtls/src/handshake/message/finished.js.map +1 -1
  61. package/lib/dtls/src/handshake/message/server/certificateRequest.js +6 -3
  62. package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
  63. package/lib/dtls/src/handshake/message/server/hello.js +12 -6
  64. package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
  65. package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
  66. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +4 -2
  67. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
  68. package/lib/dtls/src/handshake/message/server/keyExchange.js +16 -8
  69. package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
  70. package/lib/dtls/src/handshake/random.d.ts +2 -2
  71. package/lib/dtls/src/handshake/random.js +5 -2
  72. package/lib/dtls/src/handshake/random.js.map +1 -1
  73. package/lib/dtls/src/index.d.ts +3 -1
  74. package/lib/dtls/src/index.js +10 -1
  75. package/lib/dtls/src/index.js.map +1 -1
  76. package/lib/dtls/src/record/const.d.ts +52 -33
  77. package/lib/dtls/src/record/const.js +51 -36
  78. package/lib/dtls/src/record/const.js.map +1 -1
  79. package/lib/dtls/src/record/message/fragment.js +12 -6
  80. package/lib/dtls/src/record/message/fragment.js.map +1 -1
  81. package/lib/dtls/src/record/message/header.js +10 -5
  82. package/lib/dtls/src/record/message/header.js.map +1 -1
  83. package/lib/dtls/src/record/message/plaintext.js +4 -2
  84. package/lib/dtls/src/record/message/plaintext.js.map +1 -1
  85. package/lib/dtls/src/record/receive.d.ts +6 -0
  86. package/lib/dtls/src/record/receive.js +50 -19
  87. package/lib/dtls/src/record/receive.js.map +1 -1
  88. package/lib/dtls/src/server.js +19 -1
  89. package/lib/dtls/src/server.js.map +1 -1
  90. package/lib/dtls/src/socket.d.ts +134 -2
  91. package/lib/dtls/src/socket.js +326 -8
  92. package/lib/dtls/src/socket.js.map +1 -1
  93. package/lib/ice/src/candidate.d.ts +1 -1
  94. package/lib/ice/src/candidate.js +24 -12
  95. package/lib/ice/src/candidate.js.map +1 -1
  96. package/lib/ice/src/candidateError.d.ts +155 -0
  97. package/lib/ice/src/candidateError.js +246 -0
  98. package/lib/ice/src/candidateError.js.map +1 -0
  99. package/lib/ice/src/candidateGatherer.d.ts +127 -0
  100. package/lib/ice/src/candidateGatherer.js +745 -0
  101. package/lib/ice/src/candidateGatherer.js.map +1 -0
  102. package/lib/ice/src/consent.d.ts +49 -0
  103. package/lib/ice/src/consent.js +258 -0
  104. package/lib/ice/src/consent.js.map +1 -0
  105. package/lib/ice/src/dns/lookup.d.ts +10 -1
  106. package/lib/ice/src/dns/lookup.js +42 -7
  107. package/lib/ice/src/dns/lookup.js.map +1 -1
  108. package/lib/ice/src/exceptions.d.ts +21 -5
  109. package/lib/ice/src/exceptions.js +58 -13
  110. package/lib/ice/src/exceptions.js.map +1 -1
  111. package/lib/ice/src/ice.d.ts +254 -58
  112. package/lib/ice/src/ice.js +979 -945
  113. package/lib/ice/src/ice.js.map +1 -1
  114. package/lib/ice/src/iceBase.d.ts +328 -14
  115. package/lib/ice/src/iceBase.js +254 -38
  116. package/lib/ice/src/iceBase.js.map +1 -1
  117. package/lib/ice/src/index.d.ts +1 -0
  118. package/lib/ice/src/index.js +1 -0
  119. package/lib/ice/src/index.js.map +1 -1
  120. package/lib/ice/src/internal/checkMessages.d.ts +41 -0
  121. package/lib/ice/src/internal/checkMessages.js +63 -0
  122. package/lib/ice/src/internal/checkMessages.js.map +1 -0
  123. package/lib/ice/src/internal/defaultRoute.d.ts +20 -0
  124. package/lib/ice/src/internal/defaultRoute.js +134 -0
  125. package/lib/ice/src/internal/defaultRoute.js.map +1 -0
  126. package/lib/ice/src/internal/hostInterfaces.d.ts +17 -0
  127. package/lib/ice/src/internal/hostInterfaces.js +77 -0
  128. package/lib/ice/src/internal/hostInterfaces.js.map +1 -0
  129. package/lib/ice/src/internal/hostPreference.d.ts +24 -0
  130. package/lib/ice/src/internal/hostPreference.js +38 -0
  131. package/lib/ice/src/internal/hostPreference.js.map +1 -0
  132. package/lib/ice/src/internal/resolveHostAddresses.d.ts +56 -8
  133. package/lib/ice/src/internal/resolveHostAddresses.js +127 -24
  134. package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -1
  135. package/lib/ice/src/internal/selectAddresses.d.ts +27 -0
  136. package/lib/ice/src/internal/selectAddresses.js +37 -18
  137. package/lib/ice/src/internal/selectAddresses.js.map +1 -1
  138. package/lib/ice/src/nomination/regularNomination.d.ts +200 -0
  139. package/lib/ice/src/nomination/regularNomination.js +311 -0
  140. package/lib/ice/src/nomination/regularNomination.js.map +1 -0
  141. package/lib/ice/src/nomination/selectionReplacement.d.ts +138 -0
  142. package/lib/ice/src/nomination/selectionReplacement.js +371 -0
  143. package/lib/ice/src/nomination/selectionReplacement.js.map +1 -0
  144. package/lib/ice/src/provisional.d.ts +139 -0
  145. package/lib/ice/src/provisional.js +468 -0
  146. package/lib/ice/src/provisional.js.map +1 -0
  147. package/lib/ice/src/stun/protocol.d.ts +9 -2
  148. package/lib/ice/src/stun/protocol.js +16 -17
  149. package/lib/ice/src/stun/protocol.js.map +1 -1
  150. package/lib/ice/src/stun/tcpProtocol.d.ts +1 -1
  151. package/lib/ice/src/stun/tcpProtocol.js +7 -7
  152. package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
  153. package/lib/ice/src/stun/transaction.d.ts +30 -1
  154. package/lib/ice/src/stun/transaction.js +90 -19
  155. package/lib/ice/src/stun/transaction.js.map +1 -1
  156. package/lib/ice/src/turn/credential.d.ts +49 -0
  157. package/lib/ice/src/turn/credential.js +78 -0
  158. package/lib/ice/src/turn/credential.js.map +1 -0
  159. package/lib/ice/src/turn/protocol.d.ts +31 -10
  160. package/lib/ice/src/turn/protocol.js +127 -51
  161. package/lib/ice/src/turn/protocol.js.map +1 -1
  162. package/lib/ice/src/types/model.d.ts +16 -5
  163. package/lib/ice/src/types/model.js.map +1 -1
  164. package/lib/ice-server/src/stun/attributes.d.ts +2 -0
  165. package/lib/ice-server/src/stun/attributes.js +11 -1
  166. package/lib/ice-server/src/stun/attributes.js.map +1 -1
  167. package/lib/ice-server/src/stun/const.d.ts +44 -17
  168. package/lib/ice-server/src/stun/const.js +31 -19
  169. package/lib/ice-server/src/stun/const.js.map +1 -1
  170. package/lib/ice-server/src/stun/message.d.ts +29 -4
  171. package/lib/ice-server/src/stun/message.js +115 -24
  172. package/lib/ice-server/src/stun/message.js.map +1 -1
  173. package/lib/index.mjs +35121 -22337
  174. package/lib/nonstandard/index.mjs +3169 -1399
  175. package/lib/polyfill/dom.mjs +24650 -12365
  176. package/lib/polyfill/index.mjs +24650 -12365
  177. package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
  178. package/lib/rtp/src/codec/assertPayload.js +12 -0
  179. package/lib/rtp/src/codec/assertPayload.js.map +1 -0
  180. package/lib/rtp/src/codec/av1.js +2 -0
  181. package/lib/rtp/src/codec/av1.js.map +1 -1
  182. package/lib/rtp/src/codec/h264.js +35 -43
  183. package/lib/rtp/src/codec/h264.js.map +1 -1
  184. package/lib/rtp/src/codec/vp8.js +11 -5
  185. package/lib/rtp/src/codec/vp8.js.map +1 -1
  186. package/lib/rtp/src/codec/vp9.js +12 -0
  187. package/lib/rtp/src/codec/vp9.js.map +1 -1
  188. package/lib/rtp/src/extra/container/mp4/container.js +2 -1
  189. package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
  190. package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
  191. package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
  192. package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
  193. package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
  194. package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
  195. package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
  196. package/lib/rtp/src/extra/container/ogg/index.js +1 -0
  197. package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
  198. package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
  199. package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
  200. package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
  201. package/lib/rtp/src/extra/container/webm/ebml/ebml.js +6 -3
  202. package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
  203. package/lib/rtp/src/extra/processor/depacketizer.d.ts +5 -0
  204. package/lib/rtp/src/extra/processor/depacketizer.js +28 -2
  205. package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
  206. package/lib/rtp/src/extra/processor/dtx.js +4 -2
  207. package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
  208. package/lib/rtp/src/extra/processor/index.d.ts +2 -0
  209. package/lib/rtp/src/extra/processor/index.js +2 -0
  210. package/lib/rtp/src/extra/processor/index.js.map +1 -1
  211. package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
  212. package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
  213. package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
  214. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
  215. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
  216. package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
  217. package/lib/rtp/src/extra/processor/lipsync.js +202 -51
  218. package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
  219. package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
  220. package/lib/rtp/src/extra/processor/mp4.js +6 -3
  221. package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
  222. package/lib/rtp/src/extra/processor/mute.js +4 -2
  223. package/lib/rtp/src/extra/processor/mute.js.map +1 -1
  224. package/lib/rtp/src/extra/processor/nack.js +4 -2
  225. package/lib/rtp/src/extra/processor/nack.js.map +1 -1
  226. package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
  227. package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
  228. package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
  229. package/lib/rtp/src/extra/processor/ogg.js +221 -0
  230. package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
  231. package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
  232. package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
  233. package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
  234. package/lib/rtp/src/extra/processor/rtpCallback.js +2 -1
  235. package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
  236. package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
  237. package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
  238. package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
  239. package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
  240. package/lib/rtp/src/extra/processor/webm.js +14 -7
  241. package/lib/rtp/src/extra/processor/webm.js.map +1 -1
  242. package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
  243. package/lib/rtp/src/index.d.ts +8 -0
  244. package/lib/rtp/src/index.js +8 -0
  245. package/lib/rtp/src/index.js.map +1 -1
  246. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
  247. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +4 -0
  248. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
  249. package/lib/rtp/src/rtcp/rtcp.js +8 -4
  250. package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
  251. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
  252. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
  253. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
  254. package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
  255. package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
  256. package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
  257. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
  258. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
  259. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
  260. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
  261. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
  262. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
  263. package/lib/rtp/src/rtcp/sr.js +1 -0
  264. package/lib/rtp/src/rtcp/sr.js.map +1 -1
  265. package/lib/rtp/src/rtp/continuity.d.ts +49 -0
  266. package/lib/rtp/src/rtp/continuity.js +120 -0
  267. package/lib/rtp/src/rtp/continuity.js.map +1 -0
  268. package/lib/rtp/src/rtp/headerExtension.js +41 -21
  269. package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
  270. package/lib/rtp/src/rtp/padding.d.ts +17 -0
  271. package/lib/rtp/src/rtp/padding.js +37 -0
  272. package/lib/rtp/src/rtp/padding.js.map +1 -0
  273. package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
  274. package/lib/rtp/src/rtp/red/encoder.js +14 -1
  275. package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
  276. package/lib/rtp/src/rtp/red/packet.js +24 -8
  277. package/lib/rtp/src/rtp/red/packet.js.map +1 -1
  278. package/lib/rtp/src/rtp/rtp.d.ts +24 -1
  279. package/lib/rtp/src/rtp/rtp.js +70 -29
  280. package/lib/rtp/src/rtp/rtp.js.map +1 -1
  281. package/lib/rtp/src/rtp/rtx.js +3 -0
  282. package/lib/rtp/src/rtp/rtx.js.map +1 -1
  283. package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
  284. package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
  285. package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
  286. package/lib/rtp/src/rtp/timelineRewriter.d.ts +178 -0
  287. package/lib/rtp/src/rtp/timelineRewriter.js +417 -0
  288. package/lib/rtp/src/rtp/timelineRewriter.js.map +1 -0
  289. package/lib/rtp/src/srtp/cipher/ctr.js +4 -2
  290. package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
  291. package/lib/rtp/src/srtp/cipher/index.js +8 -4
  292. package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
  293. package/lib/rtp/src/srtp/context/context.js +6 -3
  294. package/lib/rtp/src/srtp/context/context.js.map +1 -1
  295. package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
  296. package/lib/rtp/src/srtp/context/srtcp.js +33 -0
  297. package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
  298. package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
  299. package/lib/rtp/src/srtp/context/srtp.js +34 -10
  300. package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
  301. package/lib/rtp/src/srtp/error.d.ts +8 -0
  302. package/lib/rtp/src/srtp/error.js +13 -1
  303. package/lib/rtp/src/srtp/error.js.map +1 -1
  304. package/lib/rtp/src/srtp/packet.js +4 -1
  305. package/lib/rtp/src/srtp/packet.js.map +1 -1
  306. package/lib/rtp/src/srtp/replay.d.ts +24 -0
  307. package/lib/rtp/src/srtp/replay.js +75 -0
  308. package/lib/rtp/src/srtp/replay.js.map +1 -0
  309. package/lib/rtp/src/srtp/session.js +2 -1
  310. package/lib/rtp/src/srtp/session.js.map +1 -1
  311. package/lib/rtp/src/srtp/srtcp.js +2 -1
  312. package/lib/rtp/src/srtp/srtcp.js.map +1 -1
  313. package/lib/rtp/src/srtp/srtp.js +2 -1
  314. package/lib/rtp/src/srtp/srtp.js.map +1 -1
  315. package/lib/rtp/src/util.js +2 -1
  316. package/lib/rtp/src/util.js.map +1 -1
  317. package/lib/sctp/src/chunk.d.ts +5 -0
  318. package/lib/sctp/src/chunk.js +31 -8
  319. package/lib/sctp/src/chunk.js.map +1 -1
  320. package/lib/sctp/src/const.d.ts +25 -17
  321. package/lib/sctp/src/const.js +23 -19
  322. package/lib/sctp/src/const.js.map +1 -1
  323. package/lib/sctp/src/param.d.ts +6 -2
  324. package/lib/sctp/src/param.js +22 -8
  325. package/lib/sctp/src/param.js.map +1 -1
  326. package/lib/sctp/src/sctp.d.ts +85 -0
  327. package/lib/sctp/src/sctp.js +707 -126
  328. package/lib/sctp/src/sctp.js.map +1 -1
  329. package/lib/sctp/src/transport.js +4 -2
  330. package/lib/sctp/src/transport.js.map +1 -1
  331. package/lib/webrtc/src/api/compatibilityOptions.d.ts +33 -0
  332. package/lib/webrtc/src/api/compatibilityOptions.js +33 -0
  333. package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -0
  334. package/lib/webrtc/src/api/peerConfig.d.ts +385 -28
  335. package/lib/webrtc/src/api/peerConfig.js +121 -14
  336. package/lib/webrtc/src/api/peerConfig.js.map +1 -1
  337. package/lib/webrtc/src/api/peerConnectionEvents.d.ts +77 -1
  338. package/lib/webrtc/src/api/peerConnectionEvents.js +105 -1
  339. package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -1
  340. package/lib/webrtc/src/dataChannel.d.ts +10 -0
  341. package/lib/webrtc/src/dataChannel.js +24 -4
  342. package/lib/webrtc/src/dataChannel.js.map +1 -1
  343. package/lib/webrtc/src/helper.d.ts +8 -0
  344. package/lib/webrtc/src/helper.js +40 -4
  345. package/lib/webrtc/src/helper.js.map +1 -1
  346. package/lib/webrtc/src/media/codecCompatibility.d.ts +87 -1
  347. package/lib/webrtc/src/media/codecCompatibility.js +338 -12
  348. package/lib/webrtc/src/media/codecCompatibility.js.map +1 -1
  349. package/lib/webrtc/src/media/index.d.ts +10 -0
  350. package/lib/webrtc/src/media/index.js +70 -0
  351. package/lib/webrtc/src/media/index.js.map +1 -1
  352. package/lib/webrtc/src/media/receiver/nack.d.ts +43 -10
  353. package/lib/webrtc/src/media/receiver/nack.js +246 -88
  354. package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
  355. package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
  356. package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
  357. package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
  358. package/lib/webrtc/src/media/router.d.ts +241 -40
  359. package/lib/webrtc/src/media/router.js +676 -205
  360. package/lib/webrtc/src/media/router.js.map +1 -1
  361. package/lib/webrtc/src/media/routing/pendingRoutes.d.ts +26 -0
  362. package/lib/webrtc/src/media/routing/pendingRoutes.js +48 -0
  363. package/lib/webrtc/src/media/routing/pendingRoutes.js.map +1 -0
  364. package/lib/webrtc/src/media/routing/ridRouting.d.ts +37 -0
  365. package/lib/webrtc/src/media/routing/ridRouting.js +74 -0
  366. package/lib/webrtc/src/media/routing/ridRouting.js.map +1 -0
  367. package/lib/webrtc/src/media/routing/routeTable.d.ts +60 -0
  368. package/lib/webrtc/src/media/routing/routeTable.js +95 -0
  369. package/lib/webrtc/src/media/routing/routeTable.js.map +1 -0
  370. package/lib/webrtc/src/media/routing/rtcpRouting.d.ts +34 -0
  371. package/lib/webrtc/src/media/routing/rtcpRouting.js +165 -0
  372. package/lib/webrtc/src/media/routing/rtcpRouting.js.map +1 -0
  373. package/lib/webrtc/src/media/routing/unknownSsrc.d.ts +55 -0
  374. package/lib/webrtc/src/media/routing/unknownSsrc.js +117 -0
  375. package/lib/webrtc/src/media/routing/unknownSsrc.js.map +1 -0
  376. package/lib/webrtc/src/media/rtpReceiver.d.ts +252 -2
  377. package/lib/webrtc/src/media/rtpReceiver.js +833 -44
  378. package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
  379. package/lib/webrtc/src/media/rtpSender.d.ts +191 -70
  380. package/lib/webrtc/src/media/rtpSender.js +631 -448
  381. package/lib/webrtc/src/media/rtpSender.js.map +1 -1
  382. package/lib/webrtc/src/media/rtpTransceiver.d.ts +19 -3
  383. package/lib/webrtc/src/media/rtpTransceiver.js +74 -9
  384. package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
  385. package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
  386. package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
  387. package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
  388. package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
  389. package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
  390. package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
  391. package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
  392. package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
  393. package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
  394. package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
  395. package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
  396. package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
  397. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
  398. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
  399. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
  400. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
  401. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
  402. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
  403. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
  404. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
  405. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
  406. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
  407. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
  408. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
  409. package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
  410. package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
  411. package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
  412. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
  413. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
  414. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
  415. package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
  416. package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
  417. package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
  418. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
  419. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
  420. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
  421. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
  422. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
  423. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
  424. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
  425. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
  426. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
  427. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
  428. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
  429. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
  430. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
  431. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
  432. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
  433. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
  434. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
  435. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
  436. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
  437. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
  438. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
  439. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
  440. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
  441. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
  442. package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
  443. package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
  444. package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
  445. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
  446. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
  447. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
  448. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
  449. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
  450. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
  451. package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
  452. package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
  453. package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
  454. package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
  455. package/lib/webrtc/src/media/sender/padding.js +134 -0
  456. package/lib/webrtc/src/media/sender/padding.js.map +1 -0
  457. package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
  458. package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
  459. package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
  460. package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
  461. package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
  462. package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
  463. package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
  464. package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
  465. package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
  466. package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -33
  467. package/lib/webrtc/src/media/sender/senderBWE.js +5 -154
  468. package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
  469. package/lib/webrtc/src/media/sender/senderReportHistory.d.ts +51 -0
  470. package/lib/webrtc/src/media/sender/senderReportHistory.js +111 -0
  471. package/lib/webrtc/src/media/sender/senderReportHistory.js.map +1 -0
  472. package/lib/webrtc/src/media/sender/senderStats.d.ts +101 -0
  473. package/lib/webrtc/src/media/sender/senderStats.js +317 -0
  474. package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
  475. package/lib/webrtc/src/media/track.d.ts +29 -2
  476. package/lib/webrtc/src/media/track.js +32 -5
  477. package/lib/webrtc/src/media/track.js.map +1 -1
  478. package/lib/webrtc/src/negotiation/bundleTopology.d.ts +1 -5
  479. package/lib/webrtc/src/negotiation/bundleTopology.js +15 -11
  480. package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -1
  481. package/lib/webrtc/src/negotiation/descriptionValidation.js +12 -6
  482. package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -1
  483. package/lib/webrtc/src/negotiation/negotiationNeeded.js +2 -1
  484. package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -1
  485. package/lib/webrtc/src/negotiation/remoteCandidates.js +10 -5
  486. package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -1
  487. package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +24 -7
  488. package/lib/webrtc/src/negotiation/remoteMediaApplication.js +67 -27
  489. package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -1
  490. package/lib/webrtc/src/negotiation/transceiverPairing.d.ts +1 -0
  491. package/lib/webrtc/src/negotiation/transceiverPairing.js +62 -0
  492. package/lib/webrtc/src/negotiation/transceiverPairing.js.map +1 -0
  493. package/lib/webrtc/src/negotiation/transportActivation.d.ts +8 -1
  494. package/lib/webrtc/src/negotiation/transportActivation.js +40 -8
  495. package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
  496. package/lib/webrtc/src/negotiationTransaction.d.ts +43 -5
  497. package/lib/webrtc/src/negotiationTransaction.js +129 -13
  498. package/lib/webrtc/src/negotiationTransaction.js.map +1 -1
  499. package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
  500. package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
  501. package/lib/webrtc/src/nonstandard/navigator.js +4 -3
  502. package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
  503. package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
  504. package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
  505. package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
  506. package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +9 -7
  507. package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
  508. package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
  509. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
  510. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
  511. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
  512. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +8 -1
  513. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
  514. package/lib/webrtc/src/nonstandard/userMedia.js +2 -1
  515. package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
  516. package/lib/webrtc/src/peerConnection.d.ts +108 -6
  517. package/lib/webrtc/src/peerConnection.js +357 -36
  518. package/lib/webrtc/src/peerConnection.js.map +1 -1
  519. package/lib/webrtc/src/polyfill/globals.d.ts +2 -1
  520. package/lib/webrtc/src/polyfill/globals.js.map +1 -1
  521. package/lib/webrtc/src/polyfill/install.js +2 -0
  522. package/lib/webrtc/src/polyfill/install.js.map +1 -1
  523. package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
  524. package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
  525. package/lib/webrtc/src/sctpManager.d.ts +46 -14
  526. package/lib/webrtc/src/sctpManager.js +92 -25
  527. package/lib/webrtc/src/sctpManager.js.map +1 -1
  528. package/lib/webrtc/src/sdp.d.ts +69 -0
  529. package/lib/webrtc/src/sdp.js +151 -20
  530. package/lib/webrtc/src/sdp.js.map +1 -1
  531. package/lib/webrtc/src/sdpManager.d.ts +85 -4
  532. package/lib/webrtc/src/sdpManager.js +214 -14
  533. package/lib/webrtc/src/sdpManager.js.map +1 -1
  534. package/lib/webrtc/src/secureTransportManager.d.ts +89 -4
  535. package/lib/webrtc/src/secureTransportManager.js +184 -26
  536. package/lib/webrtc/src/secureTransportManager.js.map +1 -1
  537. package/lib/webrtc/src/transceiverManager.d.ts +82 -4
  538. package/lib/webrtc/src/transceiverManager.js +239 -41
  539. package/lib/webrtc/src/transceiverManager.js.map +1 -1
  540. package/lib/webrtc/src/transport/dtls.d.ts +147 -1
  541. package/lib/webrtc/src/transport/dtls.js +446 -50
  542. package/lib/webrtc/src/transport/dtls.js.map +1 -1
  543. package/lib/webrtc/src/transport/ice.d.ts +71 -90
  544. package/lib/webrtc/src/transport/ice.js +250 -42
  545. package/lib/webrtc/src/transport/ice.js.map +1 -1
  546. package/lib/webrtc/src/transport/sctp.d.ts +25 -0
  547. package/lib/webrtc/src/transport/sctp.js +153 -22
  548. package/lib/webrtc/src/transport/sctp.js.map +1 -1
  549. package/lib/webrtc/src/utils.d.ts +69 -3
  550. package/lib/webrtc/src/utils.js +105 -16
  551. package/lib/webrtc/src/utils.js.map +1 -1
  552. package/package.json +9 -6
@@ -0,0 +1,70 @@
1
+ import type { BandwidthEstimator, ProbeClusterConfig } from "./bandwidthEstimator";
2
+ /** What the binding reports back to its {@link RTCRtpSender}. */
3
+ export type EstimatorBindingHooks = {
4
+ /** The active estimator changed its recommended bitrate (bps). */
5
+ onAvailableBitrate: (bps: number) => void;
6
+ /** The active estimator activated a probe cluster. */
7
+ onProbeClusterConfig: (cfg: ProbeClusterConfig) => void;
8
+ /** After each process tick (pin GetPacingRates padding_rate). */
9
+ onProcessTick: () => void;
10
+ /** The sender is stopped: the process timer neither starts nor ticks. */
11
+ isStopped: () => boolean;
12
+ };
13
+ /**
14
+ * The send-side bandwidth estimator of one {@link RTCRtpSender} and
15
+ * everything tied to its lifetime: the event bridges to the sender, the
16
+ * process timer, and the **generation**.
17
+ *
18
+ * The generation is bumped whenever the estimator is replaced, reset for a
19
+ * new transport, or the sender stops. A send or padding drain captures it at
20
+ * start and drops its estimator delivery when it no longer matches, so a
21
+ * packet planned under the old estimator cannot pollute the new clean one or
22
+ * revive a disposed probe controller. {@link generationSignal} aborts at the
23
+ * same moment to release waits running at the old estimator's rate.
24
+ */
25
+ export declare class EstimatorBinding {
26
+ private readonly hooks;
27
+ private current;
28
+ private _generation;
29
+ private generationCancel;
30
+ private unsubscribeAvailableBitrate?;
31
+ private unsubscribeProbeClusterConfig?;
32
+ /** Interval from {@link BandwidthEstimator.processIntervalMs} (0 = none). */
33
+ private processTimer?;
34
+ constructor(initial: BandwidthEstimator, hooks: EstimatorBindingHooks);
35
+ get estimator(): BandwidthEstimator;
36
+ get generation(): number;
37
+ /** Aborted on the next generation bump. */
38
+ get generationSignal(): AbortSignal;
39
+ /** Invalidate sends planned under the current estimator and release their waits. */
40
+ bumpGeneration(): void;
41
+ /**
42
+ * Make `impl` the active estimator with a clean state: bump the
43
+ * generation, release the previous instance (`dispose()`, else `reset()`)
44
+ * and always `reset()` `impl`, so a previously used instance does not merge
45
+ * old state. The same instance is only reset.
46
+ */
47
+ replace(impl: BandwidthEstimator): void;
48
+ /**
49
+ * A new DTLS transport has its own transport-wide sequence space and path
50
+ * (pin `OnNetworkRouteChanged` resets the controller): drop the path state
51
+ * and keep app-configured constraints
52
+ * ({@link BandwidthEstimator.resetNetworkRoute}, else `reset()`).
53
+ */
54
+ resetForNewRoute(): void;
55
+ /**
56
+ * pin `OnNetworkAvailability` — initial probes wait until DTLS can send.
57
+ * Lightweight / disabled no-op `setNetworkAvailable`.
58
+ */
59
+ syncNetworkAvailability(connected: boolean): void;
60
+ /**
61
+ * (Re)start the process timer for the active estimator (pin
62
+ * `GoogCcNetworkControllerFactory::GetProcessInterval`).
63
+ */
64
+ syncProcessTimer(): void;
65
+ /** Sender stop: no timer, no bridges, estimator released. */
66
+ close(): void;
67
+ private stopProcessTimer;
68
+ private bind;
69
+ private unbind;
70
+ }
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EstimatorBinding = void 0;
4
+ const utils_1 = require("../../utils");
5
+ /**
6
+ * The send-side bandwidth estimator of one {@link RTCRtpSender} and
7
+ * everything tied to its lifetime: the event bridges to the sender, the
8
+ * process timer, and the **generation**.
9
+ *
10
+ * The generation is bumped whenever the estimator is replaced, reset for a
11
+ * new transport, or the sender stops. A send or padding drain captures it at
12
+ * start and drops its estimator delivery when it no longer matches, so a
13
+ * packet planned under the old estimator cannot pollute the new clean one or
14
+ * revive a disposed probe controller. {@link generationSignal} aborts at the
15
+ * same moment to release waits running at the old estimator's rate.
16
+ */
17
+ class EstimatorBinding {
18
+ constructor(initial, hooks) {
19
+ Object.defineProperty(this, "hooks", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "current", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ Object.defineProperty(this, "_generation", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: 0
36
+ });
37
+ Object.defineProperty(this, "generationCancel", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: new AbortController()
42
+ });
43
+ Object.defineProperty(this, "unsubscribeAvailableBitrate", {
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true,
47
+ value: void 0
48
+ });
49
+ Object.defineProperty(this, "unsubscribeProbeClusterConfig", {
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true,
53
+ value: void 0
54
+ });
55
+ /** Interval from {@link BandwidthEstimator.processIntervalMs} (0 = none). */
56
+ Object.defineProperty(this, "processTimer", {
57
+ enumerable: true,
58
+ configurable: true,
59
+ writable: true,
60
+ value: void 0
61
+ });
62
+ this.hooks = hooks;
63
+ this.current = initial;
64
+ this.bind(initial);
65
+ }
66
+ get estimator() {
67
+ return this.current;
68
+ }
69
+ get generation() {
70
+ return this._generation;
71
+ }
72
+ /** Aborted on the next generation bump. */
73
+ get generationSignal() {
74
+ return this.generationCancel.signal;
75
+ }
76
+ /** Invalidate sends planned under the current estimator and release their waits. */
77
+ bumpGeneration() {
78
+ this._generation++;
79
+ this.generationCancel.abort();
80
+ this.generationCancel = new AbortController();
81
+ }
82
+ /**
83
+ * Make `impl` the active estimator with a clean state: bump the
84
+ * generation, release the previous instance (`dispose()`, else `reset()`)
85
+ * and always `reset()` `impl`, so a previously used instance does not merge
86
+ * old state. The same instance is only reset.
87
+ */
88
+ replace(impl) {
89
+ this.bumpGeneration();
90
+ if (impl === this.current) {
91
+ impl.reset?.();
92
+ return;
93
+ }
94
+ this.unbind();
95
+ release(this.current);
96
+ impl.reset?.();
97
+ this.current = impl;
98
+ this.bind(impl);
99
+ }
100
+ /**
101
+ * A new DTLS transport has its own transport-wide sequence space and path
102
+ * (pin `OnNetworkRouteChanged` resets the controller): drop the path state
103
+ * and keep app-configured constraints
104
+ * ({@link BandwidthEstimator.resetNetworkRoute}, else `reset()`).
105
+ */
106
+ resetForNewRoute() {
107
+ this.bumpGeneration();
108
+ const estimator = this.current;
109
+ if (estimator.resetNetworkRoute)
110
+ estimator.resetNetworkRoute();
111
+ else
112
+ estimator.reset?.();
113
+ }
114
+ /**
115
+ * pin `OnNetworkAvailability` — initial probes wait until DTLS can send.
116
+ * Lightweight / disabled no-op `setNetworkAvailable`.
117
+ */
118
+ syncNetworkAvailability(connected) {
119
+ this.current.setNetworkAvailable(connected);
120
+ }
121
+ /**
122
+ * (Re)start the process timer for the active estimator (pin
123
+ * `GoogCcNetworkControllerFactory::GetProcessInterval`).
124
+ */
125
+ syncProcessTimer() {
126
+ this.stopProcessTimer();
127
+ if (this.hooks.isStopped())
128
+ return;
129
+ const intervalMs = this.current.processIntervalMs;
130
+ if (!(intervalMs > 0))
131
+ return;
132
+ const timer = setInterval(() => {
133
+ if (this.hooks.isStopped())
134
+ return;
135
+ this.current.process((0, utils_1.milliTime)());
136
+ this.hooks.onProcessTick();
137
+ }, intervalMs);
138
+ timer.unref?.();
139
+ this.processTimer = timer;
140
+ }
141
+ /** Sender stop: no timer, no bridges, estimator released. */
142
+ close() {
143
+ this.stopProcessTimer();
144
+ this.unbind();
145
+ release(this.current);
146
+ }
147
+ stopProcessTimer() {
148
+ if (this.processTimer !== undefined) {
149
+ clearInterval(this.processTimer);
150
+ this.processTimer = undefined;
151
+ }
152
+ }
153
+ bind(impl) {
154
+ this.unsubscribeAvailableBitrate?.();
155
+ this.unsubscribeAvailableBitrate = impl.onAvailableBitrate.subscribe((bps) => this.hooks.onAvailableBitrate(bps)).unSubscribe;
156
+ this.unsubscribeProbeClusterConfig?.();
157
+ this.unsubscribeProbeClusterConfig = impl.onProbeClusterConfig.subscribe((cfg) => this.hooks.onProbeClusterConfig(cfg)).unSubscribe;
158
+ }
159
+ unbind() {
160
+ this.unsubscribeAvailableBitrate?.();
161
+ this.unsubscribeAvailableBitrate = undefined;
162
+ this.unsubscribeProbeClusterConfig?.();
163
+ this.unsubscribeProbeClusterConfig = undefined;
164
+ }
165
+ }
166
+ exports.EstimatorBinding = EstimatorBinding;
167
+ function release(estimator) {
168
+ if (estimator.dispose) {
169
+ estimator.dispose();
170
+ }
171
+ else {
172
+ estimator.reset?.();
173
+ }
174
+ }
175
+ //# sourceMappingURL=estimatorBinding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"estimatorBinding.js","sourceRoot":"","sources":["../../../../../src/media/sender/estimatorBinding.ts"],"names":[],"mappings":"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","sourcesContent":["import { milliTime } from \"../../utils\";\nimport type {\n BandwidthEstimator,\n ProbeClusterConfig,\n} from \"./bandwidthEstimator\";\n\n/** What the binding reports back to its {@link RTCRtpSender}. */\nexport type EstimatorBindingHooks = {\n /** The active estimator changed its recommended bitrate (bps). */\n onAvailableBitrate: (bps: number) => void;\n /** The active estimator activated a probe cluster. */\n onProbeClusterConfig: (cfg: ProbeClusterConfig) => void;\n /** After each process tick (pin GetPacingRates padding_rate). */\n onProcessTick: () => void;\n /** The sender is stopped: the process timer neither starts nor ticks. */\n isStopped: () => boolean;\n};\n\n/**\n * The send-side bandwidth estimator of one {@link RTCRtpSender} and\n * everything tied to its lifetime: the event bridges to the sender, the\n * process timer, and the **generation**.\n *\n * The generation is bumped whenever the estimator is replaced, reset for a\n * new transport, or the sender stops. A send or padding drain captures it at\n * start and drops its estimator delivery when it no longer matches, so a\n * packet planned under the old estimator cannot pollute the new clean one or\n * revive a disposed probe controller. {@link generationSignal} aborts at the\n * same moment to release waits running at the old estimator's rate.\n */\nexport class EstimatorBinding {\n private readonly hooks: EstimatorBindingHooks;\n private current: BandwidthEstimator;\n private _generation = 0;\n private generationCancel = new AbortController();\n private unsubscribeAvailableBitrate?: () => void;\n private unsubscribeProbeClusterConfig?: () => void;\n /** Interval from {@link BandwidthEstimator.processIntervalMs} (0 = none). */\n private processTimer?: ReturnType<typeof setInterval>;\n\n constructor(initial: BandwidthEstimator, hooks: EstimatorBindingHooks) {\n this.hooks = hooks;\n this.current = initial;\n this.bind(initial);\n }\n\n get estimator(): BandwidthEstimator {\n return this.current;\n }\n\n get generation() {\n return this._generation;\n }\n\n /** Aborted on the next generation bump. */\n get generationSignal(): AbortSignal {\n return this.generationCancel.signal;\n }\n\n /** Invalidate sends planned under the current estimator and release their waits. */\n bumpGeneration() {\n this._generation++;\n this.generationCancel.abort();\n this.generationCancel = new AbortController();\n }\n\n /**\n * Make `impl` the active estimator with a clean state: bump the\n * generation, release the previous instance (`dispose()`, else `reset()`)\n * and always `reset()` `impl`, so a previously used instance does not merge\n * old state. The same instance is only reset.\n */\n replace(impl: BandwidthEstimator) {\n this.bumpGeneration();\n if (impl === this.current) {\n impl.reset?.();\n return;\n }\n this.unbind();\n release(this.current);\n impl.reset?.();\n this.current = impl;\n this.bind(impl);\n }\n\n /**\n * A new DTLS transport has its own transport-wide sequence space and path\n * (pin `OnNetworkRouteChanged` resets the controller): drop the path state\n * and keep app-configured constraints\n * ({@link BandwidthEstimator.resetNetworkRoute}, else `reset()`).\n */\n resetForNewRoute() {\n this.bumpGeneration();\n const estimator = this.current;\n if (estimator.resetNetworkRoute) estimator.resetNetworkRoute();\n else estimator.reset?.();\n }\n\n /**\n * pin `OnNetworkAvailability` — initial probes wait until DTLS can send.\n * Lightweight / disabled no-op `setNetworkAvailable`.\n */\n syncNetworkAvailability(connected: boolean) {\n this.current.setNetworkAvailable(connected);\n }\n\n /**\n * (Re)start the process timer for the active estimator (pin\n * `GoogCcNetworkControllerFactory::GetProcessInterval`).\n */\n syncProcessTimer() {\n this.stopProcessTimer();\n if (this.hooks.isStopped()) return;\n const intervalMs = this.current.processIntervalMs;\n if (!(intervalMs > 0)) return;\n const timer = setInterval(() => {\n if (this.hooks.isStopped()) return;\n this.current.process(milliTime());\n this.hooks.onProcessTick();\n }, intervalMs);\n timer.unref?.();\n this.processTimer = timer;\n }\n\n /** Sender stop: no timer, no bridges, estimator released. */\n close() {\n this.stopProcessTimer();\n this.unbind();\n release(this.current);\n }\n\n private stopProcessTimer() {\n if (this.processTimer !== undefined) {\n clearInterval(this.processTimer);\n this.processTimer = undefined;\n }\n }\n\n private bind(impl: BandwidthEstimator) {\n this.unsubscribeAvailableBitrate?.();\n this.unsubscribeAvailableBitrate = impl.onAvailableBitrate.subscribe(\n (bps) => this.hooks.onAvailableBitrate(bps),\n ).unSubscribe;\n\n this.unsubscribeProbeClusterConfig?.();\n this.unsubscribeProbeClusterConfig = impl.onProbeClusterConfig.subscribe(\n (cfg) => this.hooks.onProbeClusterConfig(cfg),\n ).unSubscribe;\n }\n\n private unbind() {\n this.unsubscribeAvailableBitrate?.();\n this.unsubscribeAvailableBitrate = undefined;\n this.unsubscribeProbeClusterConfig?.();\n this.unsubscribeProbeClusterConfig = undefined;\n }\n}\n\nfunction release(estimator: BandwidthEstimator) {\n if (estimator.dispose) {\n estimator.dispose();\n } else {\n estimator.reset?.();\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { Event } from "../../../imports/common";
2
+ import type { TransportWideCC } from "../../../imports/rtp";
3
+ import type { BandwidthEstimator, SentInfo } from "../bandwidthEstimator";
4
+ import { BandwidthEstimatorNoopHooks } from "../bandwidthEstimator";
5
+ /**
6
+ * Send-side BWE that ignores TWCC and never recommends a bitrate.
7
+ *
8
+ * Used when {@link PeerConfig.bandwidthEstimator} is `false` / `"none"`.
9
+ * Probe, pacing, RTT, and process-interval hooks are no-ops.
10
+ */
11
+ export declare class DisabledBandwidthEstimator extends BandwidthEstimatorNoopHooks implements BandwidthEstimator {
12
+ readonly onAvailableBitrate: Event<[number]>;
13
+ get availableBitrate(): number;
14
+ rtpPacketSent(_info: SentInfo): void;
15
+ receiveTWCC(_feedback: TransportWideCC): void;
16
+ reset(): void;
17
+ dispose(): void;
18
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisabledBandwidthEstimator = void 0;
4
+ const common_1 = require("../../../imports/common");
5
+ const bandwidthEstimator_1 = require("../bandwidthEstimator");
6
+ /**
7
+ * Send-side BWE that ignores TWCC and never recommends a bitrate.
8
+ *
9
+ * Used when {@link PeerConfig.bandwidthEstimator} is `false` / `"none"`.
10
+ * Probe, pacing, RTT, and process-interval hooks are no-ops.
11
+ */
12
+ class DisabledBandwidthEstimator extends bandwidthEstimator_1.BandwidthEstimatorNoopHooks {
13
+ constructor() {
14
+ super(...arguments);
15
+ /** @internal */
16
+ Object.defineProperty(this, "_availableBitrate", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: 0
21
+ });
22
+ Object.defineProperty(this, "onAvailableBitrate", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ writable: true,
26
+ value: new common_1.Event()
27
+ });
28
+ }
29
+ get availableBitrate() {
30
+ return 0;
31
+ }
32
+ rtpPacketSent(_info) { }
33
+ receiveTWCC(_feedback) { }
34
+ reset() {
35
+ this._availableBitrate = 0;
36
+ }
37
+ dispose() {
38
+ this.onAvailableBitrate.allUnsubscribe();
39
+ this.disposeNoopHooks();
40
+ this.reset();
41
+ }
42
+ }
43
+ exports.DisabledBandwidthEstimator = DisabledBandwidthEstimator;
44
+ //# sourceMappingURL=disabledBwe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disabledBwe.js","sourceRoot":"","sources":["../../../../../../src/media/sender/estimators/disabledBwe.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAGhD,8DAAoE;AAEpE;;;;;GAKG;AACH,MAAa,0BACX,SAAQ,gDAA2B;IADrC;;QAIE,gBAAgB;QAChB;;;;mBAAoB,CAAC;WAAC;QAEb;;;;mBAAqB,IAAI,cAAK,EAAY;WAAC;IAmBtD,CAAC;IAjBC,IAAI,gBAAgB;QAClB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,aAAa,CAAC,KAAe,IAAS,CAAC;IAEvC,WAAW,CAAC,SAA0B,IAAS,CAAC;IAEhD,KAAK;QACH,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO;QACL,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC;QACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF;AA1BD,gEA0BC","sourcesContent":["import { Event } from \"../../../imports/common\";\nimport type { TransportWideCC } from \"../../../imports/rtp\";\nimport type { BandwidthEstimator, SentInfo } from \"../bandwidthEstimator\";\nimport { BandwidthEstimatorNoopHooks } from \"../bandwidthEstimator\";\n\n/**\n * Send-side BWE that ignores TWCC and never recommends a bitrate.\n *\n * Used when {@link PeerConfig.bandwidthEstimator} is `false` / `\"none\"`.\n * Probe, pacing, RTT, and process-interval hooks are no-ops.\n */\nexport class DisabledBandwidthEstimator\n extends BandwidthEstimatorNoopHooks\n implements BandwidthEstimator\n{\n /** @internal */\n _availableBitrate = 0;\n\n readonly onAvailableBitrate = new Event<[number]>();\n\n get availableBitrate() {\n return 0;\n }\n\n rtpPacketSent(_info: SentInfo): void {}\n\n receiveTWCC(_feedback: TransportWideCC): void {}\n\n reset(): void {\n this._availableBitrate = 0;\n }\n\n dispose(): void {\n this.onAvailableBitrate.allUnsubscribe();\n this.disposeNoopHooks();\n this.reset();\n }\n}\n"]}
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * Portions of this file are ported from libwebrtc
3
+ * (https://webrtc.googlesource.com/src, commit 0fda16159e33adf59c71a7ad1173dcbe5a632102).
4
+ * Copyright (c) 2011, The WebRTC project authors. All rights reserved.
5
+ * Use of that source is governed by a BSD-style license and an additional
6
+ * patent grant; both are reproduced in THIRD_PARTY_LICENSES_LIBWEBRTC.txt
7
+ * (shipped with this package).
8
+ */
9
+ /**
10
+ * libwebrtc-aligned acknowledged throughput estimator.
11
+ *
12
+ * Default path matches pin `0fda1615…` where
13
+ * `RobustThroughputEstimatorSettings.enabled = true`
14
+ * (`modules/congestion_controller/goog_cc/robust_throughput_estimator.*`).
15
+ *
16
+ * Bayesian {@link BitrateEstimator} remains available for tests / field-trial
17
+ * parity when robust mode is disabled.
18
+ */
19
+ /** One ACKed packet sample (TWCC receive timeline + sender send time). */
20
+ export interface AckedPacketSample {
21
+ /** TWCC-relative receive time (ms). */
22
+ receiveTimeMs: number;
23
+ /** Sender send time (ms), same clock as SentInfo.sendingAtMs. */
24
+ sendTimeMs: number;
25
+ /** Packet size in bytes (payload + headers counted by BWE). */
26
+ sizeBytes: number;
27
+ /**
28
+ * pin `SentPacket.prior_unacked_data` — added to both send and receive
29
+ * size (RobustThroughputEstimator).
30
+ */
31
+ priorUnackedBytes?: number;
32
+ }
33
+ /**
34
+ * Sliding-window robust throughput (libwebrtc RobustThroughputEstimator).
35
+ *
36
+ * - Window: ≥ {@link kRobustWindowPackets} and ≥ {@link kRobustMinWindowDurationMs},
37
+ * capped by max packets / max duration
38
+ * - Replaces the largest receive gap with the second-largest (delay-spike guard)
39
+ * - Returns min(send_rate, recv_rate); send side drops reordered-old packets
40
+ */
41
+ export declare class AcknowledgedBitrateEstimator {
42
+ private window;
43
+ private latestDiscardedSendTimeMs;
44
+ reset(): void;
45
+ /**
46
+ * pin RobustThroughputEstimator::SetAlr — no-op on the robust path.
47
+ * Kept so GCC can publish ALR without branching on estimator type.
48
+ */
49
+ setAlr(_inAlr: boolean): void;
50
+ /** pin RobustThroughputEstimator::SetAlrEndedTime — no-op. */
51
+ setAlrEndedTime(_atTimeMs: number): void;
52
+ /**
53
+ * Ingest ACKed packets. Prefer **receive-time order** (libwebrtc
54
+ * `SortedByReceiveTime`); out-of-order samples are insertion-sorted.
55
+ */
56
+ incomingPacketFeedbackVector(packets: AckedPacketSample[]): void;
57
+ /** @returns estimated acked bitrate in bps, or 0 if not ready. */
58
+ bitrate(): number;
59
+ private firstPacketOutsideWindow;
60
+ }
61
+ /**
62
+ * Bayesian bitrate estimator (libwebrtc BitrateEstimator).
63
+ * Used when robust throughput is disabled; kept for parity / unit tests.
64
+ */
65
+ export declare class BitrateEstimator {
66
+ private sum;
67
+ private currentWindowMs;
68
+ private prevTimeMs;
69
+ private bitrateEstimateKbps;
70
+ private bitrateEstimateVar;
71
+ private readonly initialWindowMs;
72
+ private readonly nonInitialWindowMs;
73
+ private readonly uncertaintyScale;
74
+ reset(): void;
75
+ update(atTimeMs: number, bytes: number): void;
76
+ bitrate(): number;
77
+ expectFastRateChange(): void;
78
+ private updateWindow;
79
+ }