mediasoup 3.26.0 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -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/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/RobustThroughputEstimator.hpp +94 -0
- package/worker/include/RTC/BWE/SendPacketHistory.hpp +137 -0
- package/worker/include/RTC/BWE/TrendlineEstimator.hpp +101 -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 +2 -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 +1 -1
- 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 +81 -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/RobustThroughputEstimator.cpp +245 -0
- package/worker/src/RTC/BWE/SendPacketHistory.cpp +184 -0
- package/worker/src/RTC/BWE/TrendlineEstimator.cpp +233 -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 +131 -102
- 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 +16 -13
- 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 +1 -1
- 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 +242 -302
- 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 +171 -44
- 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/TestRobustThroughputEstimator.cpp +433 -0
- package/worker/test/src/RTC/BWE/TestSendPacketHistory.cpp +259 -0
- package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +137 -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 +17 -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
|
@@ -196,7 +196,7 @@ namespace RTC
|
|
|
196
196
|
{
|
|
197
197
|
StreamReset streamReset = std::get<StreamReset>(std::move(data));
|
|
198
198
|
listener->OnAssociationStreamsResetPerformed(streamReset.streamIds);
|
|
199
|
-
|
|
199
|
+
},
|
|
200
200
|
StreamReset{ .streamIds = { outboundStreamIds.begin(), outboundStreamIds.end() } });
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -212,9 +212,9 @@ namespace RTC
|
|
|
212
212
|
{
|
|
213
213
|
StreamReset streamReset = std::get<StreamReset>(std::move(data));
|
|
214
214
|
listener->OnAssociationStreamsResetFailed(streamReset.streamIds, streamReset.errorMessage);
|
|
215
|
-
|
|
215
|
+
},
|
|
216
216
|
StreamReset{ .streamIds = { outboundStreamIds.begin(), outboundStreamIds.end() },
|
|
217
|
-
|
|
217
|
+
.errorMessage = std::string(errorMessage) });
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
void AssociationListenerDeferrer::OnAssociationInboundStreamsReset(
|
|
@@ -229,7 +229,7 @@ namespace RTC
|
|
|
229
229
|
{
|
|
230
230
|
StreamReset streamReset = std::get<StreamReset>(std::move(data));
|
|
231
231
|
listener->OnAssociationInboundStreamsReset(streamReset.streamIds);
|
|
232
|
-
|
|
232
|
+
},
|
|
233
233
|
StreamReset{ .streamIds = { inboundStreamIds.begin(), inboundStreamIds.end() } });
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -35,7 +35,7 @@ namespace RTC
|
|
|
35
35
|
capabilities.partialReliability =
|
|
36
36
|
remoteForwardTsnSupportedParameter ||
|
|
37
37
|
(remoteSupportedExtensionsParameter &&
|
|
38
|
-
|
|
38
|
+
remoteSupportedExtensionsParameter->IncludesChunkType(Chunk::ChunkType::FORWARD_TSN));
|
|
39
39
|
|
|
40
40
|
// Remote announces Message Interleaving support via Supported Extensions
|
|
41
41
|
// parameter.
|
|
@@ -71,8 +71,9 @@ namespace RTC
|
|
|
71
71
|
|
|
72
72
|
if (intervalDurationShouldIncludeRtt)
|
|
73
73
|
{
|
|
74
|
+
// NOTE: The timer takes milliseconds, so the RTO is truncated here.
|
|
74
75
|
this->intervalTimer->SetBaseTimeoutMs(
|
|
75
|
-
this->intervalDurationMs + this->tcbContext->
|
|
76
|
+
this->intervalDurationMs + (this->tcbContext->GetCurrentRtoUs() / 1000));
|
|
76
77
|
}
|
|
77
78
|
else
|
|
78
79
|
{
|
|
@@ -149,24 +150,27 @@ namespace RTC
|
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
// NOTE: The peer echoes back the info we wrote, so this value cannot be
|
|
154
|
+
// trusted. The guard below rejects it unless it's a past instant, which
|
|
155
|
+
// also rejects a negative resulting from garbage above 2^63.
|
|
156
|
+
const auto createdAtUs = static_cast<int64_t>(Utils::Byte::Get8Bytes(info, 0));
|
|
157
|
+
const int64_t nowUs = this->shared->GetTimeUs();
|
|
154
158
|
|
|
155
|
-
if (
|
|
159
|
+
if (createdAtUs > 0 && createdAtUs <= nowUs)
|
|
156
160
|
{
|
|
157
|
-
const
|
|
161
|
+
const int64_t rttUs = nowUs - createdAtUs;
|
|
158
162
|
|
|
159
|
-
MS_DEBUG_DEV("valid HEARTBEAT-ACK chunk received, calling
|
|
163
|
+
MS_DEBUG_DEV("valid HEARTBEAT-ACK chunk received, calling ObserveRttUs(%" PRIi64 ")", rttUs);
|
|
160
164
|
|
|
161
|
-
this->tcbContext->
|
|
165
|
+
this->tcbContext->ObserveRttUs(rttUs);
|
|
162
166
|
}
|
|
163
167
|
else
|
|
164
168
|
{
|
|
165
169
|
MS_WARN_DEV(
|
|
166
|
-
"ignoring received HEARTBEAT-ACK chunk with invalid info content [
|
|
167
|
-
",
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
"ignoring received HEARTBEAT-ACK chunk with invalid info content [createdAtUs:%" PRIi64
|
|
171
|
+
", nowUs:%" PRIi64 "]",
|
|
172
|
+
createdAtUs,
|
|
173
|
+
nowUs);
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
// https://datatracker.ietf.org/doc/html/rfc9260#section-8.1
|
|
@@ -176,7 +180,7 @@ namespace RTC
|
|
|
176
180
|
this->tcbContext->ClearTxErrorCounter();
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
void HeartbeatHandler::OnIntervalTimer(
|
|
183
|
+
void HeartbeatHandler::OnIntervalTimer(int64_t& /*baseTimeoutMs*/, bool& /*stop*/)
|
|
180
184
|
{
|
|
181
185
|
MS_TRACE();
|
|
182
186
|
|
|
@@ -204,14 +208,17 @@ namespace RTC
|
|
|
204
208
|
return;
|
|
205
209
|
}
|
|
206
210
|
|
|
207
|
-
|
|
211
|
+
// NOTE: The timer takes milliseconds, so the RTO is truncated here.
|
|
212
|
+
this->timeoutTimer->SetBaseTimeoutMs(this->tcbContext->GetCurrentRtoUs() / 1000);
|
|
208
213
|
this->timeoutTimer->Start();
|
|
209
214
|
|
|
210
215
|
alignas(8) uint8_t info[HeartbeatInfoLength];
|
|
211
216
|
|
|
212
|
-
|
|
217
|
+
// NOTE: This is read back in HandleReceivedHeartbeatAckChunk() when the
|
|
218
|
+
// peer echoes it, so both sides of it must use the same unit.
|
|
219
|
+
const int64_t nowUs = this->shared->GetTimeUs();
|
|
213
220
|
|
|
214
|
-
Utils::Byte::Set8Bytes(info, 0,
|
|
221
|
+
Utils::Byte::Set8Bytes(info, 0, static_cast<uint64_t>(nowUs));
|
|
215
222
|
|
|
216
223
|
auto packet = this->tcbContext->CreatePacket();
|
|
217
224
|
auto* heartbeatRequestChunk = packet->BuildChunkInPlace<HeartbeatRequestChunk>();
|
|
@@ -222,12 +229,12 @@ namespace RTC
|
|
|
222
229
|
heartbeatInfoParameter->Consolidate();
|
|
223
230
|
heartbeatRequestChunk->Consolidate();
|
|
224
231
|
|
|
225
|
-
MS_DEBUG_DEV("sending HEARTBEAT-REQUEST chunk with info content [
|
|
232
|
+
MS_DEBUG_DEV("sending HEARTBEAT-REQUEST chunk with info content [nowUs:%" PRIi64 "]", nowUs);
|
|
226
233
|
|
|
227
234
|
this->tcbContext->SendPacket(packet.get());
|
|
228
235
|
}
|
|
229
236
|
|
|
230
|
-
void HeartbeatHandler::OnTimeoutTimer(
|
|
237
|
+
void HeartbeatHandler::OnTimeoutTimer(int64_t& /*baseTimeoutMs*/, bool& stop)
|
|
231
238
|
{
|
|
232
239
|
MS_TRACE();
|
|
233
240
|
|
|
@@ -261,7 +268,7 @@ namespace RTC
|
|
|
261
268
|
}
|
|
262
269
|
|
|
263
270
|
void HeartbeatHandler::OnBackoffTimer(
|
|
264
|
-
BackoffTimerHandleInterface* backoffTimer,
|
|
271
|
+
BackoffTimerHandleInterface* backoffTimer, int64_t& baseTimeoutMs, bool& stop)
|
|
265
272
|
{
|
|
266
273
|
MS_TRACE();
|
|
267
274
|
|
|
@@ -49,7 +49,7 @@ namespace RTC
|
|
|
49
49
|
uint32_t remoteAdvertisedReceiverWindowCredit,
|
|
50
50
|
uint64_t tieTag,
|
|
51
51
|
const Capabilities& remoteCapabilities,
|
|
52
|
-
|
|
52
|
+
int64_t creationTimestampUs,
|
|
53
53
|
const uint8_t* macKey,
|
|
54
54
|
size_t macKeyLength)
|
|
55
55
|
{
|
|
@@ -66,7 +66,7 @@ namespace RTC
|
|
|
66
66
|
remoteAdvertisedReceiverWindowCredit,
|
|
67
67
|
tieTag,
|
|
68
68
|
remoteCapabilities,
|
|
69
|
-
|
|
69
|
+
creationTimestampUs,
|
|
70
70
|
macKey,
|
|
71
71
|
macKeyLength);
|
|
72
72
|
|
|
@@ -86,7 +86,7 @@ namespace RTC
|
|
|
86
86
|
uint32_t remoteAdvertisedReceiverWindowCredit,
|
|
87
87
|
uint64_t tieTag,
|
|
88
88
|
const Capabilities& remoteCapabilities,
|
|
89
|
-
|
|
89
|
+
int64_t creationTimestampUs,
|
|
90
90
|
const uint8_t* macKey,
|
|
91
91
|
size_t macKeyLength)
|
|
92
92
|
{
|
|
@@ -132,7 +132,8 @@ namespace RTC
|
|
|
132
132
|
// bytes (including the timestamp).
|
|
133
133
|
//
|
|
134
134
|
// @see RFC 9260 section 5.1.3.
|
|
135
|
-
Utils::Byte::Set8Bytes(
|
|
135
|
+
Utils::Byte::Set8Bytes(
|
|
136
|
+
buffer, StateCookie::TimestampOffset, static_cast<uint64_t>(creationTimestampUs));
|
|
136
137
|
|
|
137
138
|
const uint8_t* mac = Utils::Crypto::GetHmacSha1(
|
|
138
139
|
reinterpret_cast<const char*>(macKey), macKeyLength, buffer, StateCookie::MacOffset);
|
|
@@ -228,7 +229,7 @@ namespace RTC
|
|
|
228
229
|
SetLength(
|
|
229
230
|
bufferLength == StateCookie::AuthenticatedStateCookieLength
|
|
230
231
|
? StateCookie::AuthenticatedStateCookieLength
|
|
231
|
-
|
|
232
|
+
: StateCookie::StateCookieLength);
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
StateCookie::~StateCookie()
|
|
@@ -258,7 +259,7 @@ namespace RTC
|
|
|
258
259
|
|
|
259
260
|
if (IsAuthenticated())
|
|
260
261
|
{
|
|
261
|
-
MS_DUMP_CLEAN(indentation, " creation timestamp (
|
|
262
|
+
MS_DUMP_CLEAN(indentation, " creation timestamp (us): %" PRIi64, GetCreationTimestampUs());
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
MS_DUMP_CLEAN(indentation, " remote capabilities:");
|
|
@@ -77,7 +77,8 @@ namespace RTC
|
|
|
77
77
|
this->retransmissionQueue->GetLastAssignedTsn(),
|
|
78
78
|
this->retransmissionQueue->BeginResetStreams());
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
// NOTE: The timer takes milliseconds, so the RTO is truncated here.
|
|
81
|
+
this->reConfigTimer->SetBaseTimeoutMs(this->tcbContext->GetCurrentRtoUs() / 1000);
|
|
81
82
|
this->reConfigTimer->Start();
|
|
82
83
|
|
|
83
84
|
AddReConfigChunk(packet);
|
|
@@ -168,21 +169,21 @@ namespace RTC
|
|
|
168
169
|
|
|
169
170
|
if (
|
|
170
171
|
(firstParameter->GetType() == Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST &&
|
|
171
|
-
|
|
172
|
+
secondParameter->GetType() == Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST) ||
|
|
172
173
|
(firstParameter->GetType() == Parameter::ParameterType::INCOMING_SSN_RESET_REQUEST &&
|
|
173
|
-
|
|
174
|
+
secondParameter->GetType() == Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST) ||
|
|
174
175
|
(firstParameter->GetType() == Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST &&
|
|
175
|
-
|
|
176
|
+
secondParameter->GetType() == Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST) ||
|
|
176
177
|
(firstParameter->GetType() == Parameter::ParameterType::ADD_INCOMING_STREAMS_REQUEST &&
|
|
177
|
-
|
|
178
|
+
secondParameter->GetType() == Parameter::ParameterType::ADD_OUTGOING_STREAMS_REQUEST) ||
|
|
178
179
|
(firstParameter->GetType() == Parameter::ParameterType::RECONFIGURATION_RESPONSE &&
|
|
179
|
-
|
|
180
|
+
secondParameter->GetType() == Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST) ||
|
|
180
181
|
(firstParameter->GetType() == Parameter::ParameterType::OUTGOING_SSN_RESET_REQUEST &&
|
|
181
|
-
|
|
182
|
+
secondParameter->GetType() == Parameter::ParameterType::RECONFIGURATION_RESPONSE) ||
|
|
182
183
|
(firstParameter->GetType() == Parameter::ParameterType::RECONFIGURATION_RESPONSE &&
|
|
183
|
-
|
|
184
|
+
secondParameter->GetType() == Parameter::ParameterType::RECONFIGURATION_RESPONSE) ||
|
|
184
185
|
(firstParameter->GetType() == Parameter::ParameterType::RECONFIGURATION_RESPONSE &&
|
|
185
|
-
|
|
186
|
+
secondParameter->GetType() == Parameter::ParameterType::RECONFIGURATION_RESPONSE))
|
|
186
187
|
{
|
|
187
188
|
return true;
|
|
188
189
|
}
|
|
@@ -435,7 +436,8 @@ namespace RTC
|
|
|
435
436
|
// Force this request to be sent again, but with the same `reqSeqNbr`.
|
|
436
437
|
this->currentRequest->SetDeferred(true);
|
|
437
438
|
|
|
438
|
-
|
|
439
|
+
// NOTE: The timer takes milliseconds, so the RTO is truncated here.
|
|
440
|
+
this->reConfigTimer->SetBaseTimeoutMs(this->tcbContext->GetCurrentRtoUs() / 1000);
|
|
439
441
|
this->reConfigTimer->Start();
|
|
440
442
|
|
|
441
443
|
break;
|
|
@@ -469,7 +471,7 @@ namespace RTC
|
|
|
469
471
|
}
|
|
470
472
|
}
|
|
471
473
|
|
|
472
|
-
void StreamResetHandler::OnReConfigTimer(
|
|
474
|
+
void StreamResetHandler::OnReConfigTimer(int64_t& baseTimeoutMs, bool& stop)
|
|
473
475
|
{
|
|
474
476
|
MS_TRACE();
|
|
475
477
|
|
|
@@ -520,11 +522,12 @@ namespace RTC
|
|
|
520
522
|
|
|
521
523
|
this->tcbContext->SendPacket(packet.get());
|
|
522
524
|
|
|
523
|
-
|
|
525
|
+
// NOTE: The timer takes milliseconds, so the RTO is truncated here.
|
|
526
|
+
baseTimeoutMs = this->tcbContext->GetCurrentRtoUs() / 1000;
|
|
524
527
|
}
|
|
525
528
|
|
|
526
529
|
void StreamResetHandler::OnBackoffTimer(
|
|
527
|
-
BackoffTimerHandleInterface* backoffTimer,
|
|
530
|
+
BackoffTimerHandleInterface* backoffTimer, int64_t& baseTimeoutMs, bool& stop)
|
|
528
531
|
{
|
|
529
532
|
MS_TRACE();
|
|
530
533
|
|
|
@@ -125,27 +125,31 @@ namespace RTC
|
|
|
125
125
|
MS_DUMP_CLEAN(indentation, "</SCTP::TransmissionControlBlock>");
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
void TransmissionControlBlock::
|
|
128
|
+
void TransmissionControlBlock::ObserveRttUs(int64_t rttUs)
|
|
129
129
|
{
|
|
130
130
|
MS_TRACE();
|
|
131
131
|
|
|
132
132
|
#if MS_LOG_DEV_LEVEL == 3
|
|
133
|
-
const auto
|
|
133
|
+
const auto prevRtoUs = this->rto.GetRtoUs();
|
|
134
134
|
#endif
|
|
135
135
|
|
|
136
|
-
this->rto.
|
|
136
|
+
this->rto.ObserveRttUs(rttUs);
|
|
137
137
|
|
|
138
138
|
MS_DEBUG_DEV(
|
|
139
|
-
"new rtt:%"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this->rto.
|
|
139
|
+
"new rtt:%" PRIi64 " us, previous rto:%" PRIi64 " us, new rto:%" PRIi64 " us, srtt:%" PRIi64
|
|
140
|
+
" us",
|
|
141
|
+
rttUs,
|
|
142
|
+
prevRtoUs,
|
|
143
|
+
this->rto.GetRtoUs(),
|
|
144
|
+
this->rto.GetSrttUs());
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
// NOTE: The timers take milliseconds, so the RTO is truncated here. It is
|
|
147
|
+
// hundreds of milliseconds long, so the sub-millisecond part is noise.
|
|
148
|
+
this->t3RtxTimer->SetBaseTimeoutMs(this->rto.GetRtoUs() / 1000);
|
|
146
149
|
|
|
147
|
-
const
|
|
148
|
-
static_cast<
|
|
150
|
+
const int64_t delayedAckTimeoutMs = std::min(
|
|
151
|
+
static_cast<int64_t>((this->rto.GetRtoUs() * 0.5) / 1000),
|
|
152
|
+
this->sctpOptions.delayedAckMaxTimeoutMs);
|
|
149
153
|
|
|
150
154
|
this->delayedAckTimer->SetBaseTimeoutMs(delayedAckTimeoutMs);
|
|
151
155
|
}
|
|
@@ -211,11 +215,11 @@ namespace RTC
|
|
|
211
215
|
SendPacket(packet.get());
|
|
212
216
|
}
|
|
213
217
|
|
|
214
|
-
void TransmissionControlBlock::MayAddForwardTsnChunk(Packet* packet,
|
|
218
|
+
void TransmissionControlBlock::MayAddForwardTsnChunk(Packet* packet, int64_t nowUs)
|
|
215
219
|
{
|
|
216
220
|
MS_TRACE();
|
|
217
221
|
|
|
218
|
-
if (
|
|
222
|
+
if (nowUs >= this->limitForwardTsnUntilUs && this->retransmissionQueue.ShouldSendForwardTsn(nowUs))
|
|
219
223
|
{
|
|
220
224
|
if (this->negotiatedCapabilities.messageInterleaving)
|
|
221
225
|
{
|
|
@@ -233,7 +237,7 @@ namespace RTC
|
|
|
233
237
|
// before sending a duplicate FORWARD TSN."
|
|
234
238
|
// "Any delay applied to the sending of FORWARD TSN chunk SHOULD NOT
|
|
235
239
|
// exceed 200ms and MUST NOT exceed 500ms".
|
|
236
|
-
this->
|
|
240
|
+
this->limitForwardTsnUntilUs = nowUs + std::min(int64_t{ 200 * 1000 }, this->rto.GetSrttUs());
|
|
237
241
|
}
|
|
238
242
|
}
|
|
239
243
|
|
|
@@ -284,7 +288,7 @@ namespace RTC
|
|
|
284
288
|
SendPacket(packet.get());
|
|
285
289
|
}
|
|
286
290
|
|
|
287
|
-
void TransmissionControlBlock::SendBufferedPackets(
|
|
291
|
+
void TransmissionControlBlock::SendBufferedPackets(int64_t nowUs, bool addCookieAckChunk)
|
|
288
292
|
{
|
|
289
293
|
MS_TRACE();
|
|
290
294
|
|
|
@@ -338,9 +342,7 @@ namespace RTC
|
|
|
338
342
|
packet.get(), this->reassemblyQueue.GetRemainingBytes());
|
|
339
343
|
}
|
|
340
344
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
MayAddForwardTsnChunk(packet.get(), nowMs);
|
|
345
|
+
MayAddForwardTsnChunk(packet.get(), nowUs);
|
|
344
346
|
|
|
345
347
|
if (this->streamResetHandler.ShouldSendStreamResetRequest())
|
|
346
348
|
{
|
|
@@ -349,7 +351,7 @@ namespace RTC
|
|
|
349
351
|
}
|
|
350
352
|
|
|
351
353
|
auto chunksToSend =
|
|
352
|
-
this->retransmissionQueue.GetChunksToSend(
|
|
354
|
+
this->retransmissionQueue.GetChunksToSend(nowUs, packet->GetAvailableLength());
|
|
353
355
|
|
|
354
356
|
if (!chunksToSend.empty())
|
|
355
357
|
{
|
|
@@ -409,7 +411,7 @@ namespace RTC
|
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
413
|
|
|
412
|
-
void TransmissionControlBlock::OnT3RtxTimer(
|
|
414
|
+
void TransmissionControlBlock::OnT3RtxTimer(int64_t& /*baseTimeoutMs*/, bool& stop)
|
|
413
415
|
{
|
|
414
416
|
MS_TRACE();
|
|
415
417
|
|
|
@@ -439,9 +441,9 @@ namespace RTC
|
|
|
439
441
|
{
|
|
440
442
|
this->retransmissionQueue.HandleT3RtxTimerExpiry();
|
|
441
443
|
|
|
442
|
-
const
|
|
444
|
+
const int64_t nowUs = this->shared->GetTimeUs();
|
|
443
445
|
|
|
444
|
-
SendBufferedPackets(
|
|
446
|
+
SendBufferedPackets(nowUs);
|
|
445
447
|
}
|
|
446
448
|
else
|
|
447
449
|
{
|
|
@@ -455,7 +457,7 @@ namespace RTC
|
|
|
455
457
|
}
|
|
456
458
|
}
|
|
457
459
|
|
|
458
|
-
void TransmissionControlBlock::OnDelayedAckTimer(
|
|
460
|
+
void TransmissionControlBlock::OnDelayedAckTimer(int64_t& /*baseTimeoutMs*/, bool& /*stop*/)
|
|
459
461
|
{
|
|
460
462
|
MS_TRACE();
|
|
461
463
|
|
|
@@ -482,7 +484,7 @@ namespace RTC
|
|
|
482
484
|
}
|
|
483
485
|
|
|
484
486
|
void TransmissionControlBlock::OnBackoffTimer(
|
|
485
|
-
BackoffTimerHandleInterface* backoffTimer,
|
|
487
|
+
BackoffTimerHandleInterface* backoffTimer, int64_t& baseTimeoutMs, bool& stop)
|
|
486
488
|
{
|
|
487
489
|
MS_TRACE();
|
|
488
490
|
|
|
@@ -496,11 +498,11 @@ namespace RTC
|
|
|
496
498
|
}
|
|
497
499
|
}
|
|
498
500
|
|
|
499
|
-
void TransmissionControlBlock::
|
|
501
|
+
void TransmissionControlBlock::OnRetransmissionQueueNewRttUs(int64_t newRttUs)
|
|
500
502
|
{
|
|
501
503
|
MS_TRACE();
|
|
502
504
|
|
|
503
|
-
|
|
505
|
+
ObserveRttUs(newRttUs);
|
|
504
506
|
}
|
|
505
507
|
|
|
506
508
|
void TransmissionControlBlock::OnRetransmissionQueueClearRetransmissionCounter()
|
|
@@ -123,7 +123,7 @@ namespace RTC
|
|
|
123
123
|
uint32_t remoteAdvertisedReceiverWindowCredit,
|
|
124
124
|
uint64_t tieTag,
|
|
125
125
|
const Capabilities& remoteCapabilities,
|
|
126
|
-
|
|
126
|
+
int64_t creationTimestampUs,
|
|
127
127
|
const uint8_t* macKey,
|
|
128
128
|
size_t macKeyLength)
|
|
129
129
|
{
|
|
@@ -148,7 +148,7 @@ namespace RTC
|
|
|
148
148
|
remoteAdvertisedReceiverWindowCredit,
|
|
149
149
|
tieTag,
|
|
150
150
|
remoteCapabilities,
|
|
151
|
-
|
|
151
|
+
creationTimestampUs,
|
|
152
152
|
macKey,
|
|
153
153
|
macKeyLength);
|
|
154
154
|
|
|
@@ -24,7 +24,7 @@ namespace RTC
|
|
|
24
24
|
MS_DUMP_CLEAN(indentation, " rtx packets count: %" PRIu64, this->rtxPacketsCount);
|
|
25
25
|
MS_DUMP_CLEAN(indentation, " rtx bytes count: %" PRIu64, this->rtxBytesCount);
|
|
26
26
|
MS_DUMP_CLEAN(indentation, " current congestion window (bytes): %zu", this->cwndBytes);
|
|
27
|
-
MS_DUMP_CLEAN(indentation, " smoothed round trip time (ms): %"
|
|
27
|
+
MS_DUMP_CLEAN(indentation, " smoothed round trip time (ms): %" PRIi64, this->srttMs);
|
|
28
28
|
MS_DUMP_CLEAN(indentation, " unacked data count: %zu", this->unackDataCount);
|
|
29
29
|
MS_DUMP_CLEAN(
|
|
30
30
|
indentation, " peer's last announced receiver window size: %" PRIu32, this->peerRwndBytes);
|
|
@@ -34,23 +34,23 @@ namespace RTC
|
|
|
34
34
|
" total buffered amount low threshold: %zu",
|
|
35
35
|
this->totalBufferedAmountLowThreshold);
|
|
36
36
|
MS_DUMP_CLEAN(indentation, " default stream priority: %" PRIu16, this->defaultStreamPriority);
|
|
37
|
-
MS_DUMP_CLEAN(indentation, " max rtt (ms): %"
|
|
38
|
-
MS_DUMP_CLEAN(indentation, " initial rto (ms): %"
|
|
39
|
-
MS_DUMP_CLEAN(indentation, " min rto (ms): %"
|
|
40
|
-
MS_DUMP_CLEAN(indentation, " max rto (ms): %"
|
|
41
|
-
MS_DUMP_CLEAN(indentation, " t1-init timeout (ms): %"
|
|
42
|
-
MS_DUMP_CLEAN(indentation, " t1-cookie timeout (ms): %"
|
|
43
|
-
MS_DUMP_CLEAN(indentation, " t2-shutdown timeout (ms): %"
|
|
37
|
+
MS_DUMP_CLEAN(indentation, " max rtt (ms): %" PRIi64, this->maxRttMs);
|
|
38
|
+
MS_DUMP_CLEAN(indentation, " initial rto (ms): %" PRIi64, this->initialRtoMs);
|
|
39
|
+
MS_DUMP_CLEAN(indentation, " min rto (ms): %" PRIi64, this->minRtoMs);
|
|
40
|
+
MS_DUMP_CLEAN(indentation, " max rto (ms): %" PRIi64, this->maxRtoMs);
|
|
41
|
+
MS_DUMP_CLEAN(indentation, " t1-init timeout (ms): %" PRIi64, this->t1InitTimeoutMs);
|
|
42
|
+
MS_DUMP_CLEAN(indentation, " t1-cookie timeout (ms): %" PRIi64, this->t1CookieTimeoutMs);
|
|
43
|
+
MS_DUMP_CLEAN(indentation, " t2-shutdown timeout (ms): %" PRIi64, this->t2ShutdownTimeoutMs);
|
|
44
44
|
MS_DUMP_CLEAN(
|
|
45
45
|
indentation,
|
|
46
46
|
" timer max backoff timeout (ms): %s",
|
|
47
47
|
this->timerMaxBackoffTimeoutMs
|
|
48
48
|
? std::to_string(this->timerMaxBackoffTimeoutMs.value()).c_str()
|
|
49
|
-
|
|
50
|
-
MS_DUMP_CLEAN(indentation, " heartbeat interval (ms): %"
|
|
49
|
+
: "Infinite");
|
|
50
|
+
MS_DUMP_CLEAN(indentation, " heartbeat interval (ms): %" PRIi64, this->heartbeatIntervalMs);
|
|
51
51
|
MS_DUMP_CLEAN(
|
|
52
|
-
indentation, " delayed ack max timeout (ms): %"
|
|
53
|
-
MS_DUMP_CLEAN(indentation, " min rtt variance (ms): %"
|
|
52
|
+
indentation, " delayed ack max timeout (ms): %" PRIi64, this->delayedAckMaxTimeoutMs);
|
|
53
|
+
MS_DUMP_CLEAN(indentation, " min rtt variance (ms): %" PRIi64, this->minRttVarianceMs);
|
|
54
54
|
MS_DUMP_CLEAN(indentation, " initial cwnd mtus: %zu", this->initialCwndMtus);
|
|
55
55
|
MS_DUMP_CLEAN(indentation, " min cwnd mtus: %zu", this->minCwndMtus);
|
|
56
56
|
MS_DUMP_CLEAN(
|
|
@@ -62,12 +62,12 @@ namespace RTC
|
|
|
62
62
|
indentation,
|
|
63
63
|
" max retransmissions: %s",
|
|
64
64
|
this->maxRetransmissions ? std::to_string(this->maxRetransmissions.value()).c_str()
|
|
65
|
-
|
|
65
|
+
: "Infinite");
|
|
66
66
|
MS_DUMP_CLEAN(
|
|
67
67
|
indentation,
|
|
68
68
|
" max init retransmissions: %s",
|
|
69
69
|
this->maxInitRetransmissions ? std::to_string(this->maxInitRetransmissions.value()).c_str()
|
|
70
|
-
|
|
70
|
+
: "Infinite");
|
|
71
71
|
MS_DUMP_CLEAN(
|
|
72
72
|
indentation, " enable partial reliability: %s", this->enablePartialReliability ? "yes" : "no");
|
|
73
73
|
MS_DUMP_CLEAN(
|
|
@@ -256,7 +256,7 @@ namespace RTC
|
|
|
256
256
|
if (
|
|
257
257
|
this->ackState == AckState::IMMEDIATE ||
|
|
258
258
|
(alsoIfDelayed &&
|
|
259
|
-
|
|
259
|
+
(this->ackState == AckState::BECOMING_DELAYED || this->ackState == AckState::DELAYED)))
|
|
260
260
|
{
|
|
261
261
|
UpdateAckState(AckState::IDLE, "should send SACK");
|
|
262
262
|
|
|
@@ -41,9 +41,9 @@ namespace RTC
|
|
|
41
41
|
data.GetMessageId(),
|
|
42
42
|
data.GetFragmentSequenceNumber(),
|
|
43
43
|
(data.IsBeginning() && data.IsEnd() ? "complete"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
: data.IsBeginning() ? "first"
|
|
45
|
+
: data.IsEnd() ? "last"
|
|
46
|
+
: "middle"));
|
|
47
47
|
|
|
48
48
|
const Types::UnwrappedTsn unwrappedTsn = this->tsnUnwrapper.Unwrap(tsn);
|
|
49
49
|
|
|
@@ -144,8 +144,8 @@ namespace RTC
|
|
|
144
144
|
|
|
145
145
|
this->deferredResetStreams->deferredActions.emplace_back(
|
|
146
146
|
[this,
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
newCumulativeTsn,
|
|
148
|
+
skippedStreams2 = std::vector<AnyForwardTsnChunk::SkippedStream>(
|
|
149
149
|
skippedStreams.begin(), skippedStreams.end())]
|
|
150
150
|
{
|
|
151
151
|
this->queuedBytes -= ForwardTsnCost(skippedStreams2.size());
|
|
@@ -24,15 +24,15 @@ namespace RTC
|
|
|
24
24
|
OutstandingData::Item::Item(
|
|
25
25
|
uint32_t outgoingMessageId,
|
|
26
26
|
UserData data,
|
|
27
|
-
|
|
27
|
+
int64_t timeSentUs,
|
|
28
28
|
uint16_t maxRetransmissions,
|
|
29
|
-
|
|
29
|
+
int64_t expiresAtUs,
|
|
30
30
|
std::optional<uint64_t> lifecycleId)
|
|
31
31
|
: outgoingMessageId(outgoingMessageId),
|
|
32
32
|
data(std::move(data)),
|
|
33
|
-
|
|
33
|
+
timeSentUs(timeSentUs),
|
|
34
34
|
maxRetransmissions(maxRetransmissions),
|
|
35
|
-
|
|
35
|
+
expiresAtUs(expiresAtUs),
|
|
36
36
|
lifecycleId(lifecycleId)
|
|
37
37
|
{
|
|
38
38
|
MS_TRACE();
|
|
@@ -90,7 +90,7 @@ namespace RTC
|
|
|
90
90
|
MS_TRACE();
|
|
91
91
|
|
|
92
92
|
MS_ASSERT(
|
|
93
|
-
this->
|
|
93
|
+
this->expiresAtUs != Types::ExpiresAtUsInfinite ||
|
|
94
94
|
this->maxRetransmissions != Types::MaxRetransmitsNoLimit,
|
|
95
95
|
"item should not have infinite expiration time or its retransmission times shouldn't be the maximum");
|
|
96
96
|
|
|
@@ -173,7 +173,7 @@ namespace RTC
|
|
|
173
173
|
return ExtractChunksThatCanFit(this->toBeRetransmitted, maxLength);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
void OutstandingData::ExpireOutstandingChunks(
|
|
176
|
+
void OutstandingData::ExpireOutstandingChunks(int64_t nowUs)
|
|
177
177
|
{
|
|
178
178
|
MS_TRACE();
|
|
179
179
|
|
|
@@ -192,7 +192,7 @@ namespace RTC
|
|
|
192
192
|
{
|
|
193
193
|
// Already abandoned.
|
|
194
194
|
}
|
|
195
|
-
else if (item.IsNacked() && item.HasExpired(
|
|
195
|
+
else if (item.IsNacked() && item.HasExpired(nowUs))
|
|
196
196
|
{
|
|
197
197
|
tsnsToExpire.push_back(tsn);
|
|
198
198
|
}
|
|
@@ -232,9 +232,9 @@ namespace RTC
|
|
|
232
232
|
std::optional<Types::UnwrappedTsn> OutstandingData::Insert(
|
|
233
233
|
uint32_t outgoingMessageId,
|
|
234
234
|
const UserData& data,
|
|
235
|
-
|
|
235
|
+
int64_t timeSentUs,
|
|
236
236
|
uint16_t maxRetransmissions,
|
|
237
|
-
|
|
237
|
+
int64_t expiresAtUs,
|
|
238
238
|
std::optional<uint64_t> lifecycleId)
|
|
239
239
|
{
|
|
240
240
|
MS_TRACE();
|
|
@@ -248,9 +248,9 @@ namespace RTC
|
|
|
248
248
|
|
|
249
249
|
const Types::UnwrappedTsn tsn = GetNextTsn();
|
|
250
250
|
const Item& item = this->outstandingData.emplace_back(
|
|
251
|
-
outgoingMessageId, data.Clone(),
|
|
251
|
+
outgoingMessageId, data.Clone(), timeSentUs, maxRetransmissions, expiresAtUs, lifecycleId);
|
|
252
252
|
|
|
253
|
-
if (item.HasExpired(
|
|
253
|
+
if (item.HasExpired(timeSentUs))
|
|
254
254
|
{
|
|
255
255
|
// No need to send it, it was expired when it was in the send queue.
|
|
256
256
|
MS_WARN_TAG(
|
|
@@ -390,7 +390,7 @@ namespace RTC
|
|
|
390
390
|
return iForwardTsnChunk;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
std::optional<
|
|
393
|
+
std::optional<int64_t> OutstandingData::MeasureRttUs(int64_t nowUs, Types::UnwrappedTsn tsn) const
|
|
394
394
|
{
|
|
395
395
|
MS_TRACE();
|
|
396
396
|
|
|
@@ -406,7 +406,7 @@ namespace RTC
|
|
|
406
406
|
// that were retransmitted (and thus for which it is ambiguous
|
|
407
407
|
// whether the reply was for the first instance of the Chunk or for a
|
|
408
408
|
// later instance)"
|
|
409
|
-
return
|
|
409
|
+
return nowUs - item.GetTimeSentUs();
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
|
|
@@ -772,9 +772,9 @@ namespace RTC
|
|
|
772
772
|
Item& addedItem = this->outstandingData.emplace_back(
|
|
773
773
|
item.GetOutgoingMessageId(),
|
|
774
774
|
std::move(messageEnd),
|
|
775
|
-
/*
|
|
775
|
+
/*timeSentUs*/ 0,
|
|
776
776
|
/*maxRetransmissions*/ 0,
|
|
777
|
-
/*
|
|
777
|
+
/*expiresAtUs*/ Types::ExpiresAtUsInfinite,
|
|
778
778
|
/*lifecycleId*/ std::nullopt);
|
|
779
779
|
|
|
780
780
|
// The added chunk shouldn't be included in `this->unackedPacketBytes`,
|