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.
- package/CHANGELOG.md +16 -0
- package/node/lib/DataConsumer.js +1 -1
- package/node/lib/Router.js +1 -1
- package/node/lib/Transport.js +15 -15
- package/node/lib/fbs/rtp-parameters/encoding-mapping.d.ts +2 -6
- package/node/lib/fbs/rtp-parameters/encoding-mapping.d.ts.map +1 -1
- package/node/lib/fbs/rtp-parameters/encoding-mapping.js +7 -19
- package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.d.ts +4 -4
- package/node/lib/fbs/rtp-parameters/rtp-encoding-parameters.js +2 -2
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.d.ts +5 -5
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.d.ts.map +1 -1
- package/node/lib/fbs/rtp-stream/bitrate-by-layer.js +3 -3
- package/node/lib/fbs/rtp-stream/recv-stats.d.ts +5 -5
- package/node/lib/fbs/rtp-stream/recv-stats.d.ts.map +1 -1
- package/node/lib/fbs/rtp-stream/recv-stats.js +3 -3
- package/node/lib/fbs/rtp-stream/send-stats.d.ts +5 -5
- package/node/lib/fbs/rtp-stream/send-stats.d.ts.map +1 -1
- package/node/lib/fbs/rtp-stream/send-stats.js +3 -3
- package/node/lib/fbs/transport/bwe-trace-info.d.ts +23 -23
- package/node/lib/fbs/transport/bwe-trace-info.d.ts.map +1 -1
- package/node/lib/fbs/transport/bwe-trace-info.js +15 -15
- package/node/lib/fbs/transport/options.d.ts +5 -5
- package/node/lib/fbs/transport/options.js +2 -2
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.d.ts +5 -5
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.d.ts.map +1 -1
- package/node/lib/fbs/transport/set-max-incoming-bitrate-request.js +3 -3
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.d.ts +5 -5
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.d.ts.map +1 -1
- package/node/lib/fbs/transport/set-max-outgoing-bitrate-request.js +3 -3
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.d.ts +5 -5
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.d.ts.map +1 -1
- package/node/lib/fbs/transport/set-min-outgoing-bitrate-request.js +3 -3
- package/node/lib/fbs/transport/stats.d.ts +38 -38
- package/node/lib/fbs/transport/stats.d.ts.map +1 -1
- package/node/lib/fbs/transport/stats.js +25 -25
- package/node/lib/ortc.d.ts +0 -1
- package/node/lib/ortc.d.ts.map +1 -1
- package/node/lib/ortc.js +1 -2
- package/node/lib/rtpParametersFbsUtils.d.ts.map +1 -1
- package/node/lib/rtpParametersFbsUtils.js +2 -2
- package/package.json +9 -9
- package/worker/deps/libwebrtc/libwebrtc/call/rtp_transport_controller_send.cc +10 -10
- package/worker/deps/libwebrtc/libwebrtc/mediasoup_helpers.h +6 -6
- package/worker/deps/libwebrtc/libwebrtc/modules/congestion_controller/goog_cc/alr_detector.cc +1 -1
- package/worker/deps/libwebrtc/libwebrtc/modules/pacing/paced_sender.cc +7 -7
- package/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h +1 -1
- package/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +1 -1
- package/worker/fbs/FBS/meson.build +25 -0
- package/worker/fbs/meson.build +15 -18
- package/worker/fbs/rtpParameters.fbs +1 -2
- package/worker/fbs/rtpStream.fbs +3 -3
- package/worker/fbs/transport.fbs +23 -23
- package/worker/fuzzer/include/RTC/FuzzerDtlsTransport.hpp +4 -1
- package/worker/fuzzer/src/FuzzerUtils.cpp +5 -3
- package/worker/fuzzer/src/RTC/FuzzerDtlsTransport.cpp +8 -5
- package/worker/fuzzer/src/RTC/FuzzerRateCalculator.cpp +3 -3
- package/worker/fuzzer/src/RTC/FuzzerTrendCalculator.cpp +6 -6
- package/worker/fuzzer/src/RTC/RTCP/FuzzerFeedbackRtpTransport.cpp +3 -3
- package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +2 -2
- package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +5 -5
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +3 -3
- package/worker/fuzzer/src/fuzzer.cpp +4 -0
- package/worker/include/Channel/ChannelNotification.hpp +3 -3
- package/worker/include/Channel/ChannelRequest.hpp +1 -1
- package/worker/include/Channel/ChannelSocket.hpp +11 -0
- package/worker/include/DepLibUV.hpp +16 -33
- package/worker/include/RTC/ActiveSpeakerObserver.hpp +11 -11
- package/worker/include/RTC/AudioLevelObserver.hpp +4 -4
- package/worker/include/RTC/BWE/AcknowledgedBitrateEstimatorInterface.hpp +55 -0
- package/worker/include/RTC/BWE/AimdRateControl.hpp +190 -0
- package/worker/include/RTC/BWE/BweTypes.hpp +211 -0
- package/worker/include/RTC/BWE/DelayBasedBwe.hpp +173 -0
- package/worker/include/RTC/BWE/FeedbackAdapter.hpp +72 -0
- package/worker/include/RTC/BWE/InterArrivalDelta.hpp +106 -0
- package/worker/include/RTC/BWE/LinkCapacityEstimator.hpp +84 -0
- package/worker/include/RTC/BWE/LossBasedController.hpp +520 -0
- package/worker/include/RTC/BWE/RobustThroughputEstimator.hpp +94 -0
- package/worker/include/RTC/BWE/SendPacketHistory.hpp +137 -0
- package/worker/include/RTC/BWE/TargetRateController.hpp +306 -0
- package/worker/include/RTC/BWE/TrendlineEstimator.hpp +143 -0
- package/worker/include/RTC/BWE/Utils.hpp +39 -0
- package/worker/include/RTC/Consts.hpp +6 -6
- package/worker/include/RTC/Consumer.hpp +14 -12
- package/worker/include/RTC/DataConsumer.hpp +3 -3
- package/worker/include/RTC/DataProducer.hpp +3 -3
- package/worker/include/RTC/DtlsTransport.hpp +5 -2
- package/worker/include/RTC/ICE/IceCandidate.hpp +2 -2
- package/worker/include/RTC/ICE/IceServer.hpp +3 -3
- package/worker/include/RTC/KeyFrameRequestManager.hpp +3 -3
- package/worker/include/RTC/NEW_RTCP/packet/Packet.hpp +1 -1
- package/worker/include/RTC/NackGenerator.hpp +12 -12
- package/worker/include/RTC/PipeProducerStreamManager.hpp +3 -4
- package/worker/include/RTC/PipeTransport.hpp +18 -5
- package/worker/include/RTC/PlainTransport.hpp +18 -5
- package/worker/include/RTC/PortManager.hpp +4 -4
- package/worker/include/RTC/Producer.hpp +21 -12
- package/worker/include/RTC/ProducerStreamManager.hpp +12 -6
- package/worker/include/RTC/RTCP/Bye.hpp +2 -2
- package/worker/include/RTC/RTCP/FeedbackPsRemb.hpp +4 -4
- package/worker/include/RTC/RTCP/FeedbackRtpTmmb.hpp +3 -3
- package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +54 -39
- package/worker/include/RTC/RTCP/Packet.hpp +3 -3
- package/worker/include/RTC/RTCP/ReceiverReport.hpp +3 -3
- package/worker/include/RTC/RTCP/Sdes.hpp +2 -2
- package/worker/include/RTC/RTCP/XR.hpp +2 -2
- package/worker/include/RTC/RTCP/XrDelaySinceLastRr.hpp +1 -1
- package/worker/include/RTC/RTP/Codecs/H264.hpp +1 -1
- package/worker/include/RTC/RTP/Codecs/Opus.hpp +2 -2
- package/worker/include/RTC/RTP/Codecs/PayloadDescriptorHandler.hpp +3 -3
- package/worker/include/RTC/RTP/Codecs/VP8.hpp +2 -2
- package/worker/include/RTC/RTP/Codecs/VP9.hpp +2 -2
- package/worker/include/RTC/RTP/HeaderExtensionIds.hpp +12 -12
- package/worker/include/RTC/RTP/Packet.hpp +13 -13
- package/worker/include/RTC/RTP/ProbationGenerator.hpp +1 -1
- package/worker/include/RTC/RTP/RetransmissionBuffer.hpp +7 -7
- package/worker/include/RTC/RTP/RtpStream.hpp +37 -51
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +59 -41
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +20 -14
- package/worker/include/RTC/RTP/RtxStream.hpp +12 -13
- package/worker/include/RTC/RateCalculator.hpp +50 -44
- package/worker/include/RTC/RemoteCaptureTimeEstimator.hpp +5 -4
- package/worker/include/RTC/RemoteClockOffsetEstimator.hpp +11 -11
- package/worker/include/RTC/Router.hpp +6 -0
- package/worker/include/RTC/RtcLogger.hpp +1 -1
- package/worker/include/RTC/RtpDictionaries.hpp +10 -10
- package/worker/include/RTC/SCTP/association/Association.hpp +56 -28
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +4 -4
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +14 -14
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +38 -2
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +12 -12
- package/worker/include/RTC/SCTP/association/TransmissionControlBlockContextInterface.hpp +4 -4
- package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/StateCookieParameter.hpp +3 -3
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +4 -1
- package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +1 -1
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +12 -12
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +6 -6
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +10 -0
- package/worker/include/RTC/SCTP/tx/OutstandingData.hpp +15 -16
- package/worker/include/RTC/SCTP/tx/RetransmissionQueue.hpp +7 -8
- package/worker/include/RTC/SCTP/tx/RetransmissionTimeout.hpp +20 -16
- package/worker/include/RTC/SCTP/tx/RoundRobinSendQueue.hpp +5 -6
- package/worker/include/RTC/SCTP/tx/SendQueueInterface.hpp +2 -2
- package/worker/include/RTC/SCTP/tx/StreamScheduler.hpp +5 -5
- package/worker/include/RTC/SctpDictionaries.hpp +3 -3
- package/worker/include/RTC/Serializable.hpp +1 -1
- package/worker/include/RTC/SimpleProducerStreamManager.hpp +3 -4
- package/worker/include/RTC/SimulcastProducerStreamManager.hpp +6 -7
- package/worker/include/RTC/SvcProducerStreamManager.hpp +6 -5
- package/worker/include/RTC/TcpConnection.hpp +9 -3
- package/worker/include/RTC/TcpServer.hpp +3 -0
- package/worker/include/RTC/Transport.hpp +52 -45
- package/worker/include/RTC/TransportCongestionControlClient.hpp +30 -25
- package/worker/include/RTC/TransportCongestionControlServer.hpp +17 -17
- package/worker/include/RTC/TrendCalculator.hpp +5 -5
- package/worker/include/RTC/UdpSocket.hpp +11 -2
- package/worker/include/RTC/WebRtcServer.hpp +20 -5
- package/worker/include/RTC/WebRtcTransport.hpp +35 -10
- package/worker/include/Settings.hpp +4 -2
- package/worker/include/Shared.hpp +5 -20
- package/worker/include/SharedInterface.hpp +6 -28
- package/worker/include/Utils.hpp +40 -21
- package/worker/include/common.hpp +4 -0
- package/worker/include/handles/BackoffTimerHandle.hpp +4 -4
- package/worker/include/handles/BackoffTimerHandleInterface.hpp +5 -5
- package/worker/include/handles/TcpConnectionHandle.hpp +6 -6
- package/worker/include/handles/TcpServerHandle.hpp +1 -1
- package/worker/include/handles/TimerHandle.hpp +15 -9
- package/worker/include/handles/TimerHandleInterface.hpp +10 -4
- package/worker/include/handles/UdpSocketHandle.hpp +3 -3
- package/worker/include/handles/UnixStreamSocketHandle.hpp +2 -2
- package/worker/meson.build +87 -36
- package/worker/meson_options.txt +1 -0
- package/worker/mocks/include/MockShared.hpp +24 -23
- package/worker/mocks/include/RTC/SCTP/association/MockTransmissionControlBlockContext.hpp +51 -27
- package/worker/mocks/include/RTC/SCTP/tx/MockSendQueue.hpp +11 -11
- package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +10 -10
- package/worker/mocks/include/handles/MockTimerHandle.hpp +60 -22
- package/worker/mocks/src/MockShared.cpp +51 -5
- package/worker/mocks/src/handles/MockBackoffTimerHandle.cpp +29 -15
- package/worker/mocks/src/handles/MockTimerHandle.cpp +117 -0
- package/worker/scripts/clang-scripts.mjs +2 -2
- package/worker/src/Channel/ChannelNotification.cpp +5 -6
- package/worker/src/Channel/ChannelSocket.cpp +20 -2
- package/worker/src/DepLibUV.cpp +4 -5
- package/worker/src/RTC/ActiveSpeakerObserver.cpp +59 -47
- package/worker/src/RTC/AudioLevelObserver.cpp +7 -7
- package/worker/src/RTC/BWE/AimdRateControl.cpp +468 -0
- package/worker/src/RTC/BWE/BweTypes.cpp +61 -0
- package/worker/src/RTC/BWE/DelayBasedBwe.cpp +275 -0
- package/worker/src/RTC/BWE/FeedbackAdapter.cpp +148 -0
- package/worker/src/RTC/BWE/InterArrivalDelta.cpp +181 -0
- package/worker/src/RTC/BWE/LinkCapacityEstimator.cpp +133 -0
- package/worker/src/RTC/BWE/LossBasedController.cpp +1046 -0
- package/worker/src/RTC/BWE/RobustThroughputEstimator.cpp +245 -0
- package/worker/src/RTC/BWE/SendPacketHistory.cpp +184 -0
- package/worker/src/RTC/BWE/TargetRateController.cpp +435 -0
- package/worker/src/RTC/BWE/TrendlineEstimator.cpp +311 -0
- package/worker/src/RTC/BWE/Utils.cpp +54 -0
- package/worker/src/RTC/Consumer.cpp +48 -35
- package/worker/src/RTC/DataConsumer.cpp +4 -4
- package/worker/src/RTC/DataProducer.cpp +3 -3
- package/worker/src/RTC/DirectTransport.cpp +2 -2
- package/worker/src/RTC/DtlsTransport.cpp +14 -11
- package/worker/src/RTC/ICE/IceServer.cpp +2 -2
- package/worker/src/RTC/KeyFrameRequestManager.cpp +16 -12
- package/worker/src/RTC/NackGenerator.cpp +12 -12
- package/worker/src/RTC/PipeProducerStreamManager.cpp +6 -6
- package/worker/src/RTC/PipeTransport.cpp +16 -13
- package/worker/src/RTC/PlainTransport.cpp +25 -16
- package/worker/src/RTC/Producer.cpp +50 -36
- package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +13 -6
- package/worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp +14 -5
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +76 -50
- package/worker/src/RTC/RTP/Codecs/VP8.cpp +1 -1
- package/worker/src/RTC/RTP/Codecs/VP9.cpp +4 -4
- package/worker/src/RTC/RTP/Packet.cpp +9 -10
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +6 -6
- package/worker/src/RTC/RTP/RtpStream.cpp +19 -19
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +146 -81
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +49 -44
- package/worker/src/RTC/RTP/RtxStream.cpp +7 -10
- package/worker/src/RTC/RateCalculator.cpp +99 -136
- package/worker/src/RTC/RemoteCaptureTimeEstimator.cpp +13 -13
- package/worker/src/RTC/RemoteClockOffsetEstimator.cpp +18 -17
- package/worker/src/RTC/Router.cpp +18 -1
- package/worker/src/RTC/RtpDictionaries/RtpEncodingParameters.cpp +5 -2
- package/worker/src/RTC/SCTP/association/Association.cpp +146 -103
- package/worker/src/RTC/SCTP/association/AssociationListenerDeferrer.cpp +4 -4
- package/worker/src/RTC/SCTP/association/Capabilities.cpp +1 -1
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +25 -18
- package/worker/src/RTC/SCTP/association/StateCookie.cpp +7 -6
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +122 -14
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +28 -26
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +0 -1
- package/worker/src/RTC/SCTP/packet/parameters/StateCookieParameter.cpp +2 -2
- package/worker/src/RTC/SCTP/public/AssociationMetrics.cpp +2 -2
- package/worker/src/RTC/SCTP/public/SctpOptions.cpp +13 -13
- package/worker/src/RTC/SCTP/rx/DataTracker.cpp +1 -1
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +5 -5
- package/worker/src/RTC/SCTP/tx/OutstandingData.cpp +15 -15
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +15 -15
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +29 -26
- package/worker/src/RTC/SCTP/tx/RoundRobinSendQueue.cpp +12 -11
- package/worker/src/RTC/SCTP/tx/StreamScheduler.cpp +4 -4
- package/worker/src/RTC/SctpDictionaries/SctpStreamParameters.cpp +2 -2
- package/worker/src/RTC/SimpleProducerStreamManager.cpp +10 -10
- package/worker/src/RTC/SimulcastProducerStreamManager.cpp +39 -37
- package/worker/src/RTC/SvcProducerStreamManager.cpp +39 -25
- package/worker/src/RTC/TcpConnection.cpp +9 -3
- package/worker/src/RTC/TcpServer.cpp +7 -2
- package/worker/src/RTC/Transport.cpp +266 -307
- package/worker/src/RTC/TransportCongestionControlClient.cpp +78 -71
- package/worker/src/RTC/TransportCongestionControlServer.cpp +38 -40
- package/worker/src/RTC/TrendCalculator.cpp +3 -3
- package/worker/src/RTC/UdpSocket.cpp +14 -3
- package/worker/src/RTC/WebRtcServer.cpp +20 -14
- package/worker/src/RTC/WebRtcTransport.cpp +35 -30
- package/worker/src/Settings.cpp +10 -0
- package/worker/src/Shared.cpp +2 -2
- package/worker/src/Utils/Crypto.cpp +2 -2
- package/worker/src/Worker.cpp +5 -1
- package/worker/src/handles/BackoffTimerHandle.cpp +24 -11
- package/worker/src/handles/TimerHandle.cpp +74 -25
- package/worker/src/lib.cpp +6 -0
- package/worker/tasks.py +197 -45
- package/worker/test/include/RTC/BWE/helpers/LinkSimulator.hpp +117 -0
- package/worker/test/src/RTC/BWE/TestAimdRateControl.cpp +400 -0
- package/worker/test/src/RTC/BWE/TestDelayBasedBwe.cpp +568 -0
- package/worker/test/src/RTC/BWE/TestFeedbackAdapter.cpp +546 -0
- package/worker/test/src/RTC/BWE/TestInterArrivalDelta.cpp +301 -0
- package/worker/test/src/RTC/BWE/TestLinkCapacityEstimator.cpp +115 -0
- package/worker/test/src/RTC/BWE/TestLossBasedController.cpp +1199 -0
- package/worker/test/src/RTC/BWE/TestRobustThroughputEstimator.cpp +433 -0
- package/worker/test/src/RTC/BWE/TestSendPacketHistory.cpp +259 -0
- package/worker/test/src/RTC/BWE/TestTargetRateController.cpp +337 -0
- package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +182 -0
- package/worker/test/src/RTC/BWE/TestUtils.cpp +61 -0
- package/worker/test/src/RTC/BWE/helpers/LinkSimulator.cpp +171 -0
- package/worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTransport.cpp +246 -208
- package/worker/test/src/RTC/RTP/TestPacket.cpp +11 -11
- package/worker/test/src/RTC/RTP/TestRetransmissionBuffer.cpp +12 -12
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +23 -16
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +13 -13
- package/worker/test/src/RTC/SCTP/association/TestAssociation.cpp +27 -22
- package/worker/test/src/RTC/SCTP/association/TestHeartbeatHandler.cpp +21 -15
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +6 -6
- package/worker/test/src/RTC/SCTP/association/TestStreamResetHandler.cpp +128 -13
- package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +3 -3
- package/worker/test/src/RTC/SCTP/packet/chunks/TestForwardTsnChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestIForwardTsnChunk.cpp +23 -23
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestSackChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIPv6AddressParameter.cpp +1 -1
- package/worker/test/src/RTC/SCTP/rx/TestDataTracker.cpp +37 -37
- package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +10 -10
- package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +1 -1
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +93 -93
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +247 -247
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +100 -80
- package/worker/test/src/RTC/SCTP/tx/TestRoundRobinSendQueue.cpp +163 -163
- package/worker/test/src/RTC/SCTP/tx/TestStreamScheduler.cpp +76 -77
- package/worker/test/src/RTC/TestConsumer.cpp +8 -3
- package/worker/test/src/RTC/TestKeyFrameRequestManager.cpp +3 -3
- package/worker/test/src/RTC/TestNackGenerator.cpp +3 -3
- package/worker/test/src/RTC/TestPipeProducerStreamManager.cpp +5 -5
- package/worker/test/src/RTC/TestRateCalculator.cpp +110 -14
- package/worker/test/src/RTC/TestRemoteCaptureTimeEstimator.cpp +22 -17
- package/worker/test/src/RTC/TestRemoteClockOffsetEstimator.cpp +87 -85
- package/worker/test/src/RTC/TestSimpleProducerStreamManager.cpp +54 -47
- package/worker/test/src/RTC/TestSimulcastProducerStreamManager.cpp +83 -69
- package/worker/test/src/RTC/TestSvcProducerStreamManager.cpp +76 -65
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +72 -66
- package/worker/test/src/RTC/TestTransportTuple.cpp +19 -4
- package/worker/test/src/TestDepLibUV.cpp +19 -0
- package/worker/test/src/Utils/TestTime.cpp +57 -26
- package/worker/test/src/testHelpers.cpp +1 -1
- package/worker/test/src/tests.cpp +6 -0
- package/worker/include/RTC/SenderBandwidthEstimator.hpp +0 -118
- 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
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
483
|
+
NowUs,
|
|
484
484
|
/*maxRetransmits*/ RTC::SCTP::Types::MaxRetransmitsNoLimit,
|
|
485
|
-
|
|
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
|
-
|
|
492
|
+
NowUs,
|
|
493
493
|
/*maxRetransmits*/ RTC::SCTP::Types::MaxRetransmitsNoLimit,
|
|
494
|
-
|
|
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
|
-
|
|
503
|
+
NowUs + 1,
|
|
504
504
|
/*maxRetransmits*/ RTC::SCTP::Types::MaxRetransmitsNoLimit,
|
|
505
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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("
|
|
625
|
+
SECTION("MeasureRttUs()")
|
|
626
626
|
{
|
|
627
627
|
buffer.Insert(
|
|
628
|
-
OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false),
|
|
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),
|
|
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),
|
|
634
|
+
OutgoingMessageId, RTC::SCTP::UserData(1, 0, 0, 0, 53, { 0x00 }, true, true, false), NowUs + 2);
|
|
635
635
|
|
|
636
|
-
constexpr
|
|
636
|
+
constexpr int64_t DurationUs{ 123 };
|
|
637
637
|
|
|
638
|
-
const auto duration = buffer.
|
|
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() ==
|
|
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
|
-
|
|
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
|
-
|
|
774
|
+
NowUs,
|
|
775
775
|
RTC::SCTP::Types::MaxRetransmitsNoLimit,
|
|
776
|
-
RTC::SCTP::Types::
|
|
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
|
-
|
|
782
|
+
NowUs,
|
|
783
783
|
RTC::SCTP::Types::MaxRetransmitsNoLimit,
|
|
784
|
-
RTC::SCTP::Types::
|
|
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
|
-
|
|
790
|
+
NowUs,
|
|
791
791
|
RTC::SCTP::Types::MaxRetransmitsNoLimit,
|
|
792
|
-
RTC::SCTP::Types::
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
895
|
+
NowUs,
|
|
896
896
|
/*maxRetransmits*/ 0,
|
|
897
|
-
/*
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1018
|
+
NowUs,
|
|
1019
1019
|
/*maxRetransmits*/ 0);
|
|
1020
|
-
buffer.Insert(6, RTC::SCTP::UserData(3, /*ssn*/ 48, 0, 0, 53, { 0x00 }, true, true, false),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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),
|
|
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.
|