werift 0.19.4 → 0.19.5

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 (367) hide show
  1. package/lib/common/src/binary.d.ts +0 -1
  2. package/lib/common/src/binary.js +14 -14
  3. package/lib/common/src/binary.js.map +1 -1
  4. package/lib/common/src/network.d.ts +1 -2
  5. package/lib/common/src/network.js +4 -4
  6. package/lib/common/src/network.js.map +1 -1
  7. package/lib/common/src/number.js +10 -10
  8. package/lib/common/src/number.js.map +1 -1
  9. package/lib/dtls/src/cipher/create.d.ts +1 -1
  10. package/lib/dtls/src/cipher/create.js +2 -3
  11. package/lib/dtls/src/cipher/create.js.map +1 -1
  12. package/lib/dtls/src/cipher/ec.d.ts +0 -1
  13. package/lib/dtls/src/cipher/key-exchange.js +7 -7
  14. package/lib/dtls/src/cipher/key-exchange.js.map +1 -1
  15. package/lib/dtls/src/cipher/namedCurve.d.ts +1 -2
  16. package/lib/dtls/src/cipher/namedCurve.js +1 -2
  17. package/lib/dtls/src/cipher/namedCurve.js.map +1 -1
  18. package/lib/dtls/src/cipher/prf.d.ts +1 -2
  19. package/lib/dtls/src/cipher/prf.js +11 -12
  20. package/lib/dtls/src/cipher/prf.js.map +1 -1
  21. package/lib/dtls/src/cipher/suites/abstract.d.ts +1 -2
  22. package/lib/dtls/src/cipher/suites/abstract.js.map +1 -1
  23. package/lib/dtls/src/cipher/suites/aead.d.ts +1 -2
  24. package/lib/dtls/src/cipher/suites/aead.js.map +1 -1
  25. package/lib/dtls/src/client.d.ts +1 -1
  26. package/lib/dtls/src/client.js.map +1 -1
  27. package/lib/dtls/src/context/cipher.d.ts +6 -7
  28. package/lib/dtls/src/context/cipher.js +5 -3
  29. package/lib/dtls/src/context/cipher.js.map +1 -1
  30. package/lib/dtls/src/context/dtls.d.ts +5 -6
  31. package/lib/dtls/src/context/dtls.js +1 -2
  32. package/lib/dtls/src/context/dtls.js.map +1 -1
  33. package/lib/dtls/src/context/transport.d.ts +1 -2
  34. package/lib/dtls/src/context/transport.js.map +1 -1
  35. package/lib/dtls/src/flight/client/flight1.d.ts +4 -4
  36. package/lib/dtls/src/flight/client/flight1.js.map +1 -1
  37. package/lib/dtls/src/flight/client/flight3.d.ts +3 -3
  38. package/lib/dtls/src/flight/client/flight3.js.map +1 -1
  39. package/lib/dtls/src/flight/client/flight5.d.ts +4 -4
  40. package/lib/dtls/src/flight/client/flight5.js.map +1 -1
  41. package/lib/dtls/src/flight/flight.d.ts +3 -4
  42. package/lib/dtls/src/flight/flight.js.map +1 -1
  43. package/lib/dtls/src/flight/server/flight2.d.ts +4 -4
  44. package/lib/dtls/src/flight/server/flight2.js.map +1 -1
  45. package/lib/dtls/src/flight/server/flight4.d.ts +5 -5
  46. package/lib/dtls/src/flight/server/flight4.js.map +1 -1
  47. package/lib/dtls/src/flight/server/flight6.d.ts +4 -4
  48. package/lib/dtls/src/flight/server/flight6.js.map +1 -1
  49. package/lib/dtls/src/handshake/extensions/ellipticCurves.d.ts +1 -2
  50. package/lib/dtls/src/handshake/extensions/ellipticCurves.js.map +1 -1
  51. package/lib/dtls/src/handshake/extensions/renegotiationIndication.d.ts +0 -1
  52. package/lib/dtls/src/handshake/extensions/signature.d.ts +1 -2
  53. package/lib/dtls/src/handshake/extensions/signature.js.map +1 -1
  54. package/lib/dtls/src/handshake/extensions/useSrtp.d.ts +1 -2
  55. package/lib/dtls/src/handshake/extensions/useSrtp.js.map +1 -1
  56. package/lib/dtls/src/handshake/message/alert.d.ts +0 -1
  57. package/lib/dtls/src/handshake/message/alert.js.map +1 -1
  58. package/lib/dtls/src/handshake/message/certificate.d.ts +1 -2
  59. package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
  60. package/lib/dtls/src/handshake/message/changeCipherSpec.d.ts +0 -1
  61. package/lib/dtls/src/handshake/message/client/certificateVerify.d.ts +2 -3
  62. package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
  63. package/lib/dtls/src/handshake/message/client/hello.d.ts +1 -2
  64. package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
  65. package/lib/dtls/src/handshake/message/client/keyExchange.d.ts +1 -2
  66. package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
  67. package/lib/dtls/src/handshake/message/finished.d.ts +1 -2
  68. package/lib/dtls/src/handshake/message/finished.js.map +1 -1
  69. package/lib/dtls/src/handshake/message/server/certificateRequest.d.ts +2 -3
  70. package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
  71. package/lib/dtls/src/handshake/message/server/hello.d.ts +2 -3
  72. package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
  73. package/lib/dtls/src/handshake/message/server/helloDone.d.ts +1 -2
  74. package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
  75. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.d.ts +1 -2
  76. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
  77. package/lib/dtls/src/handshake/message/server/keyExchange.d.ts +2 -3
  78. package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
  79. package/lib/dtls/src/handshake/random.d.ts +0 -1
  80. package/lib/dtls/src/helper.d.ts +0 -1
  81. package/lib/dtls/src/helper.js +3 -3
  82. package/lib/dtls/src/helper.js.map +1 -1
  83. package/lib/dtls/src/record/builder.d.ts +2 -3
  84. package/lib/dtls/src/record/builder.js +2 -4
  85. package/lib/dtls/src/record/builder.js.map +1 -1
  86. package/lib/dtls/src/record/message/fragment.d.ts +1 -2
  87. package/lib/dtls/src/record/message/fragment.js.map +1 -1
  88. package/lib/dtls/src/record/message/header.d.ts +0 -1
  89. package/lib/dtls/src/record/message/plaintext.d.ts +0 -1
  90. package/lib/dtls/src/record/receive.d.ts +2 -3
  91. package/lib/dtls/src/record/receive.js.map +1 -1
  92. package/lib/dtls/src/server.d.ts +1 -1
  93. package/lib/dtls/src/server.js.map +1 -1
  94. package/lib/dtls/src/socket.d.ts +5 -6
  95. package/lib/dtls/src/socket.js +17 -23
  96. package/lib/dtls/src/socket.js.map +1 -1
  97. package/lib/dtls/src/transport.d.ts +1 -3
  98. package/lib/dtls/src/transport.js.map +1 -1
  99. package/lib/dtls/src/typings/domain.d.ts +2 -3
  100. package/lib/dtls/src/typings/domain.js.map +1 -1
  101. package/lib/dtls/src/util/binary.d.ts +0 -1
  102. package/lib/dtls/src/util/binary.js +1 -2
  103. package/lib/dtls/src/util/binary.js.map +1 -1
  104. package/lib/ice/src/candidate.js +3 -3
  105. package/lib/ice/src/candidate.js.map +1 -1
  106. package/lib/ice/src/dns/lookup.d.ts +1 -1
  107. package/lib/ice/src/dns/lookup.js +1 -0
  108. package/lib/ice/src/dns/lookup.js.map +1 -1
  109. package/lib/ice/src/exceptions.js.map +1 -1
  110. package/lib/ice/src/helper.d.ts +0 -1
  111. package/lib/ice/src/helper.js +5 -5
  112. package/lib/ice/src/helper.js.map +1 -1
  113. package/lib/ice/src/ice.d.ts +3 -2
  114. package/lib/ice/src/ice.js +25 -16
  115. package/lib/ice/src/ice.js.map +1 -1
  116. package/lib/ice/src/stun/attributes.d.ts +0 -1
  117. package/lib/ice/src/stun/attributes.js +5 -5
  118. package/lib/ice/src/stun/attributes.js.map +1 -1
  119. package/lib/ice/src/stun/message.d.ts +0 -1
  120. package/lib/ice/src/stun/message.js +2 -2
  121. package/lib/ice/src/stun/message.js.map +1 -1
  122. package/lib/ice/src/stun/protocol.d.ts +0 -1
  123. package/lib/ice/src/stun/transaction.d.ts +1 -1
  124. package/lib/ice/src/transport.d.ts +1 -4
  125. package/lib/ice/src/turn/protocol.d.ts +1 -2
  126. package/lib/ice/src/turn/protocol.js +5 -4
  127. package/lib/ice/src/turn/protocol.js.map +1 -1
  128. package/lib/ice/src/types/model.d.ts +0 -1
  129. package/lib/ice/src/utils.js +3 -4
  130. package/lib/ice/src/utils.js.map +1 -1
  131. package/lib/rtp/src/codec/av1.d.ts +1 -2
  132. package/lib/rtp/src/codec/av1.js +2 -2
  133. package/lib/rtp/src/codec/av1.js.map +1 -1
  134. package/lib/rtp/src/codec/base.d.ts +1 -2
  135. package/lib/rtp/src/codec/base.js.map +1 -1
  136. package/lib/rtp/src/codec/h264.d.ts +2 -3
  137. package/lib/rtp/src/codec/h264.js.map +1 -1
  138. package/lib/rtp/src/codec/index.d.ts +1 -2
  139. package/lib/rtp/src/codec/index.js +2 -2
  140. package/lib/rtp/src/codec/index.js.map +1 -1
  141. package/lib/rtp/src/codec/opus.d.ts +2 -3
  142. package/lib/rtp/src/codec/opus.js.map +1 -1
  143. package/lib/rtp/src/codec/vp8.d.ts +2 -3
  144. package/lib/rtp/src/codec/vp8.js +1 -1
  145. package/lib/rtp/src/codec/vp8.js.map +1 -1
  146. package/lib/rtp/src/codec/vp9.d.ts +2 -3
  147. package/lib/rtp/src/codec/vp9.js +1 -1
  148. package/lib/rtp/src/codec/vp9.js.map +1 -1
  149. package/lib/rtp/src/extra/container/mp4/h264.d.ts +0 -1
  150. package/lib/rtp/src/extra/container/mp4/h264.js +2 -2
  151. package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
  152. package/lib/rtp/src/extra/container/mp4/mp4box.d.ts +1 -1
  153. package/lib/rtp/src/extra/container/mp4/mp4box.js +3 -3
  154. package/lib/rtp/src/extra/container/mp4/mp4box.js.map +1 -1
  155. package/lib/rtp/src/extra/container/ogg/parser.d.ts +0 -1
  156. package/lib/rtp/src/extra/container/webm/container.d.ts +0 -1
  157. package/lib/rtp/src/extra/container/webm/container.js +2 -3
  158. package/lib/rtp/src/extra/container/webm/container.js.map +1 -1
  159. package/lib/rtp/src/extra/container/webm/ebml/typedArrayUtils.js +2 -2
  160. package/lib/rtp/src/extra/container/webm/ebml/typedArrayUtils.js.map +1 -1
  161. package/lib/rtp/src/extra/processor/depacketizer.d.ts +2 -3
  162. package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
  163. package/lib/rtp/src/extra/processor/depacketizerCallback.d.ts +1 -1
  164. package/lib/rtp/src/extra/processor/depacketizerCallback.js.map +1 -1
  165. package/lib/rtp/src/extra/processor/depacketizerTransformer.d.ts +2 -3
  166. package/lib/rtp/src/extra/processor/depacketizerTransformer.js.map +1 -1
  167. package/lib/rtp/src/extra/processor/dtx.d.ts +2 -3
  168. package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
  169. package/lib/rtp/src/extra/processor/dtxCallback.js.map +1 -1
  170. package/lib/rtp/src/extra/processor/interface.d.ts +2 -2
  171. package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +2 -2
  172. package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
  173. package/lib/rtp/src/extra/processor/jitterBufferCallback.d.ts +1 -1
  174. package/lib/rtp/src/extra/processor/jitterBufferCallback.js.map +1 -1
  175. package/lib/rtp/src/extra/processor/jitterBufferTransformer.d.ts +1 -2
  176. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
  177. package/lib/rtp/src/extra/processor/lipsync.d.ts +3 -4
  178. package/lib/rtp/src/extra/processor/lipsync.js +2 -2
  179. package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
  180. package/lib/rtp/src/extra/processor/lipsyncCallback.d.ts +1 -1
  181. package/lib/rtp/src/extra/processor/lipsyncCallback.js.map +1 -1
  182. package/lib/rtp/src/extra/processor/mp4.d.ts +2 -3
  183. package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
  184. package/lib/rtp/src/extra/processor/mp4Callback.d.ts +2 -2
  185. package/lib/rtp/src/extra/processor/mp4Callback.js.map +1 -1
  186. package/lib/rtp/src/extra/processor/mute.d.ts +2 -3
  187. package/lib/rtp/src/extra/processor/mute.js.map +1 -1
  188. package/lib/rtp/src/extra/processor/muteCallback.d.ts +2 -2
  189. package/lib/rtp/src/extra/processor/muteCallback.js.map +1 -1
  190. package/lib/rtp/src/extra/processor/nack.d.ts +2 -2
  191. package/lib/rtp/src/extra/processor/nack.js.map +1 -1
  192. package/lib/rtp/src/extra/processor/nackHandlerCallback.js.map +1 -1
  193. package/lib/rtp/src/extra/processor/ntpTime.d.ts +2 -2
  194. package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
  195. package/lib/rtp/src/extra/processor/ntpTimeCallback.d.ts +1 -1
  196. package/lib/rtp/src/extra/processor/ntpTimeCallback.js.map +1 -1
  197. package/lib/rtp/src/extra/processor/rtcpCallback.d.ts +2 -2
  198. package/lib/rtp/src/extra/processor/rtcpCallback.js.map +1 -1
  199. package/lib/rtp/src/extra/processor/rtpCallback.d.ts +1 -2
  200. package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
  201. package/lib/rtp/src/extra/processor/rtpStream.d.ts +2 -4
  202. package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
  203. package/lib/rtp/src/extra/processor/rtpTime.d.ts +2 -2
  204. package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
  205. package/lib/rtp/src/extra/processor/rtpTimeCallback.d.ts +1 -1
  206. package/lib/rtp/src/extra/processor/rtpTimeCallback.js.map +1 -1
  207. package/lib/rtp/src/extra/processor/webm.d.ts +2 -3
  208. package/lib/rtp/src/extra/processor/webm.js +2 -2
  209. package/lib/rtp/src/extra/processor/webm.js.map +1 -1
  210. package/lib/rtp/src/extra/processor/webmCallback.d.ts +2 -2
  211. package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
  212. package/lib/rtp/src/extra/processor/webmStream.d.ts +2 -3
  213. package/lib/rtp/src/extra/processor/webmStream.js.map +1 -1
  214. package/lib/rtp/src/helper.d.ts +0 -1
  215. package/lib/rtp/src/helper.js +6 -6
  216. package/lib/rtp/src/helper.js.map +1 -1
  217. package/lib/rtp/src/index.d.ts +0 -1
  218. package/lib/rtp/src/rtcp/header.d.ts +0 -1
  219. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +0 -1
  220. package/lib/rtp/src/rtcp/psfb/index.d.ts +1 -2
  221. package/lib/rtp/src/rtcp/psfb/index.js.map +1 -1
  222. package/lib/rtp/src/rtcp/psfb/pictureLossIndication.d.ts +0 -1
  223. package/lib/rtp/src/rtcp/psfb/remb.d.ts +0 -1
  224. package/lib/rtp/src/rtcp/rr.d.ts +0 -1
  225. package/lib/rtp/src/rtcp/rtcp.d.ts +0 -1
  226. package/lib/rtp/src/rtcp/rtcp.js +2 -2
  227. package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
  228. package/lib/rtp/src/rtcp/rtpfb/index.d.ts +1 -2
  229. package/lib/rtp/src/rtcp/rtpfb/index.js.map +1 -1
  230. package/lib/rtp/src/rtcp/rtpfb/nack.d.ts +0 -1
  231. package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +0 -1
  232. package/lib/rtp/src/rtcp/rtpfb/twcc.js +1 -2
  233. package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
  234. package/lib/rtp/src/rtcp/sdes.d.ts +1 -2
  235. package/lib/rtp/src/rtcp/sdes.js.map +1 -1
  236. package/lib/rtp/src/rtcp/sr.d.ts +0 -1
  237. package/lib/rtp/src/rtp/headerExtension.d.ts +1 -2
  238. package/lib/rtp/src/rtp/headerExtension.js +12 -12
  239. package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
  240. package/lib/rtp/src/rtp/red/encoder.d.ts +0 -1
  241. package/lib/rtp/src/rtp/red/handler.d.ts +1 -1
  242. package/lib/rtp/src/rtp/red/handler.js.map +1 -1
  243. package/lib/rtp/src/rtp/red/packet.d.ts +0 -1
  244. package/lib/rtp/src/rtp/rtp.d.ts +0 -1
  245. package/lib/rtp/src/rtp/rtp.js.map +1 -1
  246. package/lib/rtp/src/rtp/rtx.js +2 -3
  247. package/lib/rtp/src/rtp/rtx.js.map +1 -1
  248. package/lib/rtp/src/srtp/cipher/ctr.d.ts +0 -1
  249. package/lib/rtp/src/srtp/cipher/gcm.d.ts +0 -1
  250. package/lib/rtp/src/srtp/cipher/index.d.ts +2 -3
  251. package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
  252. package/lib/rtp/src/srtp/context/context.d.ts +3 -5
  253. package/lib/rtp/src/srtp/context/context.js.map +1 -1
  254. package/lib/rtp/src/srtp/context/srtcp.d.ts +2 -3
  255. package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
  256. package/lib/rtp/src/srtp/context/srtp.d.ts +1 -2
  257. package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
  258. package/lib/rtp/src/srtp/session.d.ts +1 -2
  259. package/lib/rtp/src/srtp/session.js.map +1 -1
  260. package/lib/rtp/src/srtp/srtcp.d.ts +1 -2
  261. package/lib/rtp/src/srtp/srtcp.js.map +1 -1
  262. package/lib/rtp/src/srtp/srtp.d.ts +2 -3
  263. package/lib/rtp/src/srtp/srtp.js.map +1 -1
  264. package/lib/rtp/src/util.d.ts +0 -1
  265. package/lib/sctp/src/chunk.d.ts +0 -1
  266. package/lib/sctp/src/chunk.js +4 -4
  267. package/lib/sctp/src/chunk.js.map +1 -1
  268. package/lib/sctp/src/helper.js +2 -3
  269. package/lib/sctp/src/helper.js.map +1 -1
  270. package/lib/sctp/src/param.d.ts +0 -1
  271. package/lib/sctp/src/param.js.map +1 -1
  272. package/lib/sctp/src/sctp.d.ts +5 -6
  273. package/lib/sctp/src/sctp.js.map +1 -1
  274. package/lib/sctp/src/transport.d.ts +1 -3
  275. package/lib/sctp/src/transport.js.map +1 -1
  276. package/lib/webrtc/src/const.d.ts +1 -1
  277. package/lib/webrtc/src/const.js.map +1 -1
  278. package/lib/webrtc/src/dataChannel.d.ts +2 -3
  279. package/lib/webrtc/src/dataChannel.js.map +1 -1
  280. package/lib/webrtc/src/helper.d.ts +0 -1
  281. package/lib/webrtc/src/helper.js +3 -3
  282. package/lib/webrtc/src/helper.js.map +1 -1
  283. package/lib/webrtc/src/media/extension/rtcpFeedback.d.ts +1 -1
  284. package/lib/webrtc/src/media/extension/rtcpFeedback.js.map +1 -1
  285. package/lib/webrtc/src/media/extension/rtpExtension.js +7 -8
  286. package/lib/webrtc/src/media/extension/rtpExtension.js.map +1 -1
  287. package/lib/webrtc/src/media/parameters.d.ts +1 -1
  288. package/lib/webrtc/src/media/parameters.js.map +1 -1
  289. package/lib/webrtc/src/media/receiver/nack.d.ts +2 -2
  290. package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
  291. package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +1 -1
  292. package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
  293. package/lib/webrtc/src/media/receiver/statistics.d.ts +1 -1
  294. package/lib/webrtc/src/media/receiver/statistics.js.map +1 -1
  295. package/lib/webrtc/src/media/router.d.ts +4 -4
  296. package/lib/webrtc/src/media/router.js.map +1 -1
  297. package/lib/webrtc/src/media/rtpReceiver.d.ts +7 -7
  298. package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
  299. package/lib/webrtc/src/media/rtpSender.d.ts +5 -6
  300. package/lib/webrtc/src/media/rtpSender.js.map +1 -1
  301. package/lib/webrtc/src/media/rtpTransceiver.d.ts +6 -6
  302. package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
  303. package/lib/webrtc/src/media/sender/senderBWE.d.ts +1 -1
  304. package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
  305. package/lib/webrtc/src/media/track.d.ts +3 -4
  306. package/lib/webrtc/src/media/track.js.map +1 -1
  307. package/lib/webrtc/src/nonstandard/index.d.ts +1 -0
  308. package/lib/webrtc/src/nonstandard/index.js +1 -0
  309. package/lib/webrtc/src/nonstandard/index.js.map +1 -1
  310. package/lib/webrtc/src/nonstandard/navigator.d.ts +4 -2
  311. package/lib/webrtc/src/nonstandard/navigator.js +6 -0
  312. package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
  313. package/lib/webrtc/src/nonstandard/recorder/index.d.ts +23 -7
  314. package/lib/webrtc/src/nonstandard/recorder/index.js +30 -27
  315. package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
  316. package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +17 -5
  317. package/lib/webrtc/src/nonstandard/recorder/writer/index.js +3 -9
  318. package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
  319. package/lib/webrtc/src/nonstandard/recorder/writer/webm.d.ts +1 -1
  320. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +23 -12
  321. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
  322. package/lib/webrtc/src/nonstandard/userMedia.d.ts +4 -5
  323. package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
  324. package/lib/webrtc/src/peerConnection.d.ts +10 -10
  325. package/lib/webrtc/src/peerConnection.js +15 -21
  326. package/lib/webrtc/src/peerConnection.js.map +1 -1
  327. package/lib/webrtc/src/sdp.d.ts +4 -4
  328. package/lib/webrtc/src/sdp.js +21 -21
  329. package/lib/webrtc/src/sdp.js.map +1 -1
  330. package/lib/webrtc/src/transport/dtls.d.ts +8 -8
  331. package/lib/webrtc/src/transport/dtls.js +16 -3
  332. package/lib/webrtc/src/transport/dtls.js.map +1 -1
  333. package/lib/webrtc/src/transport/ice.d.ts +1 -1
  334. package/lib/webrtc/src/transport/ice.js +3 -3
  335. package/lib/webrtc/src/transport/ice.js.map +1 -1
  336. package/lib/webrtc/src/transport/sctp.d.ts +1 -2
  337. package/lib/webrtc/src/transport/sctp.js +1 -1
  338. package/lib/webrtc/src/transport/sctp.js.map +1 -1
  339. package/lib/webrtc/src/utils.d.ts +3 -4
  340. package/lib/webrtc/src/utils.js +11 -8
  341. package/lib/webrtc/src/utils.js.map +1 -1
  342. package/package.json +12 -8
  343. package/src/const.ts +1 -1
  344. package/src/dataChannel.ts +2 -2
  345. package/src/media/extension/rtcpFeedback.ts +1 -1
  346. package/src/media/parameters.ts +1 -1
  347. package/src/media/receiver/nack.ts +9 -6
  348. package/src/media/receiver/receiverTwcc.ts +3 -3
  349. package/src/media/receiver/statistics.ts +1 -1
  350. package/src/media/router.ts +45 -39
  351. package/src/media/rtpReceiver.ts +30 -19
  352. package/src/media/rtpSender.ts +84 -71
  353. package/src/media/rtpTransceiver.ts +6 -6
  354. package/src/media/sender/senderBWE.ts +1 -1
  355. package/src/media/track.ts +3 -3
  356. package/src/nonstandard/index.ts +1 -0
  357. package/src/nonstandard/navigator.ts +3 -1
  358. package/src/nonstandard/recorder/index.ts +47 -19
  359. package/src/nonstandard/recorder/writer/index.ts +7 -4
  360. package/src/nonstandard/recorder/writer/webm.ts +25 -14
  361. package/src/nonstandard/userMedia.ts +1 -1
  362. package/src/peerConnection.ts +43 -51
  363. package/src/sdp.ts +108 -94
  364. package/src/transport/dtls.ts +28 -14
  365. package/src/transport/ice.ts +1 -1
  366. package/src/transport/sctp.ts +75 -67
  367. package/src/utils.ts +7 -5
@@ -3,31 +3,39 @@ import Event from "rx.mini";
3
3
  import { setTimeout } from "timers/promises";
4
4
  import { v4 as uuid } from "uuid";
5
5
 
6
- import { PeerConfig, codecParametersFromString, usePLI, useTWCC } from "..";
6
+ import {
7
+ type PeerConfig,
8
+ codecParametersFromString,
9
+ usePLI,
10
+ useTWCC,
11
+ } from "..";
7
12
  import { int } from "../../../common/src";
8
13
  import {
9
14
  PictureLossIndication,
10
15
  RTP_EXTENSION_URI,
11
16
  Red,
12
17
  RedHandler,
13
- RtcpPacket,
18
+ type RtcpPacket,
14
19
  RtcpPayloadSpecificFeedback,
15
20
  RtcpReceiverInfo,
16
21
  RtcpRrPacket,
17
22
  RtcpSrPacket,
18
- RtpPacket,
19
- TransportWideCCPayload,
23
+ type RtpPacket,
24
+ type TransportWideCCPayload,
20
25
  unwrapRtx,
21
26
  } from "../../../rtp/src";
22
- import { RTCDtlsTransport } from "../transport/dtls";
23
- import { Kind } from "../types/domain";
27
+ import type { RTCDtlsTransport } from "../transport/dtls";
28
+ import type { Kind } from "../types/domain";
24
29
  import { compactNtp, timestampSeconds } from "../utils";
25
- import { RTCRtpCodecParameters, RTCRtpReceiveParameters } from "./parameters";
30
+ import type {
31
+ RTCRtpCodecParameters,
32
+ RTCRtpReceiveParameters,
33
+ } from "./parameters";
26
34
  import { NackHandler } from "./receiver/nack";
27
35
  import { ReceiverTWCC } from "./receiver/receiverTwcc";
28
36
  import { StreamStatistics } from "./receiver/statistics";
29
- import { Extensions } from "./router";
30
- import { MediaStreamTrack } from "./track";
37
+ import type { Extensions } from "./router";
38
+ import type { MediaStreamTrack } from "./track";
31
39
 
32
40
  const log = debug("werift:packages/webrtc/src/media/rtpReceiver.ts");
33
41
 
@@ -236,17 +244,20 @@ export class RTCRtpReceiver {
236
244
 
237
245
  handleRtcpPacket(packet: RtcpPacket) {
238
246
  switch (packet.type) {
239
- case RtcpSrPacket.type: {
240
- const sr = packet as RtcpSrPacket;
241
- this.lastSRtimestamp[sr.ssrc] = compactNtp(sr.senderInfo.ntpTimestamp);
242
- this.receiveLastSRTimestamp[sr.ssrc] = timestampSeconds();
243
-
244
- const track = this.trackBySSRC[packet.ssrc];
245
- if (track) {
246
- track.onReceiveRtcp.execute(packet);
247
+ case RtcpSrPacket.type:
248
+ {
249
+ const sr = packet as RtcpSrPacket;
250
+ this.lastSRtimestamp[sr.ssrc] = compactNtp(
251
+ sr.senderInfo.ntpTimestamp,
252
+ );
253
+ this.receiveLastSRTimestamp[sr.ssrc] = timestampSeconds();
254
+
255
+ const track = this.trackBySSRC[packet.ssrc];
256
+ if (track) {
257
+ track.onReceiveRtcp.execute(packet);
258
+ }
247
259
  }
248
- }
249
- break;
260
+ break;
250
261
  }
251
262
  this.onRtcp.execute(packet);
252
263
  }
@@ -30,20 +30,20 @@ import * as uuid from "uuid";
30
30
  import { codecParametersFromString } from "..";
31
31
  import { random16, uint16Add, uint32Add } from "../../../common/src";
32
32
  import {
33
- Extension,
33
+ type Extension,
34
34
  GenericNack,
35
35
  PictureLossIndication,
36
36
  RTP_EXTENSION_URI,
37
37
  ReceiverEstimatedMaxBitrate,
38
38
  RedEncoder,
39
- RtcpPacket,
39
+ type RtcpPacket,
40
40
  RtcpPayloadSpecificFeedback,
41
41
  RtcpRrPacket,
42
42
  RtcpSenderInfo,
43
43
  RtcpSourceDescriptionPacket,
44
44
  RtcpSrPacket,
45
45
  RtcpTransportLayerFeedback,
46
- RtpHeader,
46
+ type RtpHeader,
47
47
  RtpPacket,
48
48
  SourceDescriptionChunk,
49
49
  SourceDescriptionItem,
@@ -55,16 +55,16 @@ import {
55
55
  serializeTransportWideCC,
56
56
  wrapRtx,
57
57
  } from "../../../rtp/src";
58
- import { RTCDtlsTransport } from "../transport/dtls";
59
- import { Kind } from "../types/domain";
58
+ import type { RTCDtlsTransport } from "../transport/dtls";
59
+ import type { Kind } from "../types/domain";
60
60
  import { compactNtp, milliTime, ntpTime, timestampSeconds } from "../utils";
61
- import {
61
+ import type {
62
62
  RTCRtpCodecParameters,
63
63
  RTCRtpHeaderExtensionParameters,
64
64
  RTCRtpSendParameters,
65
65
  } from "./parameters";
66
- import { SenderBandwidthEstimator, SentInfo } from "./sender/senderBWE";
67
- import { MediaStreamTrack } from "./track";
66
+ import { SenderBandwidthEstimator, type SentInfo } from "./sender/senderBWE";
67
+ import type { MediaStreamTrack } from "./track";
68
68
 
69
69
  const log = debug("werift:packages/webrtc/src/media/rtpSender.ts");
70
70
 
@@ -410,77 +410,90 @@ export class RTCRtpSender {
410
410
  handleRtcpPacket(rtcpPacket: RtcpPacket) {
411
411
  switch (rtcpPacket.type) {
412
412
  case RtcpSrPacket.type:
413
- case RtcpRrPacket.type: {
414
- const packet = rtcpPacket as RtcpSrPacket | RtcpRrPacket;
415
- packet.reports
416
- .filter((report) => report.ssrc === this.ssrc)
417
- .forEach((report) => {
418
- if (this.lastSRtimestamp === report.lsr && report.dlsr) {
419
- if (this.lastSentSRTimestamp) {
420
- const rtt =
421
- timestampSeconds() -
422
- this.lastSentSRTimestamp -
423
- report.dlsr / 65536;
424
- if (this.rtt === undefined) {
425
- this.rtt = rtt;
426
- } else {
427
- this.rtt = RTT_ALPHA * this.rtt + (1 - RTT_ALPHA) * rtt;
413
+ case RtcpRrPacket.type:
414
+ {
415
+ const packet = rtcpPacket as RtcpSrPacket | RtcpRrPacket;
416
+ packet.reports
417
+ .filter((report) => report.ssrc === this.ssrc)
418
+ .forEach((report) => {
419
+ if (this.lastSRtimestamp === report.lsr && report.dlsr) {
420
+ if (this.lastSentSRTimestamp) {
421
+ const rtt =
422
+ timestampSeconds() -
423
+ this.lastSentSRTimestamp -
424
+ report.dlsr / 65536;
425
+ if (this.rtt === undefined) {
426
+ this.rtt = rtt;
427
+ } else {
428
+ this.rtt = RTT_ALPHA * this.rtt + (1 - RTT_ALPHA) * rtt;
429
+ }
428
430
  }
429
431
  }
430
- }
431
- });
432
- }
433
- break;
434
- case RtcpTransportLayerFeedback.type: {
435
- const packet = rtcpPacket as RtcpTransportLayerFeedback;
436
- switch (packet.feedback.count) {
437
- case TransportWideCC.count: {
438
- const feedback = packet.feedback as TransportWideCC;
439
- this.senderBWE.receiveTWCC(feedback);
440
- }
441
- break;
442
- case GenericNack.count: {
443
- const feedback = packet.feedback as GenericNack;
444
- feedback.lost.forEach(async (seqNum) => {
445
- let packet: RtpPacket | undefined =
446
- this.rtpCache[seqNum % RTP_HISTORY_SIZE];
447
- if (packet && packet.header.sequenceNumber !== seqNum) {
448
- packet = undefined;
432
+ });
433
+ }
434
+ break;
435
+ case RtcpTransportLayerFeedback.type:
436
+ {
437
+ const packet = rtcpPacket as RtcpTransportLayerFeedback;
438
+ switch (packet.feedback.count) {
439
+ case TransportWideCC.count:
440
+ {
441
+ const feedback = packet.feedback as TransportWideCC;
442
+ this.senderBWE.receiveTWCC(feedback);
449
443
  }
450
- if (packet) {
451
- if (this.rtxPayloadType != undefined) {
452
- packet = wrapRtx(
453
- packet,
454
- this.rtxPayloadType,
455
- this.rtxSequenceNumber,
456
- this.rtxSsrc,
457
- );
458
- this.rtxSequenceNumber = uint16Add(this.rtxSequenceNumber, 1);
459
- }
460
- await this.dtlsTransport.sendRtp(packet.payload, packet.header);
444
+ break;
445
+ case GenericNack.count:
446
+ {
447
+ const feedback = packet.feedback as GenericNack;
448
+ feedback.lost.forEach(async (seqNum) => {
449
+ let packet: RtpPacket | undefined =
450
+ this.rtpCache[seqNum % RTP_HISTORY_SIZE];
451
+ if (packet && packet.header.sequenceNumber !== seqNum) {
452
+ packet = undefined;
453
+ }
454
+ if (packet) {
455
+ if (this.rtxPayloadType != undefined) {
456
+ packet = wrapRtx(
457
+ packet,
458
+ this.rtxPayloadType,
459
+ this.rtxSequenceNumber,
460
+ this.rtxSsrc,
461
+ );
462
+ this.rtxSequenceNumber = uint16Add(
463
+ this.rtxSequenceNumber,
464
+ 1,
465
+ );
466
+ }
467
+ await this.dtlsTransport.sendRtp(
468
+ packet.payload,
469
+ packet.header,
470
+ );
471
+ }
472
+ });
473
+ this.onGenericNack.execute(feedback);
461
474
  }
462
- });
463
- this.onGenericNack.execute(feedback);
475
+ break;
464
476
  }
465
- break;
466
477
  }
467
- }
468
- break;
469
- case RtcpPayloadSpecificFeedback.type: {
470
- const packet = rtcpPacket as RtcpPayloadSpecificFeedback;
471
- switch (packet.feedback.count) {
472
- case ReceiverEstimatedMaxBitrate.count: {
473
- const feedback = packet.feedback as ReceiverEstimatedMaxBitrate;
474
- this.receiverEstimatedMaxBitrate = feedback.bitrate;
475
- }
476
- break;
477
- case PictureLossIndication.count: {
478
- this.onPictureLossIndication.execute();
478
+ break;
479
+ case RtcpPayloadSpecificFeedback.type:
480
+ {
481
+ const packet = rtcpPacket as RtcpPayloadSpecificFeedback;
482
+ switch (packet.feedback.count) {
483
+ case ReceiverEstimatedMaxBitrate.count:
484
+ {
485
+ const feedback = packet.feedback as ReceiverEstimatedMaxBitrate;
486
+ this.receiverEstimatedMaxBitrate = feedback.bitrate;
487
+ }
488
+ break;
489
+ case PictureLossIndication.count:
490
+ {
491
+ this.onPictureLossIndication.execute();
492
+ }
493
+ break;
479
494
  }
480
- break;
481
495
  }
482
- }
483
- break;
496
+ break;
484
497
  }
485
498
  this.onRtcp.execute(rtcpPacket);
486
499
  }
@@ -1,16 +1,16 @@
1
1
  import Event from "rx.mini";
2
2
  import * as uuid from "uuid";
3
3
 
4
- import { RTCDtlsTransport } from "..";
4
+ import type { RTCDtlsTransport } from "..";
5
5
  import { SenderDirections } from "../const";
6
- import { Kind } from "../types/domain";
7
- import {
6
+ import type { Kind } from "../types/domain";
7
+ import type {
8
8
  RTCRtpCodecParameters,
9
9
  RTCRtpHeaderExtensionParameters,
10
10
  } from "./parameters";
11
- import { RTCRtpReceiver } from "./rtpReceiver";
12
- import { RTCRtpSender } from "./rtpSender";
13
- import { MediaStreamTrack } from "./track";
11
+ import type { RTCRtpReceiver } from "./rtpReceiver";
12
+ import type { RTCRtpSender } from "./rtpSender";
13
+ import type { MediaStreamTrack } from "./track";
14
14
 
15
15
  export class RTCRtpTransceiver {
16
16
  readonly id = uuid.v4();
@@ -1,6 +1,6 @@
1
1
  import Event from "rx.mini";
2
2
 
3
- import { TransportWideCC } from "../../../../rtp/src";
3
+ import type { TransportWideCC } from "../../../../rtp/src";
4
4
  import { Int } from "../../../../rtp/src/helper";
5
5
  import { milliTime } from "../../utils";
6
6
  import { CumulativeResult } from "./cumulativeResult";
@@ -1,10 +1,10 @@
1
1
  import Event from "rx.mini";
2
2
  import { v4 } from "uuid";
3
3
 
4
- import { RtcpPacket, RtpHeader, RtpPacket } from "../../../rtp/src";
4
+ import { type RtcpPacket, type RtpHeader, RtpPacket } from "../../../rtp/src";
5
5
  import { EventTarget } from "../helper";
6
- import { Kind } from "../types/domain";
7
- import { RTCRtpCodecParameters } from "./parameters";
6
+ import type { Kind } from "../types/domain";
7
+ import type { RTCRtpCodecParameters } from "./parameters";
8
8
 
9
9
  export class MediaStreamTrack extends EventTarget {
10
10
  readonly uuid = v4();
@@ -1,3 +1,4 @@
1
1
  export * from "./recorder";
2
2
  export * from "./userMedia";
3
3
  export * from "./navigator";
4
+ export * from "../../../rtp/src/extra";
@@ -14,7 +14,9 @@ export class MediaDevices extends EventTarget {
14
14
  video?: MediaStreamTrack;
15
15
  audio?: MediaStreamTrack;
16
16
 
17
- constructor(props: { video?: MediaStreamTrack; audio?: MediaStreamTrack }) {
17
+ constructor(
18
+ readonly props: { video?: MediaStreamTrack; audio?: MediaStreamTrack },
19
+ ) {
18
20
  super();
19
21
  this.video = props.video;
20
22
  this.audio = props.audio;
@@ -1,37 +1,61 @@
1
1
  import Event from "rx.mini";
2
2
 
3
- import { MediaStreamTrack } from "../../media/track";
4
- import { MediaWriter } from "./writer";
3
+ import type { PassThrough } from "stream";
4
+ import type { MediaStreamTrack } from "../../media/track";
5
+ import type { MediaWriter } from "./writer";
5
6
  import { WebmFactory } from "./writer/webm";
6
7
 
7
8
  export class MediaRecorder {
8
9
  writer: MediaWriter;
9
- ext: string;
10
+ ext?: string;
10
11
  tracks: MediaStreamTrack[] = [];
11
12
  started = false;
12
13
  onError = new Event<[Error]>();
13
14
 
14
15
  constructor(
15
- public path: string,
16
- public numOfTracks = 1,
17
- public options: Partial<MediaRecorderOptions> = {},
16
+ public props: Partial<MediaRecorderOptions> & {
17
+ numOfTracks: number;
18
+ } & (
19
+ | {
20
+ path: string;
21
+ stream?: PassThrough;
22
+ }
23
+ | {
24
+ path?: string;
25
+ stream: PassThrough;
26
+ }
27
+ ),
18
28
  ) {
19
- this.ext = path.split(".").slice(-1)[0];
20
- this.writer = (() => {
21
- switch (this.ext) {
22
- case "webm":
23
- return new WebmFactory(path, options);
24
- default:
25
- throw new Error();
26
- }
27
- })();
28
-
29
- this.tracks = options.tracks ?? this.tracks;
30
- if (this.tracks.length === numOfTracks) {
29
+ this.tracks = props.tracks ?? this.tracks;
30
+ if (this.tracks.length === props.numOfTracks) {
31
31
  this.start().catch((error) => {
32
32
  this.onError.execute(error);
33
33
  });
34
34
  }
35
+
36
+ const { path, stream } = props;
37
+
38
+ if (path) {
39
+ this.ext = path.split(".").slice(-1)[0];
40
+ this.writer = (() => {
41
+ switch (this.ext) {
42
+ case "webm":
43
+ return new WebmFactory({
44
+ ...props,
45
+ path: path!,
46
+ stream: stream!,
47
+ });
48
+ default:
49
+ throw new Error();
50
+ }
51
+ })();
52
+ } else {
53
+ this.writer = new WebmFactory({
54
+ ...props,
55
+ path: path!,
56
+ stream: stream!,
57
+ });
58
+ }
35
59
  }
36
60
 
37
61
  async addTrack(track: MediaStreamTrack) {
@@ -40,7 +64,10 @@ export class MediaRecorder {
40
64
  }
41
65
 
42
66
  private async start() {
43
- if (this.tracks.length === this.numOfTracks && this.started === false) {
67
+ if (
68
+ this.tracks.length === this.props.numOfTracks &&
69
+ this.started === false
70
+ ) {
44
71
  this.started = true;
45
72
  await this.writer.start(this.tracks);
46
73
  }
@@ -59,4 +86,5 @@ export interface MediaRecorderOptions {
59
86
  waitForKeyframe: boolean;
60
87
  defaultDuration: number;
61
88
  tracks: MediaStreamTrack[];
89
+ disableNtp: boolean;
62
90
  }
@@ -1,10 +1,13 @@
1
- import { MediaRecorderOptions } from "..";
2
- import { MediaStreamTrack } from "../../..";
1
+ import type { PassThrough } from "stream";
2
+ import type { MediaRecorderOptions } from "..";
3
+ import type { MediaStreamTrack } from "../../..";
3
4
 
4
5
  export abstract class MediaWriter {
5
6
  constructor(
6
- protected path: string,
7
- protected options: Partial<MediaRecorderOptions>,
7
+ protected props: Partial<MediaRecorderOptions> & {
8
+ path: string;
9
+ stream?: PassThrough;
10
+ } & { path?: string; stream: PassThrough },
8
11
  ) {}
9
12
 
10
13
  async start(tracks: MediaStreamTrack[]) {}
@@ -2,7 +2,7 @@ import { unlink } from "fs/promises";
2
2
  import { EventDisposer } from "rx.mini";
3
3
 
4
4
  import { MediaWriter } from ".";
5
- import { MediaStreamTrack, WeriftError } from "../../..";
5
+ import { type MediaStreamTrack, WeriftError } from "../../..";
6
6
  import {
7
7
  DepacketizeCallback,
8
8
  JitterBufferCallback,
@@ -10,7 +10,8 @@ import {
10
10
  NtpTimeCallback,
11
11
  RtcpSourceCallback,
12
12
  RtpSourceCallback,
13
- SupportedCodec,
13
+ RtpTimeCallback,
14
+ type SupportedCodec,
14
15
  WebmCallback,
15
16
  saveToFileSystem,
16
17
  } from "../../../../../rtp/src/extra";
@@ -23,7 +24,9 @@ export class WebmFactory extends MediaWriter {
23
24
  unSubscribers = new EventDisposer();
24
25
 
25
26
  async start(tracks: MediaStreamTrack[]) {
26
- await unlink(this.path).catch((e) => e);
27
+ if (this.props.path) {
28
+ await unlink(this.props.path).catch((e) => e);
29
+ }
27
30
 
28
31
  const inputTracks = tracks.map((track, i) => {
29
32
  const trackNumber = i + 1;
@@ -52,8 +55,8 @@ export class WebmFactory extends MediaWriter {
52
55
  codec,
53
56
  clockRate: 90000,
54
57
  trackNumber,
55
- width: this.options.width,
56
- height: this.options.height,
58
+ width: this.props.width ?? 640,
59
+ height: this.props.height ?? 360,
57
60
  payloadType,
58
61
  track,
59
62
  };
@@ -70,7 +73,7 @@ export class WebmFactory extends MediaWriter {
70
73
  });
71
74
 
72
75
  const webm = new WebmCallback(inputTracks, {
73
- duration: this.options.defaultDuration ?? 1000 * 60 * 60 * 24,
76
+ duration: this.props.defaultDuration ?? 1000 * 60 * 60 * 24,
74
77
  });
75
78
  const lipsync = new LipsyncCallback();
76
79
 
@@ -87,7 +90,9 @@ export class WebmFactory extends MediaWriter {
87
90
  rtcpSource.input(rtcp);
88
91
  })
89
92
  .disposer(this.unSubscribers);
90
- const ntpTime = new NtpTimeCallback(clockRate);
93
+ const time = this.props.disableNtp
94
+ ? new RtpTimeCallback(clockRate)
95
+ : new NtpTimeCallback(clockRate);
91
96
 
92
97
  if (track.kind === "video") {
93
98
  const depacketizer = new DepacketizeCallback(codec, {
@@ -96,26 +101,32 @@ export class WebmFactory extends MediaWriter {
96
101
  const jitterBuffer = new JitterBufferCallback(clockRate);
97
102
 
98
103
  rtpSource.pipe(jitterBuffer.input);
99
- rtcpSource.pipe(ntpTime.input);
104
+ rtcpSource.pipe(time.input);
100
105
 
101
- jitterBuffer.pipe(ntpTime.input);
102
- ntpTime.pipe(depacketizer.input);
106
+ jitterBuffer.pipe(time.input);
107
+ time.pipe(depacketizer.input);
103
108
  depacketizer.pipe(lipsync.inputVideo);
104
109
  lipsync.pipeVideo(webm.inputVideo);
105
110
  } else {
106
111
  const depacketizer = new DepacketizeCallback(codec);
107
112
 
108
- rtpSource.pipe(ntpTime.input);
109
- rtcpSource.pipe(ntpTime.input);
113
+ rtpSource.pipe(time.input);
114
+ rtcpSource.pipe(time.input);
110
115
 
111
- ntpTime.pipe(depacketizer.input);
116
+ time.pipe(depacketizer.input);
112
117
  depacketizer.pipe(lipsync.inputAudio);
113
118
  lipsync.pipeAudio(webm.inputAudio);
114
119
  }
115
120
 
116
121
  return rtpSource;
117
122
  });
118
- webm.pipe(saveToFileSystem(this.path));
123
+ if (this.props.path) {
124
+ webm.pipe(saveToFileSystem(this.props.path));
125
+ } else if (this.props.stream) {
126
+ webm.pipe(async (o) => {
127
+ this.props.stream.write(o);
128
+ });
129
+ }
119
130
  }
120
131
 
121
132
  async stop() {
@@ -1,4 +1,4 @@
1
- import { ChildProcess, exec } from "child_process";
1
+ import { type ChildProcess, exec } from "child_process";
2
2
  import { createSocket } from "dgram";
3
3
  import { setImmediate } from "timers/promises";
4
4
  import { v4 } from "uuid";