mediasoup 3.26.0 → 3.27.1

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 (322) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/node/lib/DataConsumer.js +1 -1
  3. package/node/lib/Router.js +1 -1
  4. package/node/lib/Transport.js +15 -15
  5. package/node/lib/fbs/rtp-parameters/encoding-mapping.d.ts +2 -6
  6. package/node/lib/fbs/rtp-parameters/encoding-mapping.d.ts.map +1 -1
  7. package/node/lib/fbs/rtp-parameters/encoding-mapping.js +7 -19
  8. package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.d.ts +4 -4
  9. package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.js +2 -2
  10. package/node/lib/fbs/rtp-stream/bitrate-by-layer.d.ts +5 -5
  11. package/node/lib/fbs/rtp-stream/bitrate-by-layer.d.ts.map +1 -1
  12. package/node/lib/fbs/rtp-stream/bitrate-by-layer.js +3 -3
  13. package/node/lib/fbs/rtp-stream/recv-stats.d.ts +5 -5
  14. package/node/lib/fbs/rtp-stream/recv-stats.d.ts.map +1 -1
  15. package/node/lib/fbs/rtp-stream/recv-stats.js +3 -3
  16. package/node/lib/fbs/rtp-stream/send-stats.d.ts +5 -5
  17. package/node/lib/fbs/rtp-stream/send-stats.d.ts.map +1 -1
  18. package/node/lib/fbs/rtp-stream/send-stats.js +3 -3
  19. package/node/lib/fbs/transport/bwe-trace-info.d.ts +23 -23
  20. package/node/lib/fbs/transport/bwe-trace-info.d.ts.map +1 -1
  21. package/node/lib/fbs/transport/bwe-trace-info.js +15 -15
  22. package/node/lib/fbs/transport/options.d.ts +5 -5
  23. package/node/lib/fbs/transport/options.js +2 -2
  24. package/node/lib/fbs/transport/set-max-incoming-bitrate-request.d.ts +5 -5
  25. package/node/lib/fbs/transport/set-max-incoming-bitrate-request.d.ts.map +1 -1
  26. package/node/lib/fbs/transport/set-max-incoming-bitrate-request.js +3 -3
  27. package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.d.ts +5 -5
  28. package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.d.ts.map +1 -1
  29. package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.js +3 -3
  30. package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.d.ts +5 -5
  31. package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.d.ts.map +1 -1
  32. package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.js +3 -3
  33. package/node/lib/fbs/transport/stats.d.ts +38 -38
  34. package/node/lib/fbs/transport/stats.d.ts.map +1 -1
  35. package/node/lib/fbs/transport/stats.js +25 -25
  36. package/node/lib/ortc.d.ts +0 -1
  37. package/node/lib/ortc.d.ts.map +1 -1
  38. package/node/lib/ortc.js +1 -2
  39. package/node/lib/rtpParametersFbsUtils.d.ts.map +1 -1
  40. package/node/lib/rtpParametersFbsUtils.js +2 -2
  41. package/package.json +9 -9
  42. package/worker/deps/libwebrtc/libwebrtc/call/rtp_transport_controller_send.cc +10 -10
  43. package/worker/deps/libwebrtc/libwebrtc/mediasoup_helpers.h +6 -6
  44. package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/alr_detector.cc +1 -1
  45. package/worker/deps/libwebrtc/libwebrtc/modules/pacing/paced_sender.cc +7 -7
  46. package/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h +1 -1
  47. package/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +1 -1
  48. package/worker/fbs/FBS/meson.build +25 -0
  49. package/worker/fbs/meson.build +15 -18
  50. package/worker/fbs/rtpParameters.fbs +1 -2
  51. package/worker/fbs/rtpStream.fbs +3 -3
  52. package/worker/fbs/transport.fbs +23 -23
  53. package/worker/fuzzer/include/RTC/FuzzerDtlsTransport.hpp +4 -1
  54. package/worker/fuzzer/src/FuzzerUtils.cpp +5 -3
  55. package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +8 -5
  56. package/worker/fuzzer/src/RTC/FuzzerRateCalculator.cpp +3 -3
  57. package/worker/fuzzer/src/RTC/FuzzerTrendCalculator.cpp +6 -6
  58. package/worker/fuzzer/src/RTC/RTCP/FuzzerFeedbackRtpTransport.cpp +3 -3
  59. package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +2 -2
  60. package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +5 -5
  61. package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +3 -3
  62. package/worker/fuzzer/src/fuzzer.cpp +4 -0
  63. package/worker/include/Channel/ChannelNotification.hpp +3 -3
  64. package/worker/include/Channel/ChannelRequest.hpp +1 -1
  65. package/worker/include/Channel/ChannelSocket.hpp +11 -0
  66. package/worker/include/DepLibUV.hpp +16 -33
  67. package/worker/include/RTC/ActiveSpeakerObserver.hpp +11 -11
  68. package/worker/include/RTC/AudioLevelObserver.hpp +4 -4
  69. package/worker/include/RTC/BWE/AcknowledgedBitrateEstimatorInterface.hpp +55 -0
  70. package/worker/include/RTC/BWE/AimdRateControl.hpp +190 -0
  71. package/worker/include/RTC/BWE/BweTypes.hpp +211 -0
  72. package/worker/include/RTC/BWE/DelayBasedBwe.hpp +173 -0
  73. package/worker/include/RTC/BWE/FeedbackAdapter.hpp +72 -0
  74. package/worker/include/RTC/BWE/InterArrivalDelta.hpp +106 -0
  75. package/worker/include/RTC/BWE/LinkCapacityEstimator.hpp +84 -0
  76. package/worker/include/RTC/BWE/LossBasedController.hpp +520 -0
  77. package/worker/include/RTC/BWE/RobustThroughputEstimator.hpp +94 -0
  78. package/worker/include/RTC/BWE/SendPacketHistory.hpp +137 -0
  79. package/worker/include/RTC/BWE/TargetRateController.hpp +306 -0
  80. package/worker/include/RTC/BWE/TrendlineEstimator.hpp +143 -0
  81. package/worker/include/RTC/BWE/Utils.hpp +39 -0
  82. package/worker/include/RTC/Consts.hpp +6 -6
  83. package/worker/include/RTC/Consumer.hpp +14 -12
  84. package/worker/include/RTC/DataConsumer.hpp +3 -3
  85. package/worker/include/RTC/DataProducer.hpp +3 -3
  86. package/worker/include/RTC/DtlsTransport.hpp +5 -2
  87. package/worker/include/RTC/ICE/IceCandidate.hpp +2 -2
  88. package/worker/include/RTC/ICE/IceServer.hpp +3 -3
  89. package/worker/include/RTC/KeyFrameRequestManager.hpp +3 -3
  90. package/worker/include/RTC/NEW_RTCP/packet/Packet.hpp +1 -1
  91. package/worker/include/RTC/NackGenerator.hpp +12 -12
  92. package/worker/include/RTC/PipeProducerStreamManager.hpp +3 -4
  93. package/worker/include/RTC/PipeTransport.hpp +18 -5
  94. package/worker/include/RTC/PlainTransport.hpp +18 -5
  95. package/worker/include/RTC/PortManager.hpp +4 -4
  96. package/worker/include/RTC/Producer.hpp +21 -12
  97. package/worker/include/RTC/ProducerStreamManager.hpp +12 -6
  98. package/worker/include/RTC/RTCP/Bye.hpp +2 -2
  99. package/worker/include/RTC/RTCP/FeedbackPsRemb.hpp +4 -4
  100. package/worker/include/RTC/RTCP/FeedbackRtpTmmb.hpp +3 -3
  101. package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +54 -39
  102. package/worker/include/RTC/RTCP/Packet.hpp +3 -3
  103. package/worker/include/RTC/RTCP/ReceiverReport.hpp +3 -3
  104. package/worker/include/RTC/RTCP/Sdes.hpp +2 -2
  105. package/worker/include/RTC/RTCP/XR.hpp +2 -2
  106. package/worker/include/RTC/RTCP/XrDelaySinceLastRr.hpp +1 -1
  107. package/worker/include/RTC/RTP/Codecs/H264.hpp +1 -1
  108. package/worker/include/RTC/RTP/Codecs/Opus.hpp +2 -2
  109. package/worker/include/RTC/RTP/Codecs/PayloadDescriptorHandler.hpp +3 -3
  110. package/worker/include/RTC/RTP/Codecs/VP8.hpp +2 -2
  111. package/worker/include/RTC/RTP/Codecs/VP9.hpp +2 -2
  112. package/worker/include/RTC/RTP/HeaderExtensionIds.hpp +12 -12
  113. package/worker/include/RTC/RTP/Packet.hpp +13 -13
  114. package/worker/include/RTC/RTP/ProbationGenerator.hpp +1 -1
  115. package/worker/include/RTC/RTP/RetransmissionBuffer.hpp +7 -7
  116. package/worker/include/RTC/RTP/RtpStream.hpp +37 -51
  117. package/worker/include/RTC/RTP/RtpStreamRecv.hpp +59 -41
  118. package/worker/include/RTC/RTP/RtpStreamSend.hpp +20 -14
  119. package/worker/include/RTC/RTP/RtxStream.hpp +12 -13
  120. package/worker/include/RTC/RateCalculator.hpp +50 -44
  121. package/worker/include/RTC/RemoteCaptureTimeEstimator.hpp +5 -4
  122. package/worker/include/RTC/RemoteClockOffsetEstimator.hpp +11 -11
  123. package/worker/include/RTC/Router.hpp +6 -0
  124. package/worker/include/RTC/RtcLogger.hpp +1 -1
  125. package/worker/include/RTC/RtpDictionaries.hpp +10 -10
  126. package/worker/include/RTC/SCTP/association/Association.hpp +56 -28
  127. package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +4 -4
  128. package/worker/include/RTC/SCTP/association/StateCookie.hpp +14 -14
  129. package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +38 -2
  130. package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +12 -12
  131. package/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp +4 -4
  132. package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
  133. package/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +3 -3
  134. package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +4 -1
  135. package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +1 -1
  136. package/worker/include/RTC/SCTP/public/SctpOptions.hpp +12 -12
  137. package/worker/include/RTC/SCTP/public/SctpTypes.hpp +6 -6
  138. package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +10 -0
  139. package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +15 -16
  140. package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +7 -8
  141. package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +20 -16
  142. package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +5 -6
  143. package/worker/include/RTC/SCTP/tx/SendQueueInterface.hpp +2 -2
  144. package/worker/include/RTC/SCTP/tx/StreamScheduler.hpp +5 -5
  145. package/worker/include/RTC/SctpDictionaries.hpp +3 -3
  146. package/worker/include/RTC/Serializable.hpp +1 -1
  147. package/worker/include/RTC/SimpleProducerStreamManager.hpp +3 -4
  148. package/worker/include/RTC/SimulcastProducerStreamManager.hpp +6 -7
  149. package/worker/include/RTC/SvcProducerStreamManager.hpp +6 -5
  150. package/worker/include/RTC/TcpConnection.hpp +9 -3
  151. package/worker/include/RTC/TcpServer.hpp +3 -0
  152. package/worker/include/RTC/Transport.hpp +52 -45
  153. package/worker/include/RTC/TransportCongestionControlClient.hpp +30 -25
  154. package/worker/include/RTC/TransportCongestionControlServer.hpp +17 -17
  155. package/worker/include/RTC/TrendCalculator.hpp +5 -5
  156. package/worker/include/RTC/UdpSocket.hpp +11 -2
  157. package/worker/include/RTC/WebRtcServer.hpp +20 -5
  158. package/worker/include/RTC/WebRtcTransport.hpp +35 -10
  159. package/worker/include/Settings.hpp +4 -2
  160. package/worker/include/Shared.hpp +5 -20
  161. package/worker/include/SharedInterface.hpp +6 -28
  162. package/worker/include/Utils.hpp +40 -21
  163. package/worker/include/common.hpp +4 -0
  164. package/worker/include/handles/BackoffTimerHandle.hpp +4 -4
  165. package/worker/include/handles/BackoffTimerHandleInterface.hpp +5 -5
  166. package/worker/include/handles/TcpConnectionHandle.hpp +6 -6
  167. package/worker/include/handles/TcpServerHandle.hpp +1 -1
  168. package/worker/include/handles/TimerHandle.hpp +15 -9
  169. package/worker/include/handles/TimerHandleInterface.hpp +10 -4
  170. package/worker/include/handles/UdpSocketHandle.hpp +3 -3
  171. package/worker/include/handles/UnixStreamSocketHandle.hpp +2 -2
  172. package/worker/meson.build +87 -36
  173. package/worker/meson_options.txt +1 -0
  174. package/worker/mocks/include/MockShared.hpp +24 -23
  175. package/worker/mocks/include/RTC/SCTP/association/MockTransmissionControlBlockContext.hpp +51 -27
  176. package/worker/mocks/include/RTC/SCTP/tx/MockSendQueue.hpp +11 -11
  177. package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +10 -10
  178. package/worker/mocks/include/handles/MockTimerHandle.hpp +60 -22
  179. package/worker/mocks/src/MockShared.cpp +51 -5
  180. package/worker/mocks/src/handles/MockBackoffTimerHandle.cpp +29 -15
  181. package/worker/mocks/src/handles/MockTimerHandle.cpp +117 -0
  182. package/worker/scripts/clang-scripts.mjs +2 -2
  183. package/worker/src/Channel/ChannelNotification.cpp +5 -6
  184. package/worker/src/Channel/ChannelSocket.cpp +20 -2
  185. package/worker/src/DepLibUV.cpp +4 -5
  186. package/worker/src/RTC/ActiveSpeakerObserver.cpp +59 -47
  187. package/worker/src/RTC/AudioLevelObserver.cpp +7 -7
  188. package/worker/src/RTC/BWE/AimdRateControl.cpp +468 -0
  189. package/worker/src/RTC/BWE/BweTypes.cpp +61 -0
  190. package/worker/src/RTC/BWE/DelayBasedBwe.cpp +275 -0
  191. package/worker/src/RTC/BWE/FeedbackAdapter.cpp +148 -0
  192. package/worker/src/RTC/BWE/InterArrivalDelta.cpp +181 -0
  193. package/worker/src/RTC/BWE/LinkCapacityEstimator.cpp +133 -0
  194. package/worker/src/RTC/BWE/LossBasedController.cpp +1046 -0
  195. package/worker/src/RTC/BWE/RobustThroughputEstimator.cpp +245 -0
  196. package/worker/src/RTC/BWE/SendPacketHistory.cpp +184 -0
  197. package/worker/src/RTC/BWE/TargetRateController.cpp +435 -0
  198. package/worker/src/RTC/BWE/TrendlineEstimator.cpp +311 -0
  199. package/worker/src/RTC/BWE/Utils.cpp +54 -0
  200. package/worker/src/RTC/Consumer.cpp +48 -35
  201. package/worker/src/RTC/DataConsumer.cpp +4 -4
  202. package/worker/src/RTC/DataProducer.cpp +3 -3
  203. package/worker/src/RTC/DirectTransport.cpp +2 -2
  204. package/worker/src/RTC/DtlsTransport.cpp +14 -11
  205. package/worker/src/RTC/ICE/IceServer.cpp +2 -2
  206. package/worker/src/RTC/KeyFrameRequestManager.cpp +16 -12
  207. package/worker/src/RTC/NackGenerator.cpp +12 -12
  208. package/worker/src/RTC/PipeProducerStreamManager.cpp +6 -6
  209. package/worker/src/RTC/PipeTransport.cpp +16 -13
  210. package/worker/src/RTC/PlainTransport.cpp +25 -16
  211. package/worker/src/RTC/Producer.cpp +50 -36
  212. package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +13 -6
  213. package/worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp +14 -5
  214. package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +76 -50
  215. package/worker/src/RTC/RTP/Codecs/VP8.cpp +1 -1
  216. package/worker/src/RTC/RTP/Codecs/VP9.cpp +4 -4
  217. package/worker/src/RTC/RTP/Packet.cpp +9 -10
  218. package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +6 -6
  219. package/worker/src/RTC/RTP/RtpStream.cpp +19 -19
  220. package/worker/src/RTC/RTP/RtpStreamRecv.cpp +146 -81
  221. package/worker/src/RTC/RTP/RtpStreamSend.cpp +49 -44
  222. package/worker/src/RTC/RTP/RtxStream.cpp +7 -10
  223. package/worker/src/RTC/RateCalculator.cpp +99 -136
  224. package/worker/src/RTC/RemoteCaptureTimeEstimator.cpp +13 -13
  225. package/worker/src/RTC/RemoteClockOffsetEstimator.cpp +18 -17
  226. package/worker/src/RTC/Router.cpp +18 -1
  227. package/worker/src/RTC/RtpDictionaries/RtpEncodingParameters.cpp +5 -2
  228. package/worker/src/RTC/SCTP/association/Association.cpp +146 -103
  229. package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +4 -4
  230. package/worker/src/RTC/SCTP/association/Capabilities.cpp +1 -1
  231. package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +25 -18
  232. package/worker/src/RTC/SCTP/association/StateCookie.cpp +7 -6
  233. package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +122 -14
  234. package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +28 -26
  235. package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +0 -1
  236. package/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +2 -2
  237. package/worker/src/RTC/SCTP/public/AssociationMetrics.cpp +2 -2
  238. package/worker/src/RTC/SCTP/public/SctpOptions.cpp +13 -13
  239. package/worker/src/RTC/SCTP/rx/DataTracker.cpp +1 -1
  240. package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +5 -5
  241. package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +15 -15
  242. package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +15 -15
  243. package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +29 -26
  244. package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +12 -11
  245. package/worker/src/RTC/SCTP/tx/StreamScheduler.cpp +4 -4
  246. package/worker/src/RTC/SctpDictionaries/SctpStreamParameters.cpp +2 -2
  247. package/worker/src/RTC/SimpleProducerStreamManager.cpp +10 -10
  248. package/worker/src/RTC/SimulcastProducerStreamManager.cpp +39 -37
  249. package/worker/src/RTC/SvcProducerStreamManager.cpp +39 -25
  250. package/worker/src/RTC/TcpConnection.cpp +9 -3
  251. package/worker/src/RTC/TcpServer.cpp +7 -2
  252. package/worker/src/RTC/Transport.cpp +266 -307
  253. package/worker/src/RTC/TransportCongestionControlClient.cpp +78 -71
  254. package/worker/src/RTC/TransportCongestionControlServer.cpp +38 -40
  255. package/worker/src/RTC/TrendCalculator.cpp +3 -3
  256. package/worker/src/RTC/UdpSocket.cpp +14 -3
  257. package/worker/src/RTC/WebRtcServer.cpp +20 -14
  258. package/worker/src/RTC/WebRtcTransport.cpp +35 -30
  259. package/worker/src/Settings.cpp +10 -0
  260. package/worker/src/Shared.cpp +2 -2
  261. package/worker/src/Utils/Crypto.cpp +2 -2
  262. package/worker/src/Worker.cpp +5 -1
  263. package/worker/src/handles/BackoffTimerHandle.cpp +24 -11
  264. package/worker/src/handles/TimerHandle.cpp +74 -25
  265. package/worker/src/lib.cpp +6 -0
  266. package/worker/tasks.py +197 -45
  267. package/worker/test/include/RTC/BWE/helpers/LinkSimulator.hpp +117 -0
  268. package/worker/test/src/RTC/BWE/TestAimdRateControl.cpp +400 -0
  269. package/worker/test/src/RTC/BWE/TestDelayBasedBwe.cpp +568 -0
  270. package/worker/test/src/RTC/BWE/TestFeedbackAdapter.cpp +546 -0
  271. package/worker/test/src/RTC/BWE/TestInterArrivalDelta.cpp +301 -0
  272. package/worker/test/src/RTC/BWE/TestLinkCapacityEstimator.cpp +115 -0
  273. package/worker/test/src/RTC/BWE/TestLossBasedController.cpp +1199 -0
  274. package/worker/test/src/RTC/BWE/TestRobustThroughputEstimator.cpp +433 -0
  275. package/worker/test/src/RTC/BWE/TestSendPacketHistory.cpp +259 -0
  276. package/worker/test/src/RTC/BWE/TestTargetRateController.cpp +337 -0
  277. package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +182 -0
  278. package/worker/test/src/RTC/BWE/TestUtils.cpp +61 -0
  279. package/worker/test/src/RTC/BWE/helpers/LinkSimulator.cpp +171 -0
  280. package/worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp +1 -1
  281. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +1 -1
  282. package/worker/test/src/RTC/RTCP/TestFeedbackRtpTransport.cpp +246 -208
  283. package/worker/test/src/RTC/RTP/TestPacket.cpp +11 -11
  284. package/worker/test/src/RTC/RTP/TestRetransmissionBuffer.cpp +12 -12
  285. package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +23 -16
  286. package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +13 -13
  287. package/worker/test/src/RTC/SCTP/association/TestAssociation.cpp +27 -22
  288. package/worker/test/src/RTC/SCTP/association/TestHeartbeatHandler.cpp +21 -15
  289. package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +6 -6
  290. package/worker/test/src/RTC/SCTP/association/TestStreamResetHandler.cpp +128 -13
  291. package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +3 -3
  292. package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +2 -2
  293. package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +23 -23
  294. package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
  295. package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +1 -1
  296. package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +1 -1
  297. package/worker/test/src/RTC/SCTP/rx/TestDataTracker.cpp +37 -37
  298. package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +10 -10
  299. package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +1 -1
  300. package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +93 -93
  301. package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +247 -247
  302. package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +100 -80
  303. package/worker/test/src/RTC/SCTP/tx/TestRoundRobinSendQueue.cpp +163 -163
  304. package/worker/test/src/RTC/SCTP/tx/TestStreamScheduler.cpp +76 -77
  305. package/worker/test/src/RTC/TestConsumer.cpp +8 -3
  306. package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +3 -3
  307. package/worker/test/src/RTC/TestNackGenerator.cpp +3 -3
  308. package/worker/test/src/RTC/TestPipeProducerStreamManager.cpp +5 -5
  309. package/worker/test/src/RTC/TestRateCalculator.cpp +110 -14
  310. package/worker/test/src/RTC/TestRemoteCaptureTimeEstimator.cpp +22 -17
  311. package/worker/test/src/RTC/TestRemoteClockOffsetEstimator.cpp +87 -85
  312. package/worker/test/src/RTC/TestSimpleProducerStreamManager.cpp +54 -47
  313. package/worker/test/src/RTC/TestSimulcastProducerStreamManager.cpp +83 -69
  314. package/worker/test/src/RTC/TestSvcProducerStreamManager.cpp +76 -65
  315. package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +72 -66
  316. package/worker/test/src/RTC/TestTransportTuple.cpp +19 -4
  317. package/worker/test/src/TestDepLibUV.cpp +19 -0
  318. package/worker/test/src/Utils/TestTime.cpp +57 -26
  319. package/worker/test/src/testHelpers.cpp +1 -1
  320. package/worker/test/src/tests.cpp +6 -0
  321. package/worker/include/RTC/SenderBandwidthEstimator.hpp +0 -118
  322. package/worker/src/RTC/SenderBandwidthEstimator.cpp +0 -269
@@ -71,7 +71,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
71
71
  bool returnValue{ false };
72
72
  };
73
73
 
74
- constexpr uint64_t NowMs{ 42 };
74
+ constexpr int64_t NowUs{ 42 };
75
75
  constexpr uint32_t OutgoingMessageId{ 17 };
76
76
 
77
77
  RTC::SCTP::Types::UnwrappedTsn::Unwrapper unwrapper;
@@ -102,14 +102,14 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
102
102
  buffer.GetChunkStatesForTesting() ==
103
103
  std::vector<std::pair<uint32_t /*tsn*/, RTC::SCTP::OutstandingData::State>>{
104
104
  { 9, RTC::SCTP::OutstandingData::State::ACKED },
105
- });
105
+ });
106
106
  REQUIRE(buffer.ShouldSendForwardTsn() == false);
107
107
  }
108
108
 
109
109
  SECTION("insert chunk")
110
110
  {
111
111
  const auto tsn = buffer.Insert(
112
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
112
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
113
113
 
114
114
  REQUIRE(tsn.has_value());
115
115
  // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
@@ -127,13 +127,13 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
127
127
  std::vector<std::pair<uint32_t /*tsn*/, RTC::SCTP::OutstandingData::State>>{
128
128
  { 9, RTC::SCTP::OutstandingData::State::ACKED },
129
129
  { 10, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
130
- });
130
+ });
131
131
  }
132
132
 
133
133
  SECTION("acks single chunk")
134
134
  {
135
135
  buffer.Insert(
136
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
136
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
137
137
 
138
138
  const auto ackInfo = buffer.HandleSack(unwrapper.Unwrap(10), {}, false);
139
139
 
@@ -155,13 +155,13 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
155
155
  buffer.GetChunkStatesForTesting() ==
156
156
  std::vector<std::pair<uint32_t /*tsn*/, RTC::SCTP::OutstandingData::State>>{
157
157
  { 10, RTC::SCTP::OutstandingData::State::ACKED },
158
- });
158
+ });
159
159
  }
160
160
 
161
161
  SECTION("acks previous chunk doesn't update")
162
162
  {
163
163
  buffer.Insert(
164
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
164
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
165
165
 
166
166
  REQUIRE(buffer.IsEmpty() == false);
167
167
  REQUIRE(buffer.GetUnackedPayloadBytes() == 1);
@@ -175,15 +175,15 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
175
175
  std::vector<std::pair<uint32_t /*tsn*/, RTC::SCTP::OutstandingData::State>>{
176
176
  { 9, RTC::SCTP::OutstandingData::State::ACKED },
177
177
  { 10, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
178
- });
178
+ });
179
179
  }
180
180
 
181
181
  SECTION("acks and nacks with gap-ack-blocks")
182
182
  {
183
183
  buffer.Insert(
184
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false), NowMs);
184
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false), NowUs);
185
185
  buffer.Insert(
186
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false), NowMs);
186
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false), NowUs);
187
187
 
188
188
  const auto ackInfo = buffer.HandleSack(
189
189
  unwrapper.Unwrap(9),
@@ -211,16 +211,16 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
211
211
  { 9, RTC::SCTP::OutstandingData::State::ACKED },
212
212
  { 10, RTC::SCTP::OutstandingData::State::NACKED },
213
213
  { 11, RTC::SCTP::OutstandingData::State::ACKED },
214
- });
214
+ });
215
215
  }
216
216
 
217
217
  SECTION("nacks three times with same TSN doesn't retransmit")
218
218
  {
219
219
  buffer.Insert(
220
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false), NowMs);
220
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false), NowUs);
221
221
 
222
222
  buffer.Insert(
223
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false), NowMs);
223
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false), NowUs);
224
224
 
225
225
  const std::vector<RTC::SCTP::SackChunk::GapAckBlock> gab1 = {
226
226
  { 2, 2 }
@@ -241,22 +241,22 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
241
241
  { 9, RTC::SCTP::OutstandingData::State::ACKED },
242
242
  { 10, RTC::SCTP::OutstandingData::State::NACKED },
243
243
  { 11, RTC::SCTP::OutstandingData::State::ACKED },
244
- });
244
+ });
245
245
  }
246
246
 
247
247
  SECTION("nacks three times results in retransmission")
248
248
  {
249
249
  buffer.Insert(
250
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false), NowMs);
250
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false), NowUs);
251
251
 
252
252
  buffer.Insert(
253
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowMs);
253
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowUs);
254
254
 
255
255
  buffer.Insert(
256
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowMs);
256
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowUs);
257
257
 
258
258
  buffer.Insert(
259
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false), NowMs);
259
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false), NowUs);
260
260
 
261
261
  REQUIRE(
262
262
  buffer
@@ -302,7 +302,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
302
302
  { 11, RTC::SCTP::OutstandingData::State::ACKED },
303
303
  { 12, RTC::SCTP::OutstandingData::State::ACKED },
304
304
  { 13, RTC::SCTP::OutstandingData::State::ACKED },
305
- });
305
+ });
306
306
 
307
307
  std::vector<std::pair<uint32_t, RTC::SCTP::UserData>> expectedChunksToBeFastRetransmitted;
308
308
 
@@ -318,25 +318,25 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
318
318
  buffer.Insert(
319
319
  OutgoingMessageId,
320
320
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false),
321
- NowMs,
321
+ NowUs,
322
322
  /*maxRetransmits*/ 0);
323
323
 
324
324
  buffer.Insert(
325
325
  OutgoingMessageId,
326
326
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
327
- NowMs,
327
+ NowUs,
328
328
  /*maxRetransmits*/ 0);
329
329
 
330
330
  buffer.Insert(
331
331
  OutgoingMessageId,
332
332
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
333
- NowMs,
333
+ NowUs,
334
334
  /*maxRetransmits*/ 0);
335
335
 
336
336
  buffer.Insert(
337
337
  OutgoingMessageId,
338
338
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false),
339
- NowMs,
339
+ NowUs,
340
340
  /*maxRetransmits*/ 0);
341
341
 
342
342
  REQUIRE(
@@ -389,7 +389,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
389
389
  { 11, RTC::SCTP::OutstandingData::State::ABANDONED },
390
390
  { 12, RTC::SCTP::OutstandingData::State::ABANDONED },
391
391
  { 13, RTC::SCTP::OutstandingData::State::ABANDONED },
392
- });
392
+ });
393
393
  }
394
394
 
395
395
  SECTION("nacks three times results in abandoning with placeholder")
@@ -397,25 +397,25 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
397
397
  buffer.Insert(
398
398
  OutgoingMessageId,
399
399
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false),
400
- NowMs,
400
+ NowUs,
401
401
  /*maxRetransmits*/ 0);
402
402
 
403
403
  buffer.Insert(
404
404
  OutgoingMessageId,
405
405
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
406
- NowMs,
406
+ NowUs,
407
407
  /*maxRetransmits*/ 0);
408
408
 
409
409
  buffer.Insert(
410
410
  OutgoingMessageId,
411
411
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
412
- NowMs,
412
+ NowUs,
413
413
  /*maxRetransmits*/ 0);
414
414
 
415
415
  buffer.Insert(
416
416
  OutgoingMessageId,
417
417
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
418
- NowMs,
418
+ NowUs,
419
419
  /*maxRetransmits*/ 0);
420
420
 
421
421
  REQUIRE(
@@ -470,28 +470,28 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
470
470
  { 12, RTC::SCTP::OutstandingData::State::ABANDONED },
471
471
  { 13, RTC::SCTP::OutstandingData::State::ABANDONED },
472
472
  { 14, RTC::SCTP::OutstandingData::State::ABANDONED },
473
- });
473
+ });
474
474
  }
475
475
 
476
476
  SECTION("expires chunk before it is inserted")
477
477
  {
478
- constexpr uint64_t ExpiresAtMs = NowMs + 1;
478
+ constexpr int64_t ExpiresAtUs = NowUs + 1;
479
479
 
480
480
  auto tsn = buffer.Insert(
481
481
  OutgoingMessageId,
482
482
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false),
483
- NowMs,
483
+ NowUs,
484
484
  /*maxRetransmits*/ RTC::SCTP::Types::MaxRetransmitsNoLimit,
485
- ExpiresAtMs);
485
+ ExpiresAtUs);
486
486
 
487
487
  REQUIRE(tsn.has_value());
488
488
 
489
489
  tsn = buffer.Insert(
490
490
  OutgoingMessageId,
491
491
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
492
- NowMs,
492
+ NowUs,
493
493
  /*maxRetransmits*/ RTC::SCTP::Types::MaxRetransmitsNoLimit,
494
- ExpiresAtMs);
494
+ ExpiresAtUs);
495
495
 
496
496
  REQUIRE(tsn.has_value());
497
497
 
@@ -500,9 +500,9 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
500
500
  tsn = buffer.Insert(
501
501
  OutgoingMessageId,
502
502
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false),
503
- NowMs + 1,
503
+ NowUs + 1,
504
504
  /*maxRetransmits*/ RTC::SCTP::Types::MaxRetransmitsNoLimit,
505
- ExpiresAtMs);
505
+ ExpiresAtUs);
506
506
 
507
507
  REQUIRE(!tsn.has_value());
508
508
 
@@ -522,7 +522,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
522
522
  { 10, RTC::SCTP::OutstandingData::State::ABANDONED },
523
523
  { 11, RTC::SCTP::OutstandingData::State::ABANDONED },
524
524
  { 12, RTC::SCTP::OutstandingData::State::ABANDONED },
525
- });
525
+ });
526
526
  }
527
527
 
528
528
  SECTION("can generate Forward-TSN")
@@ -530,19 +530,19 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
530
530
  buffer.Insert(
531
531
  OutgoingMessageId,
532
532
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false),
533
- NowMs,
533
+ NowUs,
534
534
  /*maxRetransmits*/ 0);
535
535
 
536
536
  buffer.Insert(
537
537
  OutgoingMessageId,
538
538
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
539
- NowMs,
539
+ NowUs,
540
540
  /*maxRetransmits*/ 0);
541
541
 
542
542
  buffer.Insert(
543
543
  OutgoingMessageId,
544
544
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false),
545
- NowMs,
545
+ NowUs,
546
546
  /*maxRetransmits*/ 0);
547
547
 
548
548
  discardFromSendQueueTester.Prepare(/*returnValue*/ false);
@@ -562,7 +562,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
562
562
  { 10, RTC::SCTP::OutstandingData::State::ABANDONED },
563
563
  { 11, RTC::SCTP::OutstandingData::State::ABANDONED },
564
564
  { 12, RTC::SCTP::OutstandingData::State::ABANDONED },
565
- });
565
+ });
566
566
  REQUIRE(buffer.ShouldSendForwardTsn() == true);
567
567
 
568
568
  std::unique_ptr<RTC::SCTP::Packet> packet{ RTC::SCTP::Packet::Factory(
@@ -585,7 +585,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
585
585
  buffer.Insert(
586
586
  OutgoingMessageId,
587
587
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, isBeginning, isEnd, false),
588
- NowMs);
588
+ NowUs);
589
589
  }
590
590
 
591
591
  REQUIRE(
@@ -600,7 +600,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
600
600
  { 15, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
601
601
  { 16, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
602
602
  { 17, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
603
- });
603
+ });
604
604
 
605
605
  buffer.HandleSack(
606
606
  unwrapper.Unwrap(12),
@@ -619,27 +619,27 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
619
619
  { 15, RTC::SCTP::OutstandingData::State::ACKED },
620
620
  { 16, RTC::SCTP::OutstandingData::State::NACKED },
621
621
  { 17, RTC::SCTP::OutstandingData::State::ACKED },
622
- });
622
+ });
623
623
  }
624
624
 
625
- SECTION("MeasureRtt()")
625
+ SECTION("MeasureRttUs()")
626
626
  {
627
627
  buffer.Insert(
628
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
628
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
629
629
 
630
630
  buffer.Insert(
631
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs + 1);
631
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs + 1);
632
632
 
633
633
  buffer.Insert(
634
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs + 2);
634
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs + 2);
635
635
 
636
- constexpr uint64_t Duration{ 123 };
636
+ constexpr int64_t DurationUs{ 123 };
637
637
 
638
- const auto duration = buffer.MeasureRtt(NowMs + Duration, unwrapper.Unwrap(11));
638
+ const auto duration = buffer.MeasureRttUs(NowUs + DurationUs, unwrapper.Unwrap(11));
639
639
 
640
640
  REQUIRE(duration.has_value());
641
641
  // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
642
- REQUIRE(duration.value() == Duration - 1);
642
+ REQUIRE(duration.value() == DurationUs - 1);
643
643
  }
644
644
 
645
645
  SECTION("must retransmit before getting nacked again")
@@ -654,7 +654,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
654
654
  buffer.Insert(
655
655
  OutgoingMessageId,
656
656
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, isBeginning, isEnd, false),
657
- NowMs,
657
+ NowUs,
658
658
  /*maxRetransmits*/ 1);
659
659
  }
660
660
 
@@ -771,25 +771,25 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
771
771
  buffer.Insert(
772
772
  1,
773
773
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false),
774
- NowMs,
774
+ NowUs,
775
775
  RTC::SCTP::Types::MaxRetransmitsNoLimit,
776
- RTC::SCTP::Types::ExpiresAtMsInfinite,
776
+ RTC::SCTP::Types::ExpiresAtUsInfinite,
777
777
  /*lifecycleId*/ 42);
778
778
 
779
779
  buffer.Insert(
780
780
  2,
781
781
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false),
782
- NowMs,
782
+ NowUs,
783
783
  RTC::SCTP::Types::MaxRetransmitsNoLimit,
784
- RTC::SCTP::Types::ExpiresAtMsInfinite,
784
+ RTC::SCTP::Types::ExpiresAtUsInfinite,
785
785
  /*lifecycleId*/ 43);
786
786
 
787
787
  buffer.Insert(
788
788
  3,
789
789
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false),
790
- NowMs,
790
+ NowUs,
791
791
  RTC::SCTP::Types::MaxRetransmitsNoLimit,
792
- RTC::SCTP::Types::ExpiresAtMsInfinite,
792
+ RTC::SCTP::Types::ExpiresAtUsInfinite,
793
793
  /*lifecycleId*/ 44);
794
794
 
795
795
  const auto ackInfo1 = buffer.HandleSack(unwrapper.Unwrap(11), {}, false);
@@ -810,25 +810,25 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
810
810
  buffer.Insert(
811
811
  OutgoingMessageId,
812
812
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false),
813
- NowMs,
813
+ NowUs,
814
814
  /*maxRetransmits*/ 0);
815
815
 
816
816
  buffer.Insert(
817
817
  OutgoingMessageId,
818
818
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
819
- NowMs,
819
+ NowUs,
820
820
  /*maxRetransmits*/ 0);
821
821
 
822
822
  buffer.Insert(
823
823
  OutgoingMessageId,
824
824
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
825
- NowMs,
825
+ NowUs,
826
826
  /*maxRetransmits*/ 0);
827
827
 
828
828
  buffer.Insert(
829
829
  OutgoingMessageId,
830
830
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false),
831
- NowMs,
831
+ NowUs,
832
832
  /*maxRetransmits*/ 0);
833
833
 
834
834
  const auto ackInfo1 = buffer.HandleSack(
@@ -874,27 +874,27 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
874
874
  buffer.Insert(
875
875
  OutgoingMessageId,
876
876
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, false, false),
877
- NowMs,
877
+ NowUs,
878
878
  /*maxRetransmits*/ 0);
879
879
 
880
880
  buffer.Insert(
881
881
  OutgoingMessageId,
882
882
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
883
- NowMs,
883
+ NowUs,
884
884
  /*maxRetransmits*/ 0);
885
885
 
886
886
  buffer.Insert(
887
887
  OutgoingMessageId,
888
888
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false),
889
- NowMs,
889
+ NowUs,
890
890
  /*maxRetransmits*/ 0);
891
891
 
892
892
  buffer.Insert(
893
893
  OutgoingMessageId,
894
894
  RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, true, false),
895
- NowMs,
895
+ NowUs,
896
896
  /*maxRetransmits*/ 0,
897
- /*expiresAtMs*/ RTC::SCTP::Types::ExpiresAtMsInfinite,
897
+ /*expiresAtUs*/ RTC::SCTP::Types::ExpiresAtUsInfinite,
898
898
  /*lifecycleId*/ 42);
899
899
 
900
900
  REQUIRE(
@@ -905,7 +905,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
905
905
  { 11, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
906
906
  { 12, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
907
907
  { 13, RTC::SCTP::OutstandingData::State::IN_FLIGHT },
908
- });
908
+ });
909
909
 
910
910
  const auto ackInfo1 = buffer.HandleSack(
911
911
  unwrapper.Unwrap(9),
@@ -925,7 +925,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
925
925
  { 11, RTC::SCTP::OutstandingData::State::ACKED },
926
926
  { 12, RTC::SCTP::OutstandingData::State::ACKED },
927
927
  { 13, RTC::SCTP::OutstandingData::State::ACKED },
928
- });
928
+ });
929
929
 
930
930
  discardFromSendQueueTester.Prepare(/*returnValue*/ false);
931
931
 
@@ -944,7 +944,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
944
944
  { 11, RTC::SCTP::OutstandingData::State::ABANDONED },
945
945
  { 12, RTC::SCTP::OutstandingData::State::ABANDONED },
946
946
  { 13, RTC::SCTP::OutstandingData::State::ABANDONED },
947
- });
947
+ });
948
948
  ;
949
949
  REQUIRE(buffer.ShouldSendForwardTsn() == true);
950
950
 
@@ -984,17 +984,17 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
984
984
  buffer.Insert(
985
985
  0,
986
986
  RTC::SCTP::UserData(1, /*ssn*/ 42, 0, 0, 53, { 0x00 }, true, true, false),
987
- NowMs,
987
+ NowUs,
988
988
  /*maxRetransmits*/ 0);
989
989
  buffer.Insert(
990
990
  1,
991
991
  RTC::SCTP::UserData(1, /*ssn*/ 43, 0, 0, 53, { 0x00 }, true, true, false),
992
- NowMs,
992
+ NowUs,
993
993
  /*maxRetransmits*/ 0);
994
994
  buffer.Insert(
995
995
  2,
996
996
  RTC::SCTP::UserData(1, /*ssn*/ 44, 0, 0, 53, { 0x00 }, true, true, false),
997
- NowMs,
997
+ NowUs,
998
998
  /*maxRetransmits*/ 0);
999
999
  buffer.BeginResetStreams();
1000
1000
 
@@ -1002,12 +1002,12 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1002
1002
  buffer.Insert(
1003
1003
  3,
1004
1004
  RTC::SCTP::UserData(2, /*ssn*/ 45, 0, 0, 53, { 0x00 }, true, true, false),
1005
- NowMs,
1005
+ NowUs,
1006
1006
  /*maxRetransmits*/ 0);
1007
1007
  buffer.Insert(
1008
1008
  4,
1009
1009
  RTC::SCTP::UserData(2, /*ssn*/ 46, 0, 0, 53, { 0x00 }, true, true, false),
1010
- NowMs,
1010
+ NowUs,
1011
1011
  /*maxRetransmits*/ 0);
1012
1012
  buffer.BeginResetStreams();
1013
1013
 
@@ -1015,9 +1015,9 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1015
1015
  buffer.Insert(
1016
1016
  5,
1017
1017
  RTC::SCTP::UserData(3, /*ssn*/ 47, 0, 0, 53, { 0x00 }, true, true, false),
1018
- NowMs,
1018
+ NowUs,
1019
1019
  /*maxRetransmits*/ 0);
1020
- buffer.Insert(6, RTC::SCTP::UserData(3, /*ssn*/ 48, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
1020
+ buffer.Insert(6, RTC::SCTP::UserData(3, /*ssn*/ 48, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
1021
1021
 
1022
1022
  REQUIRE(buffer.ShouldSendForwardTsn() == false);
1023
1023
 
@@ -1033,7 +1033,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1033
1033
  { 14, RTC::SCTP::OutstandingData::State::ABANDONED },
1034
1034
  { 15, RTC::SCTP::OutstandingData::State::ABANDONED },
1035
1035
  { 16, RTC::SCTP::OutstandingData::State::TO_BE_RETRANSMITTED },
1036
- });
1036
+ });
1037
1037
  REQUIRE(buffer.ShouldSendForwardTsn() == true);
1038
1038
 
1039
1039
  std::unique_ptr<RTC::SCTP::Packet> packet{ RTC::SCTP::Packet::Factory(
@@ -1047,7 +1047,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1047
1047
  REQUIRE(
1048
1048
  forwardTsnChunk->GetSkippedStreams() == std::vector<RTC::SCTP::ForwardTsnChunk::SkippedStream>{
1049
1049
  { 1, 44 },
1050
- });
1050
+ });
1051
1051
 
1052
1052
  // Ack 12, allowing a FORWARD-TSN that spans to TSN=14 to be created.
1053
1053
  buffer.HandleSack(unwrapper.Unwrap(12), {}, false);
@@ -1065,7 +1065,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1065
1065
  REQUIRE(
1066
1066
  forwardTsnChunk->GetSkippedStreams() == std::vector<RTC::SCTP::ForwardTsnChunk::SkippedStream>{
1067
1067
  { 2, 46 },
1068
- });
1068
+ });
1069
1069
 
1070
1070
  // Ack 13, allowing a FORWARD-TSN that spans to TSN=14 to be created.
1071
1071
  buffer.HandleSack(unwrapper.Unwrap(13), {}, false);
@@ -1083,7 +1083,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1083
1083
  REQUIRE(
1084
1084
  forwardTsnChunk->GetSkippedStreams() == std::vector<RTC::SCTP::ForwardTsnChunk::SkippedStream>{
1085
1085
  { 2, 46 },
1086
- });
1086
+ });
1087
1087
 
1088
1088
  // Ack 14, allowing a FORWARD-TSN that spans to TSN=15 to be created.
1089
1089
  buffer.HandleSack(unwrapper.Unwrap(14), {}, false);
@@ -1101,7 +1101,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1101
1101
  REQUIRE(
1102
1102
  forwardTsnChunk->GetSkippedStreams() == std::vector<RTC::SCTP::ForwardTsnChunk::SkippedStream>{
1103
1103
  { 3, 47 },
1104
- });
1104
+ });
1105
1105
 
1106
1106
  buffer.HandleSack(unwrapper.Unwrap(15), {}, false);
1107
1107
 
@@ -1111,7 +1111,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1111
1111
  SECTION("treats unacked payload bytes different from packet bytes")
1112
1112
  {
1113
1113
  buffer.Insert(
1114
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
1114
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
1115
1115
 
1116
1116
  REQUIRE(buffer.GetUnackedPayloadBytes() == 1);
1117
1117
  REQUIRE(
@@ -1120,7 +1120,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1120
1120
  REQUIRE(buffer.GetUnackedItems() == 1);
1121
1121
 
1122
1122
  buffer.Insert(
1123
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowMs);
1123
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs);
1124
1124
 
1125
1125
  REQUIRE(buffer.GetUnackedPayloadBytes() == 2);
1126
1126
  REQUIRE(
@@ -1140,7 +1140,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1140
1140
  for (int i{ 10 }; i <= 16; ++i)
1141
1141
  {
1142
1142
  buffer.Insert(
1143
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowMs);
1143
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowUs);
1144
1144
  }
1145
1145
 
1146
1146
  // SACK 1: Cumulative Ack = 10. Gap blocks for 12, 14, 16.
@@ -1153,7 +1153,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1153
1153
  { 2, 2 }, // TSN 12
1154
1154
  { 4, 4 }, // TSN 14
1155
1155
  { 6, 6 } // TSN 16
1156
- },
1156
+ },
1157
1157
  /*isInFastRecovery*/ false);
1158
1158
 
1159
1159
  // SACK 2: Cumulative Ack advances to 11. Same gap blocks (12, 14, 16).
@@ -1166,7 +1166,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1166
1166
  { 1, 1 }, // TSN 12
1167
1167
  { 3, 3 }, // TSN 14
1168
1168
  { 5, 5 } // TSN 16
1169
- },
1169
+ },
1170
1170
  /*isInFastRecovery*/ true);
1171
1171
 
1172
1172
  // SACK 3: Cumulative Ack advances to 12.
@@ -1178,7 +1178,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1178
1178
  std::vector<RTC::SCTP::SackChunk::GapAckBlock>{
1179
1179
  { 2, 2 }, // TSN 14
1180
1180
  { 4, 4 } // TSN 16
1181
- },
1181
+ },
1182
1182
  /*isInFastRecovery*/ true);
1183
1183
 
1184
1184
  REQUIRE(
@@ -1189,7 +1189,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1189
1189
  { 14, RTC::SCTP::OutstandingData::State::ACKED },
1190
1190
  { 15, RTC::SCTP::OutstandingData::State::TO_BE_RETRANSMITTED },
1191
1191
  { 16, RTC::SCTP::OutstandingData::State::ACKED },
1192
- });
1192
+ });
1193
1193
  }
1194
1194
 
1195
1195
  SECTION("nack between ack blocks does not access out of bounds")
@@ -1197,7 +1197,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1197
1197
  for (int i{ 0 }; i < 5; ++i)
1198
1198
  {
1199
1199
  buffer.Insert(
1200
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowMs);
1200
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowUs);
1201
1201
  }
1202
1202
 
1203
1203
  // Inject a malformed SACK where the GapAckBlock exceeds the number of
@@ -1217,7 +1217,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1217
1217
  for (int i{ 0 }; i < 7; ++i)
1218
1218
  {
1219
1219
  buffer.Insert(
1220
- OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowMs);
1220
+ OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, false, false, false), NowUs);
1221
1221
  }
1222
1222
 
1223
1223
  // This NACKs TSN 11, 13, 15 (1st miss indication).
@@ -1227,7 +1227,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1227
1227
  { 2, 2 }, // TSN 12
1228
1228
  { 4, 4 }, // TSN 14
1229
1229
  { 6, 6 } // TSN 16
1230
- },
1230
+ },
1231
1231
  /*isInFastRecovery*/ false);
1232
1232
 
1233
1233
  REQUIRE(buffer.GetUnackedItems() == 3);
@@ -1239,7 +1239,7 @@ SCENARIO("SCTP OutstandingData", "[sctp][outstandingdata]")
1239
1239
  std::vector<RTC::SCTP::SackChunk::GapAckBlock>{
1240
1240
  { 1, 1 }, // TSN 12
1241
1241
  { 1000, 60000 } // TSN 1011..60011
1242
- },
1242
+ },
1243
1243
  /*isInFastRecovery*/ true);
1244
1244
 
1245
1245
  // Packet 11 has been acknowledged.