werift 0.17.6 → 0.18.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 (338) hide show
  1. package/lib/common/src/binary.d.ts +1 -0
  2. package/lib/common/src/binary.js +74 -21
  3. package/lib/common/src/binary.js.map +1 -1
  4. package/lib/common/src/log.js +18 -0
  5. package/lib/common/src/log.js.map +1 -1
  6. package/lib/common/src/network.d.ts +1 -1
  7. package/lib/common/src/network.js +1 -0
  8. package/lib/common/src/network.js.map +1 -1
  9. package/lib/common/src/promise.js +22 -7
  10. package/lib/common/src/promise.js.map +1 -1
  11. package/lib/common/src/type.d.ts +1 -1
  12. package/lib/dtls/src/cipher/const.d.ts +7 -7
  13. package/lib/dtls/src/cipher/key-exchange.js +24 -1
  14. package/lib/dtls/src/cipher/key-exchange.js.map +1 -1
  15. package/lib/dtls/src/cipher/suites/abstract.d.ts +2 -2
  16. package/lib/dtls/src/cipher/suites/abstract.js +36 -2
  17. package/lib/dtls/src/cipher/suites/abstract.js.map +1 -1
  18. package/lib/dtls/src/cipher/suites/aead.js +60 -6
  19. package/lib/dtls/src/cipher/suites/aead.js.map +1 -1
  20. package/lib/dtls/src/client.js +62 -51
  21. package/lib/dtls/src/client.js.map +1 -1
  22. package/lib/dtls/src/context/cipher.js +151 -59
  23. package/lib/dtls/src/context/cipher.js.map +1 -1
  24. package/lib/dtls/src/context/dtls.js +90 -14
  25. package/lib/dtls/src/context/dtls.js.map +1 -1
  26. package/lib/dtls/src/context/srtp.d.ts +1 -1
  27. package/lib/dtls/src/context/srtp.js +8 -0
  28. package/lib/dtls/src/context/srtp.js.map +1 -1
  29. package/lib/dtls/src/context/transport.js +14 -2
  30. package/lib/dtls/src/context/transport.js.map +1 -1
  31. package/lib/dtls/src/flight/client/flight1.js +6 -1
  32. package/lib/dtls/src/flight/client/flight1.js.map +1 -1
  33. package/lib/dtls/src/flight/client/flight5.js +12 -2
  34. package/lib/dtls/src/flight/client/flight5.js.map +1 -1
  35. package/lib/dtls/src/flight/flight.d.ts +1 -1
  36. package/lib/dtls/src/flight/flight.js +42 -7
  37. package/lib/dtls/src/flight/flight.js.map +1 -1
  38. package/lib/dtls/src/flight/server/flight2.js +4 -2
  39. package/lib/dtls/src/flight/server/flight2.js.map +1 -1
  40. package/lib/dtls/src/flight/server/flight4.js +12 -2
  41. package/lib/dtls/src/flight/server/flight4.js.map +1 -1
  42. package/lib/dtls/src/flight/server/flight6.js +6 -1
  43. package/lib/dtls/src/flight/server/flight6.js.map +1 -1
  44. package/lib/dtls/src/handshake/extensions/ellipticCurves.js +27 -7
  45. package/lib/dtls/src/handshake/extensions/ellipticCurves.js.map +1 -1
  46. package/lib/dtls/src/handshake/extensions/extendedMasterSecret.js +6 -1
  47. package/lib/dtls/src/handshake/extensions/extendedMasterSecret.js.map +1 -1
  48. package/lib/dtls/src/handshake/extensions/renegotiationIndication.js +27 -7
  49. package/lib/dtls/src/handshake/extensions/renegotiationIndication.js.map +1 -1
  50. package/lib/dtls/src/handshake/extensions/signature.js +27 -7
  51. package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
  52. package/lib/dtls/src/handshake/extensions/useSrtp.js +39 -9
  53. package/lib/dtls/src/handshake/extensions/useSrtp.js.map +1 -1
  54. package/lib/dtls/src/handshake/message/alert.js +21 -6
  55. package/lib/dtls/src/handshake/message/alert.js.map +1 -1
  56. package/lib/dtls/src/handshake/message/certificate.js +26 -5
  57. package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
  58. package/lib/dtls/src/handshake/message/changeCipherSpec.js +14 -4
  59. package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
  60. package/lib/dtls/src/handshake/message/client/certificateVerify.js +33 -7
  61. package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
  62. package/lib/dtls/src/handshake/message/client/hello.js +68 -18
  63. package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
  64. package/lib/dtls/src/handshake/message/client/keyExchange.js +26 -5
  65. package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
  66. package/lib/dtls/src/handshake/message/finished.js +18 -2
  67. package/lib/dtls/src/handshake/message/finished.js.map +1 -1
  68. package/lib/dtls/src/handshake/message/server/certificateRequest.js +40 -9
  69. package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
  70. package/lib/dtls/src/handshake/message/server/hello.js +60 -14
  71. package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
  72. package/lib/dtls/src/handshake/message/server/helloDone.js +18 -2
  73. package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
  74. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +33 -7
  75. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
  76. package/lib/dtls/src/handshake/message/server/keyExchange.js +75 -19
  77. package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
  78. package/lib/dtls/src/handshake/random.js +21 -6
  79. package/lib/dtls/src/handshake/random.js.map +1 -1
  80. package/lib/dtls/src/record/builder.d.ts +1 -1
  81. package/lib/dtls/src/record/message/fragment.js +49 -14
  82. package/lib/dtls/src/record/message/fragment.js.map +1 -1
  83. package/lib/dtls/src/record/message/header.js +84 -24
  84. package/lib/dtls/src/record/message/header.js.map +1 -1
  85. package/lib/dtls/src/record/message/plaintext.js +21 -6
  86. package/lib/dtls/src/record/message/plaintext.js.map +1 -1
  87. package/lib/dtls/src/server.js +59 -42
  88. package/lib/dtls/src/server.js.map +1 -1
  89. package/lib/dtls/src/socket.js +153 -64
  90. package/lib/dtls/src/socket.js.map +1 -1
  91. package/lib/dtls/src/transport.js +38 -11
  92. package/lib/dtls/src/transport.js.map +1 -1
  93. package/lib/dtls/src/typings/domain.d.ts +4 -4
  94. package/lib/ice/src/candidate.js +66 -11
  95. package/lib/ice/src/candidate.js.map +1 -1
  96. package/lib/ice/src/dns/lookup.js +12 -1
  97. package/lib/ice/src/dns/lookup.js.map +1 -1
  98. package/lib/ice/src/exceptions.js +27 -2
  99. package/lib/ice/src/exceptions.js.map +1 -1
  100. package/lib/ice/src/helper.d.ts +1 -1
  101. package/lib/ice/src/helper.js +12 -2
  102. package/lib/ice/src/helper.js.map +1 -1
  103. package/lib/ice/src/ice.d.ts +9 -3
  104. package/lib/ice/src/ice.js +407 -155
  105. package/lib/ice/src/ice.js.map +1 -1
  106. package/lib/ice/src/stun/attributes.d.ts +3 -3
  107. package/lib/ice/src/stun/attributes.js +6 -1
  108. package/lib/ice/src/stun/attributes.js.map +1 -1
  109. package/lib/ice/src/stun/message.d.ts +4 -0
  110. package/lib/ice/src/stun/message.js +24 -3
  111. package/lib/ice/src/stun/message.js.map +1 -1
  112. package/lib/ice/src/stun/protocol.js +64 -15
  113. package/lib/ice/src/stun/protocol.js.map +1 -1
  114. package/lib/ice/src/stun/transaction.js +99 -36
  115. package/lib/ice/src/stun/transaction.js.map +1 -1
  116. package/lib/ice/src/transport.js +57 -21
  117. package/lib/ice/src/transport.js.map +1 -1
  118. package/lib/ice/src/turn/protocol.js +176 -40
  119. package/lib/ice/src/turn/protocol.js.map +1 -1
  120. package/lib/ice/src/types/model.d.ts +1 -1
  121. package/lib/rtp/src/codec/av1.d.ts +1 -1
  122. package/lib/rtp/src/codec/av1.js +118 -30
  123. package/lib/rtp/src/codec/av1.js.map +1 -1
  124. package/lib/rtp/src/codec/base.js +8 -0
  125. package/lib/rtp/src/codec/base.js.map +1 -1
  126. package/lib/rtp/src/codec/h264.js +55 -0
  127. package/lib/rtp/src/codec/h264.js.map +1 -1
  128. package/lib/rtp/src/codec/index.d.ts +2 -0
  129. package/lib/rtp/src/codec/index.js +12 -2
  130. package/lib/rtp/src/codec/index.js.map +1 -1
  131. package/lib/rtp/src/codec/opus.js +8 -0
  132. package/lib/rtp/src/codec/opus.js.map +1 -1
  133. package/lib/rtp/src/codec/vp8.js +102 -3
  134. package/lib/rtp/src/codec/vp8.js.map +1 -1
  135. package/lib/rtp/src/codec/vp9.js +164 -7
  136. package/lib/rtp/src/codec/vp9.js.map +1 -1
  137. package/lib/rtp/src/container/ebml/ebml.js +30 -3
  138. package/lib/rtp/src/container/ebml/ebml.js.map +1 -1
  139. package/lib/rtp/src/container/webm.d.ts +1 -1
  140. package/lib/rtp/src/container/webm.js +44 -13
  141. package/lib/rtp/src/container/webm.js.map +1 -1
  142. package/lib/rtp/src/processor/depacketizer.d.ts +16 -8
  143. package/lib/rtp/src/processor/depacketizer.js +59 -22
  144. package/lib/rtp/src/processor/depacketizer.js.map +1 -1
  145. package/lib/rtp/src/processor/depacketizerCallback.js +24 -8
  146. package/lib/rtp/src/processor/depacketizerCallback.js.map +1 -1
  147. package/lib/rtp/src/processor/depacketizerTransformer.d.ts +2 -2
  148. package/lib/rtp/src/processor/depacketizerTransformer.js +6 -0
  149. package/lib/rtp/src/processor/depacketizerTransformer.js.map +1 -1
  150. package/lib/rtp/src/processor/index.d.ts +4 -2
  151. package/lib/rtp/src/processor/index.js +4 -2
  152. package/lib/rtp/src/processor/index.js.map +1 -1
  153. package/lib/rtp/src/processor/interface.d.ts +4 -0
  154. package/lib/rtp/src/processor/interface.js.map +1 -1
  155. package/lib/rtp/src/processor/jitterBuffer.d.ts +2 -1
  156. package/lib/rtp/src/processor/jitterBuffer.js +40 -8
  157. package/lib/rtp/src/processor/jitterBuffer.js.map +1 -1
  158. package/lib/rtp/src/processor/jitterBufferCallback.js +30 -9
  159. package/lib/rtp/src/processor/jitterBufferCallback.js.map +1 -1
  160. package/lib/rtp/src/processor/jitterBufferTransformer.js +12 -1
  161. package/lib/rtp/src/processor/jitterBufferTransformer.js.map +1 -1
  162. package/lib/rtp/src/processor/lipsync.d.ts +42 -0
  163. package/lib/rtp/src/processor/lipsync.js +178 -0
  164. package/lib/rtp/src/processor/lipsync.js.map +1 -0
  165. package/lib/rtp/src/processor/lipsyncCallback.d.ts +10 -0
  166. package/lib/rtp/src/processor/lipsyncCallback.js +59 -0
  167. package/lib/rtp/src/processor/lipsyncCallback.js.map +1 -0
  168. package/lib/rtp/src/processor/ntpTime.d.ts +24 -0
  169. package/lib/rtp/src/processor/ntpTime.js +91 -0
  170. package/lib/rtp/src/processor/ntpTime.js.map +1 -0
  171. package/lib/rtp/src/processor/ntpTimeCallback.d.ts +7 -0
  172. package/lib/rtp/src/processor/ntpTimeCallback.js +36 -0
  173. package/lib/rtp/src/processor/ntpTimeCallback.js.map +1 -0
  174. package/lib/rtp/src/processor/source/index.d.ts +1 -0
  175. package/lib/rtp/src/processor/source/index.js +1 -0
  176. package/lib/rtp/src/processor/source/index.js.map +1 -1
  177. package/lib/rtp/src/processor/source/rtcpCallback.d.ts +12 -0
  178. package/lib/rtp/src/processor/source/rtcpCallback.js +33 -0
  179. package/lib/rtp/src/processor/source/rtcpCallback.js.map +1 -0
  180. package/lib/rtp/src/processor/source/rtpCallback.js +28 -12
  181. package/lib/rtp/src/processor/source/rtpCallback.js.map +1 -1
  182. package/lib/rtp/src/processor/source/rtpStream.js +38 -10
  183. package/lib/rtp/src/processor/source/rtpStream.js.map +1 -1
  184. package/lib/rtp/src/processor/webm.d.ts +11 -4
  185. package/lib/rtp/src/processor/webm.js +169 -46
  186. package/lib/rtp/src/processor/webm.js.map +1 -1
  187. package/lib/rtp/src/processor/webmCallback.d.ts +5 -3
  188. package/lib/rtp/src/processor/webmCallback.js +52 -8
  189. package/lib/rtp/src/processor/webmCallback.js.map +1 -1
  190. package/lib/rtp/src/processor/webmStream.d.ts +2 -2
  191. package/lib/rtp/src/processor/webmStream.js +24 -0
  192. package/lib/rtp/src/processor/webmStream.js.map +1 -1
  193. package/lib/rtp/src/processor_old/base.d.ts +18 -0
  194. package/lib/rtp/src/processor_old/base.js +51 -0
  195. package/lib/rtp/src/processor_old/base.js.map +1 -0
  196. package/lib/rtp/src/processor_old/lipsync.d.ts +30 -0
  197. package/lib/rtp/src/processor_old/lipsync.js +119 -0
  198. package/lib/rtp/src/processor_old/lipsync.js.map +1 -0
  199. package/lib/rtp/src/rtcp/header.js +30 -5
  200. package/lib/rtp/src/rtcp/header.js.map +1 -1
  201. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +1 -1
  202. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +30 -3
  203. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
  204. package/lib/rtp/src/rtcp/psfb/index.d.ts +1 -1
  205. package/lib/rtp/src/rtcp/psfb/index.js +18 -2
  206. package/lib/rtp/src/rtcp/psfb/index.js.map +1 -1
  207. package/lib/rtp/src/rtcp/psfb/pictureLossIndication.js +30 -3
  208. package/lib/rtp/src/rtcp/psfb/pictureLossIndication.js.map +1 -1
  209. package/lib/rtp/src/rtcp/psfb/remb.js +66 -5
  210. package/lib/rtp/src/rtcp/psfb/remb.js.map +1 -1
  211. package/lib/rtp/src/rtcp/rr.js +68 -4
  212. package/lib/rtp/src/rtcp/rr.js.map +1 -1
  213. package/lib/rtp/src/rtcp/rtcp.d.ts +1 -1
  214. package/lib/rtp/src/rtcp/rtpfb/index.d.ts +1 -1
  215. package/lib/rtp/src/rtcp/rtpfb/index.js +24 -2
  216. package/lib/rtp/src/rtcp/rtpfb/index.js.map +1 -1
  217. package/lib/rtp/src/rtcp/rtpfb/nack.d.ts +5 -0
  218. package/lib/rtp/src/rtcp/rtpfb/nack.js +43 -3
  219. package/lib/rtp/src/rtcp/rtpfb/nack.js.map +1 -1
  220. package/lib/rtp/src/rtcp/rtpfb/twcc.js +154 -11
  221. package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
  222. package/lib/rtp/src/rtcp/sdes.js +42 -4
  223. package/lib/rtp/src/rtcp/sdes.js.map +1 -1
  224. package/lib/rtp/src/rtcp/sr.js +56 -5
  225. package/lib/rtp/src/rtcp/sr.js.map +1 -1
  226. package/lib/rtp/src/rtp/red/encoder.js +18 -3
  227. package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
  228. package/lib/rtp/src/rtp/red/handler.js +12 -2
  229. package/lib/rtp/src/rtp/red/handler.js.map +1 -1
  230. package/lib/rtp/src/rtp/red/packet.js +18 -2
  231. package/lib/rtp/src/rtp/red/packet.js.map +1 -1
  232. package/lib/rtp/src/rtp/rtp.d.ts +3 -3
  233. package/lib/rtp/src/rtp/rtp.js +104 -17
  234. package/lib/rtp/src/rtp/rtp.js.map +1 -1
  235. package/lib/rtp/src/srtp/cipher/ctr.js +26 -10
  236. package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
  237. package/lib/rtp/src/srtp/cipher/gcm.d.ts +3 -0
  238. package/lib/rtp/src/srtp/cipher/gcm.js +40 -20
  239. package/lib/rtp/src/srtp/cipher/gcm.js.map +1 -1
  240. package/lib/rtp/src/srtp/cipher/index.js +24 -4
  241. package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
  242. package/lib/rtp/src/srtp/const.d.ts +1 -1
  243. package/lib/rtp/src/srtp/context/context.d.ts +1 -1
  244. package/lib/rtp/src/srtp/context/context.js +84 -5
  245. package/lib/rtp/src/srtp/context/context.js.map +1 -1
  246. package/lib/rtp/src/srtp/session.d.ts +2 -2
  247. package/lib/rtp/src/srtp/session.js +24 -1
  248. package/lib/rtp/src/srtp/session.js.map +1 -1
  249. package/lib/rtp/src/srtp/srtcp.js +15 -5
  250. package/lib/rtp/src/srtp/srtcp.js.map +1 -1
  251. package/lib/rtp/src/srtp/srtp.js +15 -5
  252. package/lib/rtp/src/srtp/srtp.js.map +1 -1
  253. package/lib/sctp/src/chunk.js +349 -69
  254. package/lib/sctp/src/chunk.js.map +1 -1
  255. package/lib/sctp/src/helper.d.ts +1 -1
  256. package/lib/sctp/src/param.d.ts +3 -3
  257. package/lib/sctp/src/param.js +66 -11
  258. package/lib/sctp/src/param.js.map +1 -1
  259. package/lib/sctp/src/sctp.d.ts +1 -1
  260. package/lib/sctp/src/sctp.js +479 -138
  261. package/lib/sctp/src/sctp.js.map +1 -1
  262. package/lib/sctp/src/transport.js +31 -10
  263. package/lib/sctp/src/transport.js.map +1 -1
  264. package/lib/webrtc/src/dataChannel.d.ts +1 -1
  265. package/lib/webrtc/src/dataChannel.js +145 -15
  266. package/lib/webrtc/src/dataChannel.js.map +1 -1
  267. package/lib/webrtc/src/helper.js +37 -12
  268. package/lib/webrtc/src/helper.js.map +1 -1
  269. package/lib/webrtc/src/media/parameters.d.ts +1 -1
  270. package/lib/webrtc/src/media/parameters.js +124 -3
  271. package/lib/webrtc/src/media/parameters.js.map +1 -1
  272. package/lib/webrtc/src/media/receiver/nack.d.ts +4 -4
  273. package/lib/webrtc/src/media/receiver/nack.js +85 -33
  274. package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
  275. package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +1 -1
  276. package/lib/webrtc/src/media/receiver/receiverTwcc.js +42 -6
  277. package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
  278. package/lib/webrtc/src/media/receiver/statistics.js +61 -5
  279. package/lib/webrtc/src/media/receiver/statistics.js.map +1 -1
  280. package/lib/webrtc/src/media/router.d.ts +1 -1
  281. package/lib/webrtc/src/media/router.js +108 -83
  282. package/lib/webrtc/src/media/router.js.map +1 -1
  283. package/lib/webrtc/src/media/rtpReceiver.js +188 -33
  284. package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
  285. package/lib/webrtc/src/media/rtpSender.js +279 -42
  286. package/lib/webrtc/src/media/rtpSender.js.map +1 -1
  287. package/lib/webrtc/src/media/rtpTransceiver.d.ts +2 -2
  288. package/lib/webrtc/src/media/rtpTransceiver.js +102 -18
  289. package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
  290. package/lib/webrtc/src/media/sender/cumulativeResult.js +36 -6
  291. package/lib/webrtc/src/media/sender/cumulativeResult.js.map +1 -1
  292. package/lib/webrtc/src/media/sender/senderBWE.js +57 -12
  293. package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
  294. package/lib/webrtc/src/media/track.js +135 -24
  295. package/lib/webrtc/src/media/track.js.map +1 -1
  296. package/lib/webrtc/src/nonstandard/recorder/index.d.ts +7 -4
  297. package/lib/webrtc/src/nonstandard/recorder/index.js +50 -6
  298. package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
  299. package/lib/webrtc/src/nonstandard/recorder/writer/index.js +12 -2
  300. package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
  301. package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +2 -2
  302. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +39 -35
  303. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
  304. package/lib/webrtc/src/nonstandard/userMedia.js +158 -56
  305. package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
  306. package/lib/webrtc/src/peerConnection.d.ts +2 -2
  307. package/lib/webrtc/src/peerConnection.js +260 -58
  308. package/lib/webrtc/src/peerConnection.js.map +1 -1
  309. package/lib/webrtc/src/sdp.js +287 -24
  310. package/lib/webrtc/src/sdp.js.map +1 -1
  311. package/lib/webrtc/src/transport/dtls.d.ts +3 -3
  312. package/lib/webrtc/src/transport/dtls.js +185 -30
  313. package/lib/webrtc/src/transport/dtls.js.map +1 -1
  314. package/lib/webrtc/src/transport/ice.d.ts +2 -2
  315. package/lib/webrtc/src/transport/ice.js +193 -25
  316. package/lib/webrtc/src/transport/ice.js.map +1 -1
  317. package/lib/webrtc/src/transport/sctp.js +193 -101
  318. package/lib/webrtc/src/transport/sctp.js.map +1 -1
  319. package/lib/webrtc/src/types/domain.d.ts +3 -3
  320. package/lib/webrtc/src/types/util.d.ts +2 -2
  321. package/lib/webrtc/src/utils.js +12 -2
  322. package/lib/webrtc/src/utils.js.map +1 -1
  323. package/package.json +15 -15
  324. package/src/dataChannel.ts +3 -1
  325. package/src/media/receiver/nack.ts +23 -19
  326. package/src/media/rtpReceiver.ts +5 -0
  327. package/src/media/rtpSender.ts +22 -19
  328. package/src/nonstandard/recorder/index.ts +12 -4
  329. package/src/nonstandard/recorder/writer/webm.ts +42 -50
  330. package/src/transport/dtls.ts +7 -3
  331. package/src/transport/ice.ts +6 -3
  332. package/src/transport/sctp.ts +3 -1
  333. package/lib/rtp/src/processor/avBuffer.d.ts +0 -36
  334. package/lib/rtp/src/processor/avBuffer.js +0 -107
  335. package/lib/rtp/src/processor/avBuffer.js.map +0 -1
  336. package/lib/rtp/src/processor/avBufferCallback.d.ts +0 -10
  337. package/lib/rtp/src/processor/avBufferCallback.js +0 -27
  338. package/lib/rtp/src/processor/avBufferCallback.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"srtp.js","sourceRoot":"","sources":["../../../../../rtp/src/srtp/srtp.ts"],"names":[],"mappings":";;;AACA,yCAA6C;AAC7C,uCAA4C;AAE5C,MAAa,WAAY,SAAQ,iBAAoB;IACnD,YAAmB,MAAc;QAC/B,KAAK,CAAC,kBAAW,CAAC,CAAC;QADF,WAAM,GAAN,MAAM,CAAQ;QAWjC,YAAO,GAAG,CAAC,GAAW,EAAE,EAAE;YACxB,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACvD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;QAZA,IAAI,CAAC,KAAK,CACR,MAAM,CAAC,IAAI,CAAC,cAAc,EAC1B,MAAM,CAAC,IAAI,CAAC,eAAe,EAC3B,MAAM,CAAC,IAAI,CAAC,eAAe,EAC3B,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAC5B,MAAM,CAAC,OAAO,CACf,CAAC;IACJ,CAAC;IAOD,OAAO,CAAC,OAAe,EAAE,MAAiB;QACxC,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CACF;AApBD,kCAoBC","sourcesContent":["import { RtpHeader } from \"../rtp/rtp\";\nimport { SrtpContext } from \"./context/srtp\";\nimport { Config, Session } from \"./session\";\n\nexport class SrtpSession extends Session<SrtpContext> {\n constructor(public config: Config) {\n super(SrtpContext);\n this.start(\n config.keys.localMasterKey,\n config.keys.localMasterSalt,\n config.keys.remoteMasterKey,\n config.keys.remoteMasterSalt,\n config.profile\n );\n }\n\n decrypt = (buf: Buffer) => {\n const [decrypted] = this.remoteContext.decryptRtp(buf);\n return decrypted;\n };\n\n encrypt(payload: Buffer, header: RtpHeader) {\n return this.localContext.encryptRtp(payload, header);\n }\n}\n"]}
1
+ {"version":3,"file":"srtp.js","sourceRoot":"","sources":["../../../../../rtp/src/srtp/srtp.ts"],"names":[],"mappings":";;;AACA,yCAA6C;AAC7C,uCAA4C;AAE5C,MAAa,WAAY,SAAQ,iBAAoB;IACnD,YAAmB,MAAc;QAC/B,KAAK,CAAC,kBAAW,CAAC,CAAC;;;;;mBADF;;QAWnB;;;;mBAAU,CAAC,GAAW,EAAE,EAAE;gBACxB,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBACvD,OAAO,SAAS,CAAC;YACnB,CAAC;WAAC;QAZA,IAAI,CAAC,KAAK,CACR,MAAM,CAAC,IAAI,CAAC,cAAc,EAC1B,MAAM,CAAC,IAAI,CAAC,eAAe,EAC3B,MAAM,CAAC,IAAI,CAAC,eAAe,EAC3B,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAC5B,MAAM,CAAC,OAAO,CACf,CAAC;IACJ,CAAC;IAOD,OAAO,CAAC,OAAe,EAAE,MAAiB;QACxC,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CACF;AApBD,kCAoBC","sourcesContent":["import { RtpHeader } from \"../rtp/rtp\";\nimport { SrtpContext } from \"./context/srtp\";\nimport { Config, Session } from \"./session\";\n\nexport class SrtpSession extends Session<SrtpContext> {\n constructor(public config: Config) {\n super(SrtpContext);\n this.start(\n config.keys.localMasterKey,\n config.keys.localMasterSalt,\n config.keys.remoteMasterKey,\n config.keys.remoteMasterSalt,\n config.profile\n );\n }\n\n decrypt = (buf: Buffer) => {\n const [decrypted] = this.remoteContext.decryptRtp(buf);\n return decrypted;\n };\n\n encrypt(payload: Buffer, header: RtpHeader) {\n return this.localContext.encryptRtp(payload, header);\n }\n}\n"]}
@@ -30,16 +30,26 @@ exports.serializePacket = exports.parsePacket = exports.decodeParams = exports.C
30
30
  const jspack_1 = require("jspack");
31
31
  const crc32c = require("turbo-crc32/crc32c");
32
32
  class Chunk {
33
- constructor(flags = 0, _body = Buffer.from("")) {
34
- this.flags = flags;
35
- this._body = _body;
36
- }
37
33
  get body() {
38
34
  return this._body;
39
35
  }
40
36
  set body(value) {
41
37
  this._body = value;
42
38
  }
39
+ constructor(flags = 0, _body = Buffer.from("")) {
40
+ Object.defineProperty(this, "flags", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: flags
45
+ });
46
+ Object.defineProperty(this, "_body", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: _body
51
+ });
52
+ }
43
53
  get type() {
44
54
  return Chunk.type;
45
55
  }
@@ -55,11 +65,57 @@ class Chunk {
55
65
  }
56
66
  }
57
67
  exports.Chunk = Chunk;
58
- Chunk.type = -1;
68
+ Object.defineProperty(Chunk, "type", {
69
+ enumerable: true,
70
+ configurable: true,
71
+ writable: true,
72
+ value: -1
73
+ });
59
74
  class BaseInitChunk extends Chunk {
60
75
  constructor(flags = 0, body) {
61
76
  super(flags, body);
62
- this.flags = flags;
77
+ Object.defineProperty(this, "flags", {
78
+ enumerable: true,
79
+ configurable: true,
80
+ writable: true,
81
+ value: flags
82
+ });
83
+ Object.defineProperty(this, "initiateTag", {
84
+ enumerable: true,
85
+ configurable: true,
86
+ writable: true,
87
+ value: void 0
88
+ });
89
+ Object.defineProperty(this, "advertisedRwnd", {
90
+ enumerable: true,
91
+ configurable: true,
92
+ writable: true,
93
+ value: void 0
94
+ });
95
+ Object.defineProperty(this, "outboundStreams", {
96
+ enumerable: true,
97
+ configurable: true,
98
+ writable: true,
99
+ value: void 0
100
+ });
101
+ Object.defineProperty(this, "inboundStreams", {
102
+ enumerable: true,
103
+ configurable: true,
104
+ writable: true,
105
+ value: void 0
106
+ });
107
+ Object.defineProperty(this, "initialTsn", {
108
+ enumerable: true,
109
+ configurable: true,
110
+ writable: true,
111
+ value: void 0
112
+ });
113
+ Object.defineProperty(this, "params", {
114
+ enumerable: true,
115
+ configurable: true,
116
+ writable: true,
117
+ value: void 0
118
+ });
63
119
  if (body) {
64
120
  [
65
121
  this.initiateTag,
@@ -98,26 +154,57 @@ class InitChunk extends BaseInitChunk {
98
154
  }
99
155
  }
100
156
  exports.InitChunk = InitChunk;
101
- InitChunk.type = 1;
157
+ Object.defineProperty(InitChunk, "type", {
158
+ enumerable: true,
159
+ configurable: true,
160
+ writable: true,
161
+ value: 1
162
+ });
102
163
  class InitAckChunk extends BaseInitChunk {
103
164
  get type() {
104
165
  return InitAckChunk.type;
105
166
  }
106
167
  }
107
168
  exports.InitAckChunk = InitAckChunk;
108
- InitAckChunk.type = 2;
169
+ Object.defineProperty(InitAckChunk, "type", {
170
+ enumerable: true,
171
+ configurable: true,
172
+ writable: true,
173
+ value: 2
174
+ });
109
175
  class ReConfigChunk extends BaseInitChunk {
110
176
  get type() {
111
177
  return ReConfigChunk.type;
112
178
  }
113
179
  }
114
180
  exports.ReConfigChunk = ReConfigChunk;
115
- ReConfigChunk.type = 130;
181
+ Object.defineProperty(ReConfigChunk, "type", {
182
+ enumerable: true,
183
+ configurable: true,
184
+ writable: true,
185
+ value: 130
186
+ });
116
187
  class ForwardTsnChunk extends Chunk {
117
188
  constructor(flags = 0, body) {
118
189
  super(flags, body);
119
- this.flags = flags;
120
- this.streams = [];
190
+ Object.defineProperty(this, "flags", {
191
+ enumerable: true,
192
+ configurable: true,
193
+ writable: true,
194
+ value: flags
195
+ });
196
+ Object.defineProperty(this, "streams", {
197
+ enumerable: true,
198
+ configurable: true,
199
+ writable: true,
200
+ value: []
201
+ });
202
+ Object.defineProperty(this, "cumulativeTsn", {
203
+ enumerable: true,
204
+ configurable: true,
205
+ writable: true,
206
+ value: void 0
207
+ });
121
208
  if (body) {
122
209
  this.cumulativeTsn = jspack_1.jspack.Unpack("!L", body)[0];
123
210
  let pos = 4;
@@ -143,31 +230,114 @@ class ForwardTsnChunk extends Chunk {
143
230
  }
144
231
  }
145
232
  exports.ForwardTsnChunk = ForwardTsnChunk;
146
- ForwardTsnChunk.type = 192;
233
+ Object.defineProperty(ForwardTsnChunk, "type", {
234
+ enumerable: true,
235
+ configurable: true,
236
+ writable: true,
237
+ value: 192
238
+ });
147
239
  class DataChunk extends Chunk {
240
+ get type() {
241
+ return DataChunk.type;
242
+ }
148
243
  constructor(flags = 0, body) {
149
244
  super(flags, body);
150
- this.flags = flags;
151
- this.tsn = 0;
152
- this.streamId = 0;
153
- this.streamSeqNum = 0;
154
- this.protocol = 0;
155
- this.userData = Buffer.from("");
156
- this.abandoned = false;
157
- this.acked = false;
158
- this.misses = 0;
159
- this.retransmit = false;
160
- this.sentCount = 0;
161
- this.bookSize = 0;
245
+ Object.defineProperty(this, "flags", {
246
+ enumerable: true,
247
+ configurable: true,
248
+ writable: true,
249
+ value: flags
250
+ });
251
+ Object.defineProperty(this, "tsn", {
252
+ enumerable: true,
253
+ configurable: true,
254
+ writable: true,
255
+ value: 0
256
+ });
257
+ Object.defineProperty(this, "streamId", {
258
+ enumerable: true,
259
+ configurable: true,
260
+ writable: true,
261
+ value: 0
262
+ });
263
+ Object.defineProperty(this, "streamSeqNum", {
264
+ enumerable: true,
265
+ configurable: true,
266
+ writable: true,
267
+ value: 0
268
+ });
269
+ Object.defineProperty(this, "protocol", {
270
+ enumerable: true,
271
+ configurable: true,
272
+ writable: true,
273
+ value: 0
274
+ });
275
+ Object.defineProperty(this, "userData", {
276
+ enumerable: true,
277
+ configurable: true,
278
+ writable: true,
279
+ value: Buffer.from("")
280
+ });
281
+ Object.defineProperty(this, "abandoned", {
282
+ enumerable: true,
283
+ configurable: true,
284
+ writable: true,
285
+ value: false
286
+ });
287
+ Object.defineProperty(this, "acked", {
288
+ enumerable: true,
289
+ configurable: true,
290
+ writable: true,
291
+ value: false
292
+ });
293
+ Object.defineProperty(this, "misses", {
294
+ enumerable: true,
295
+ configurable: true,
296
+ writable: true,
297
+ value: 0
298
+ });
299
+ Object.defineProperty(this, "retransmit", {
300
+ enumerable: true,
301
+ configurable: true,
302
+ writable: true,
303
+ value: false
304
+ });
305
+ Object.defineProperty(this, "sentCount", {
306
+ enumerable: true,
307
+ configurable: true,
308
+ writable: true,
309
+ value: 0
310
+ });
311
+ Object.defineProperty(this, "bookSize", {
312
+ enumerable: true,
313
+ configurable: true,
314
+ writable: true,
315
+ value: 0
316
+ });
317
+ Object.defineProperty(this, "expiry", {
318
+ enumerable: true,
319
+ configurable: true,
320
+ writable: true,
321
+ value: void 0
322
+ });
323
+ Object.defineProperty(this, "maxRetransmits", {
324
+ enumerable: true,
325
+ configurable: true,
326
+ writable: true,
327
+ value: void 0
328
+ });
329
+ Object.defineProperty(this, "sentTime", {
330
+ enumerable: true,
331
+ configurable: true,
332
+ writable: true,
333
+ value: void 0
334
+ });
162
335
  if (body) {
163
336
  [this.tsn, this.streamId, this.streamSeqNum, this.protocol] =
164
337
  jspack_1.jspack.Unpack("!LHHL", body);
165
338
  this.userData = body.slice(12);
166
339
  }
167
340
  }
168
- get type() {
169
- return DataChunk.type;
170
- }
171
341
  get bytes() {
172
342
  const length = 16 + this.userData.length;
173
343
  let data = Buffer.concat([
@@ -192,26 +362,51 @@ class DataChunk extends Chunk {
192
362
  }
193
363
  }
194
364
  exports.DataChunk = DataChunk;
195
- DataChunk.type = 0;
365
+ Object.defineProperty(DataChunk, "type", {
366
+ enumerable: true,
367
+ configurable: true,
368
+ writable: true,
369
+ value: 0
370
+ });
196
371
  class CookieEchoChunk extends Chunk {
197
372
  get type() {
198
373
  return CookieEchoChunk.type;
199
374
  }
200
375
  }
201
376
  exports.CookieEchoChunk = CookieEchoChunk;
202
- CookieEchoChunk.type = 10;
377
+ Object.defineProperty(CookieEchoChunk, "type", {
378
+ enumerable: true,
379
+ configurable: true,
380
+ writable: true,
381
+ value: 10
382
+ });
203
383
  class CookieAckChunk extends Chunk {
204
384
  get type() {
205
385
  return CookieAckChunk.type;
206
386
  }
207
387
  }
208
388
  exports.CookieAckChunk = CookieAckChunk;
209
- CookieAckChunk.type = 11;
389
+ Object.defineProperty(CookieAckChunk, "type", {
390
+ enumerable: true,
391
+ configurable: true,
392
+ writable: true,
393
+ value: 11
394
+ });
210
395
  class BaseParamsChunk extends Chunk {
211
396
  constructor(flags = 0, body = undefined) {
212
397
  super(flags, body);
213
- this.flags = flags;
214
- this.params = [];
398
+ Object.defineProperty(this, "flags", {
399
+ enumerable: true,
400
+ configurable: true,
401
+ writable: true,
402
+ value: flags
403
+ });
404
+ Object.defineProperty(this, "params", {
405
+ enumerable: true,
406
+ configurable: true,
407
+ writable: true,
408
+ value: []
409
+ });
215
410
  if (body) {
216
411
  this.params = decodeParams(body);
217
412
  }
@@ -227,7 +422,12 @@ class AbortChunk extends BaseParamsChunk {
227
422
  }
228
423
  }
229
424
  exports.AbortChunk = AbortChunk;
230
- AbortChunk.type = 6;
425
+ Object.defineProperty(AbortChunk, "type", {
426
+ enumerable: true,
427
+ configurable: true,
428
+ writable: true,
429
+ value: 6
430
+ });
231
431
  class ErrorChunk extends BaseParamsChunk {
232
432
  get type() {
233
433
  return ErrorChunk.type;
@@ -240,36 +440,56 @@ class ErrorChunk extends BaseParamsChunk {
240
440
  }
241
441
  }
242
442
  exports.ErrorChunk = ErrorChunk;
243
- ErrorChunk.type = 9;
244
- ErrorChunk.CODE = {
245
- InvalidStreamIdentifier: 1,
246
- MissingMandatoryParameter: 2,
247
- StaleCookieError: 3,
248
- OutofResource: 4,
249
- UnresolvableAddress: 5,
250
- UnrecognizedChunkType: 6,
251
- InvalidMandatoryParameter: 7,
252
- UnrecognizedParameters: 8,
253
- NoUserData: 9,
254
- CookieReceivedWhileShuttingDown: 10,
255
- RestartofanAssociationwithNewAddresses: 11,
256
- UserInitiatedAbort: 12,
257
- ProtocolViolation: 13,
258
- };
443
+ Object.defineProperty(ErrorChunk, "type", {
444
+ enumerable: true,
445
+ configurable: true,
446
+ writable: true,
447
+ value: 9
448
+ });
449
+ Object.defineProperty(ErrorChunk, "CODE", {
450
+ enumerable: true,
451
+ configurable: true,
452
+ writable: true,
453
+ value: {
454
+ InvalidStreamIdentifier: 1,
455
+ MissingMandatoryParameter: 2,
456
+ StaleCookieError: 3,
457
+ OutofResource: 4,
458
+ UnresolvableAddress: 5,
459
+ UnrecognizedChunkType: 6,
460
+ InvalidMandatoryParameter: 7,
461
+ UnrecognizedParameters: 8,
462
+ NoUserData: 9,
463
+ CookieReceivedWhileShuttingDown: 10,
464
+ RestartofanAssociationwithNewAddresses: 11,
465
+ UserInitiatedAbort: 12,
466
+ ProtocolViolation: 13,
467
+ }
468
+ });
259
469
  class HeartbeatChunk extends BaseParamsChunk {
260
470
  get type() {
261
471
  return HeartbeatChunk.type;
262
472
  }
263
473
  }
264
474
  exports.HeartbeatChunk = HeartbeatChunk;
265
- HeartbeatChunk.type = 4;
475
+ Object.defineProperty(HeartbeatChunk, "type", {
476
+ enumerable: true,
477
+ configurable: true,
478
+ writable: true,
479
+ value: 4
480
+ });
266
481
  class HeartbeatAckChunk extends BaseParamsChunk {
267
482
  get type() {
268
483
  return HeartbeatAckChunk.type;
269
484
  }
270
485
  }
271
486
  exports.HeartbeatAckChunk = HeartbeatAckChunk;
272
- HeartbeatAckChunk.type = 5;
487
+ Object.defineProperty(HeartbeatAckChunk, "type", {
488
+ enumerable: true,
489
+ configurable: true,
490
+ writable: true,
491
+ value: 5
492
+ });
273
493
  // https://tools.ietf.org/html/rfc6525#section-3.1
274
494
  // chunkReconfig represents an SCTP Chunk used to reconfigure streams.
275
495
  //
@@ -292,15 +512,48 @@ class ReconfigChunk extends BaseParamsChunk {
292
512
  }
293
513
  }
294
514
  exports.ReconfigChunk = ReconfigChunk;
295
- ReconfigChunk.type = 130;
515
+ Object.defineProperty(ReconfigChunk, "type", {
516
+ enumerable: true,
517
+ configurable: true,
518
+ writable: true,
519
+ value: 130
520
+ });
296
521
  class SackChunk extends Chunk {
522
+ get type() {
523
+ return SackChunk.type;
524
+ }
297
525
  constructor(flags = 0, body) {
298
526
  super(flags, body);
299
- this.flags = flags;
300
- this.gaps = [];
301
- this.duplicates = [];
302
- this.cumulativeTsn = 0;
303
- this.advertisedRwnd = 0;
527
+ Object.defineProperty(this, "flags", {
528
+ enumerable: true,
529
+ configurable: true,
530
+ writable: true,
531
+ value: flags
532
+ });
533
+ Object.defineProperty(this, "gaps", {
534
+ enumerable: true,
535
+ configurable: true,
536
+ writable: true,
537
+ value: []
538
+ });
539
+ Object.defineProperty(this, "duplicates", {
540
+ enumerable: true,
541
+ configurable: true,
542
+ writable: true,
543
+ value: []
544
+ });
545
+ Object.defineProperty(this, "cumulativeTsn", {
546
+ enumerable: true,
547
+ configurable: true,
548
+ writable: true,
549
+ value: 0
550
+ });
551
+ Object.defineProperty(this, "advertisedRwnd", {
552
+ enumerable: true,
553
+ configurable: true,
554
+ writable: true,
555
+ value: 0
556
+ });
304
557
  if (body) {
305
558
  const [cumulativeTsn, advertisedRwnd, nbGaps, nbDuplicates] = jspack_1.jspack.Unpack("!LLHH", body);
306
559
  this.cumulativeTsn = cumulativeTsn;
@@ -316,9 +569,6 @@ class SackChunk extends Chunk {
316
569
  });
317
570
  }
318
571
  }
319
- get type() {
320
- return SackChunk.type;
321
- }
322
572
  get bytes() {
323
573
  const length = 16 + 4 * (this.gaps.length + this.duplicates.length);
324
574
  let data = Buffer.from(jspack_1.jspack.Pack("!BBHLLHH", [
@@ -342,39 +592,69 @@ class SackChunk extends Chunk {
342
592
  }
343
593
  }
344
594
  exports.SackChunk = SackChunk;
345
- SackChunk.type = 3;
595
+ Object.defineProperty(SackChunk, "type", {
596
+ enumerable: true,
597
+ configurable: true,
598
+ writable: true,
599
+ value: 3
600
+ });
346
601
  class ShutdownChunk extends Chunk {
602
+ get type() {
603
+ return ShutdownChunk.type;
604
+ }
347
605
  constructor(flags = 0, body) {
348
606
  super(flags, body);
349
- this.flags = flags;
350
- this.cumulativeTsn = 0;
607
+ Object.defineProperty(this, "flags", {
608
+ enumerable: true,
609
+ configurable: true,
610
+ writable: true,
611
+ value: flags
612
+ });
613
+ Object.defineProperty(this, "cumulativeTsn", {
614
+ enumerable: true,
615
+ configurable: true,
616
+ writable: true,
617
+ value: 0
618
+ });
351
619
  if (body) {
352
620
  this.cumulativeTsn = jspack_1.jspack.Unpack("!L", body)[0];
353
621
  }
354
622
  }
355
- get type() {
356
- return ShutdownChunk.type;
357
- }
358
623
  get body() {
359
624
  return Buffer.from(jspack_1.jspack.Pack("!L", [this.cumulativeTsn]));
360
625
  }
361
626
  }
362
627
  exports.ShutdownChunk = ShutdownChunk;
363
- ShutdownChunk.type = 7;
628
+ Object.defineProperty(ShutdownChunk, "type", {
629
+ enumerable: true,
630
+ configurable: true,
631
+ writable: true,
632
+ value: 7
633
+ });
364
634
  class ShutdownAckChunk extends Chunk {
365
635
  get type() {
366
636
  return ShutdownAckChunk.type;
367
637
  }
368
638
  }
369
639
  exports.ShutdownAckChunk = ShutdownAckChunk;
370
- ShutdownAckChunk.type = 8;
640
+ Object.defineProperty(ShutdownAckChunk, "type", {
641
+ enumerable: true,
642
+ configurable: true,
643
+ writable: true,
644
+ value: 8
645
+ });
371
646
  class ShutdownCompleteChunk extends Chunk {
372
647
  get type() {
373
648
  return ShutdownCompleteChunk.type;
374
649
  }
375
650
  }
376
651
  exports.ShutdownCompleteChunk = ShutdownCompleteChunk;
377
- ShutdownCompleteChunk.type = 14;
652
+ Object.defineProperty(ShutdownCompleteChunk, "type", {
653
+ enumerable: true,
654
+ configurable: true,
655
+ writable: true,
656
+ value: 14
657
+ });
378
658
  const CHUNK_CLASSES = [
379
659
  DataChunk,
380
660
  InitChunk,