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
package/worker/meson.build
CHANGED
|
@@ -26,20 +26,6 @@ if host_machine.system() == 'windows'
|
|
|
26
26
|
]
|
|
27
27
|
endif
|
|
28
28
|
|
|
29
|
-
if get_option('ms_build_tests')
|
|
30
|
-
cpp_args += [
|
|
31
|
-
'-DMS_TEST',
|
|
32
|
-
'-DMS_LOG_STD'
|
|
33
|
-
]
|
|
34
|
-
endif
|
|
35
|
-
|
|
36
|
-
if get_option('ms_build_fuzzer')
|
|
37
|
-
cpp_args += [
|
|
38
|
-
'-DMS_FUZZER',
|
|
39
|
-
'-DMS_LOG_STD'
|
|
40
|
-
]
|
|
41
|
-
endif
|
|
42
|
-
|
|
43
29
|
if get_option('ms_log_trace')
|
|
44
30
|
cpp_args += [
|
|
45
31
|
'-DMS_LOG_TRACE',
|
|
@@ -70,6 +56,26 @@ if get_option('ms_dump_rtp_shared_packet_memory_usage')
|
|
|
70
56
|
]
|
|
71
57
|
endif
|
|
72
58
|
|
|
59
|
+
if get_option('ms_build_tests')
|
|
60
|
+
cpp_args += [
|
|
61
|
+
'-DMS_TEST',
|
|
62
|
+
'-DMS_LOG_STD',
|
|
63
|
+
]
|
|
64
|
+
endif
|
|
65
|
+
|
|
66
|
+
if get_option('ms_build_fuzzer')
|
|
67
|
+
cpp_args += [
|
|
68
|
+
'-DMS_FUZZER',
|
|
69
|
+
'-DMS_LOG_STD',
|
|
70
|
+
]
|
|
71
|
+
endif
|
|
72
|
+
|
|
73
|
+
if get_option('ms_use_builtin_bwe')
|
|
74
|
+
cpp_args += [
|
|
75
|
+
'-DMS_USE_BUILTIN_BWE',
|
|
76
|
+
]
|
|
77
|
+
endif
|
|
78
|
+
|
|
73
79
|
cpp = meson.get_compiler('cpp')
|
|
74
80
|
|
|
75
81
|
# This is a workaround to define FLATBUFFERS_LOCALE_INDEPENDENT=0 outside
|
|
@@ -86,7 +92,6 @@ common_sources = [
|
|
|
86
92
|
'src/lib.cpp',
|
|
87
93
|
'src/DepLibSRTP.cpp',
|
|
88
94
|
'src/DepLibUV.cpp',
|
|
89
|
-
'src/DepLibWebRTC.cpp',
|
|
90
95
|
'src/DepOpenSSL.cpp',
|
|
91
96
|
'src/Logger.cpp',
|
|
92
97
|
'src/MediaSoupErrors.cpp',
|
|
@@ -131,7 +136,6 @@ common_sources = [
|
|
|
131
136
|
'src/RTC/RtpListener.cpp',
|
|
132
137
|
'src/RTC/RtpObserver.cpp',
|
|
133
138
|
'src/RTC/SctpListener.cpp',
|
|
134
|
-
'src/RTC/SenderBandwidthEstimator.cpp',
|
|
135
139
|
'src/RTC/SeqManager.cpp',
|
|
136
140
|
'src/RTC/Serializable.cpp',
|
|
137
141
|
'src/RTC/PipeProducerStreamManager.cpp',
|
|
@@ -143,8 +147,6 @@ common_sources = [
|
|
|
143
147
|
'src/RTC/TcpConnection.cpp',
|
|
144
148
|
'src/RTC/TcpServer.cpp',
|
|
145
149
|
'src/RTC/Transport.cpp',
|
|
146
|
-
'src/RTC/TransportCongestionControlClient.cpp',
|
|
147
|
-
'src/RTC/TransportCongestionControlServer.cpp',
|
|
148
150
|
'src/RTC/TransportTuple.cpp',
|
|
149
151
|
'src/RTC/TrendCalculator.cpp',
|
|
150
152
|
'src/RTC/UdpSocket.cpp',
|
|
@@ -161,6 +163,15 @@ common_sources = [
|
|
|
161
163
|
'src/RTC/RtpDictionaries/RtpParameters.cpp',
|
|
162
164
|
'src/RTC/RtpDictionaries/RtpRtxParameters.cpp',
|
|
163
165
|
'src/RTC/SctpDictionaries/SctpStreamParameters.cpp',
|
|
166
|
+
'src/RTC/BWE/AimdRateControl.cpp',
|
|
167
|
+
'src/RTC/BWE/BweTypes.cpp',
|
|
168
|
+
'src/RTC/BWE/DelayBasedBwe.cpp',
|
|
169
|
+
'src/RTC/BWE/FeedbackAdapter.cpp',
|
|
170
|
+
'src/RTC/BWE/InterArrivalDelta.cpp',
|
|
171
|
+
'src/RTC/BWE/LinkCapacityEstimator.cpp',
|
|
172
|
+
'src/RTC/BWE/RobustThroughputEstimator.cpp',
|
|
173
|
+
'src/RTC/BWE/SendPacketHistory.cpp',
|
|
174
|
+
'src/RTC/BWE/TrendlineEstimator.cpp',
|
|
164
175
|
'src/RTC/ICE/IceCandidate.cpp',
|
|
165
176
|
'src/RTC/ICE/IceServer.cpp',
|
|
166
177
|
'src/RTC/ICE/StunPacket.cpp',
|
|
@@ -287,6 +298,16 @@ common_sources = [
|
|
|
287
298
|
'src/RTC/SCTP/public/Message.cpp',
|
|
288
299
|
]
|
|
289
300
|
|
|
301
|
+
# The deps/libwebrtc bandwidth estimation is only built when the built-in one is
|
|
302
|
+
# not used.
|
|
303
|
+
if not get_option('ms_use_builtin_bwe')
|
|
304
|
+
common_sources += [
|
|
305
|
+
'src/DepLibWebRTC.cpp',
|
|
306
|
+
'src/RTC/TransportCongestionControlClient.cpp',
|
|
307
|
+
'src/RTC/TransportCongestionControlServer.cpp',
|
|
308
|
+
]
|
|
309
|
+
endif
|
|
310
|
+
|
|
290
311
|
libuv_proj = subproject(
|
|
291
312
|
'libuv',
|
|
292
313
|
default_options: [
|
|
@@ -313,14 +334,6 @@ libsrtp3_proj = subproject(
|
|
|
313
334
|
],
|
|
314
335
|
)
|
|
315
336
|
|
|
316
|
-
abseil_cpp_proj = subproject(
|
|
317
|
-
'abseil-cpp',
|
|
318
|
-
default_options: [
|
|
319
|
-
'warning_level=0',
|
|
320
|
-
'cpp_std=c++17',
|
|
321
|
-
],
|
|
322
|
-
)
|
|
323
|
-
|
|
324
337
|
ankerl_unordered_dense_dep = dependency('unordered_dense')
|
|
325
338
|
|
|
326
339
|
flatbuffers_proj = subproject(
|
|
@@ -333,20 +346,13 @@ flatbuffers_proj = subproject(
|
|
|
333
346
|
# flatbuffers schemas subdirectory.
|
|
334
347
|
subdir('fbs')
|
|
335
348
|
|
|
336
|
-
# Add current build directory so libwebrtc has access to FBS folder.
|
|
337
|
-
libwebrtc_include_directories = include_directories('include', 'fbs')
|
|
338
|
-
|
|
339
|
-
subdir('deps/libwebrtc')
|
|
340
|
-
|
|
341
349
|
dependencies = [
|
|
342
350
|
libuv_proj.get_variable('libuv_dep'),
|
|
343
351
|
openssl_proj.get_variable('openssl_dep'),
|
|
344
352
|
libsrtp3_proj.get_variable('libsrtp3_dep'),
|
|
345
|
-
abseil_cpp_proj.get_variable('absl_container_dep'),
|
|
346
353
|
ankerl_unordered_dense_dep,
|
|
347
354
|
flatbuffers_proj.get_variable('flatbuffers_dep'),
|
|
348
355
|
flatbuffers_generator_dep,
|
|
349
|
-
libwebrtc_dep,
|
|
350
356
|
]
|
|
351
357
|
|
|
352
358
|
link_whole = [
|
|
@@ -354,11 +360,34 @@ link_whole = [
|
|
|
354
360
|
openssl_proj.get_variable('libcrypto_lib'),
|
|
355
361
|
openssl_proj.get_variable('libssl_lib'),
|
|
356
362
|
libsrtp3_proj.get_variable('libsrtp3'),
|
|
357
|
-
abseil_cpp_proj.get_variable('absl_container_lib'),
|
|
358
363
|
flatbuffers_proj.get_variable('flatbuffers_lib'),
|
|
359
|
-
libwebrtc,
|
|
360
364
|
]
|
|
361
365
|
|
|
366
|
+
if not get_option('ms_use_builtin_bwe')
|
|
367
|
+
# NOTE: abseil-cpp is in the tree only because deps/libwebrtc needs it.
|
|
368
|
+
abseil_cpp_proj = subproject(
|
|
369
|
+
'abseil-cpp',
|
|
370
|
+
default_options: [
|
|
371
|
+
'warning_level=0',
|
|
372
|
+
'cpp_std=c++17',
|
|
373
|
+
],
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
# Add current build directory so libwebrtc has access to FBS folder.
|
|
377
|
+
libwebrtc_include_directories = include_directories('include', 'fbs')
|
|
378
|
+
|
|
379
|
+
subdir('deps/libwebrtc')
|
|
380
|
+
|
|
381
|
+
dependencies += [
|
|
382
|
+
abseil_cpp_proj.get_variable('absl_container_dep'),
|
|
383
|
+
libwebrtc_dep,
|
|
384
|
+
]
|
|
385
|
+
link_whole += [
|
|
386
|
+
abseil_cpp_proj.get_variable('absl_container_lib'),
|
|
387
|
+
libwebrtc,
|
|
388
|
+
]
|
|
389
|
+
endif
|
|
390
|
+
|
|
362
391
|
if host_machine.system() == 'windows'
|
|
363
392
|
wingetopt_proj = subproject(
|
|
364
393
|
'wingetopt',
|
|
@@ -415,6 +444,7 @@ executable(
|
|
|
415
444
|
mock_sources = [
|
|
416
445
|
'mocks/src/MockShared.cpp',
|
|
417
446
|
'mocks/src/handles/MockBackoffTimerHandle.cpp',
|
|
447
|
+
'mocks/src/handles/MockTimerHandle.cpp',
|
|
418
448
|
'mocks/src/Channel/MockChannelMessageRegistrator.cpp',
|
|
419
449
|
'mocks/src/RTC/SCTP/association/MockTransmissionControlBlockContext.cpp',
|
|
420
450
|
]
|
|
@@ -422,6 +452,7 @@ mock_sources = [
|
|
|
422
452
|
test_sources = [
|
|
423
453
|
'test/src/tests.cpp',
|
|
424
454
|
'test/src/testHelpers.cpp',
|
|
455
|
+
'test/src/TestDepLibUV.cpp',
|
|
425
456
|
'test/src/RTC/TestConsumer.cpp',
|
|
426
457
|
'test/src/RTC/TestPipeProducerStreamManager.cpp',
|
|
427
458
|
'test/src/RTC/TestSimpleProducerStreamManager.cpp',
|
|
@@ -436,9 +467,17 @@ test_sources = [
|
|
|
436
467
|
'test/src/RTC/TestRtpEncodingParameters.cpp',
|
|
437
468
|
'test/src/RTC/TestSeqManager.cpp',
|
|
438
469
|
'test/src/RTC/TestSubchannelsCodec.cpp',
|
|
439
|
-
'test/src/RTC/TestTransportCongestionControlServer.cpp',
|
|
440
470
|
'test/src/RTC/TestTransportTuple.cpp',
|
|
441
471
|
'test/src/RTC/TestTrendCalculator.cpp',
|
|
472
|
+
'test/src/RTC/BWE/helpers/LinkSimulator.cpp',
|
|
473
|
+
'test/src/RTC/BWE/TestAimdRateControl.cpp',
|
|
474
|
+
'test/src/RTC/BWE/TestDelayBasedBwe.cpp',
|
|
475
|
+
'test/src/RTC/BWE/TestFeedbackAdapter.cpp',
|
|
476
|
+
'test/src/RTC/BWE/TestInterArrivalDelta.cpp',
|
|
477
|
+
'test/src/RTC/BWE/TestLinkCapacityEstimator.cpp',
|
|
478
|
+
'test/src/RTC/BWE/TestRobustThroughputEstimator.cpp',
|
|
479
|
+
'test/src/RTC/BWE/TestSendPacketHistory.cpp',
|
|
480
|
+
'test/src/RTC/BWE/TestTrendlineEstimator.cpp',
|
|
442
481
|
'test/src/RTC/ICE/iceCommon.cpp',
|
|
443
482
|
'test/src/RTC/ICE/TestStunPacket.cpp',
|
|
444
483
|
'test/src/RTC/RTP/rtpCommon.cpp',
|
|
@@ -558,6 +597,12 @@ test_sources = [
|
|
|
558
597
|
'test/src/Utils/TestUnwrappedSequenceNumber.cpp',
|
|
559
598
|
]
|
|
560
599
|
|
|
600
|
+
if not get_option('ms_use_builtin_bwe')
|
|
601
|
+
test_sources += [
|
|
602
|
+
'test/src/RTC/TestTransportCongestionControlServer.cpp',
|
|
603
|
+
]
|
|
604
|
+
endif
|
|
605
|
+
|
|
561
606
|
mediasoup_worker_test = executable(
|
|
562
607
|
'mediasoup-worker-test',
|
|
563
608
|
build_by_default: false,
|
package/worker/meson_options.txt
CHANGED
|
@@ -5,3 +5,4 @@ option('ms_dump_rtp_payload_descriptor', type: 'boolean', value: false, descript
|
|
|
5
5
|
option('ms_dump_rtp_shared_packet_memory_usage', type: 'boolean', value: false, description: 'prints information about total memory allocated by RTC::RTP::SharedPacket instances')
|
|
6
6
|
option('ms_build_tests', type: 'boolean', value: false, description: 'Must be enabled when building mediasoup worker tests')
|
|
7
7
|
option('ms_build_fuzzer', type: 'boolean', value: false, description: 'Must be enabled when building mediasoup worker fuzzer')
|
|
8
|
+
option('ms_use_builtin_bwe', type: 'boolean', value: false, description: 'Use the new built-in bandwidth estimation module')
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include "SharedInterface.hpp"
|
|
7
7
|
#include "mocks/include/Channel/MockChannelMessageRegistrator.hpp"
|
|
8
8
|
#include "mocks/include/handles/MockBackoffTimerHandle.hpp"
|
|
9
|
+
#include "mocks/include/handles/MockTimerHandle.hpp"
|
|
9
10
|
#include <map>
|
|
10
11
|
#include <string>
|
|
11
12
|
#include <string_view>
|
|
@@ -15,7 +16,7 @@ namespace mocks
|
|
|
15
16
|
class MockShared : public SharedInterface
|
|
16
17
|
{
|
|
17
18
|
public:
|
|
18
|
-
explicit MockShared(std::function<
|
|
19
|
+
explicit MockShared(std::function<int64_t()> getTimeUs);
|
|
19
20
|
|
|
20
21
|
~MockShared() override = default;
|
|
21
22
|
|
|
@@ -30,45 +31,44 @@ namespace mocks
|
|
|
30
31
|
return this->channelNotifier.get();
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
TimerHandleInterface* CreateTimer(TimerHandleInterface::Listener* listener) override;
|
|
34
|
+
TimerHandleInterface* CreateTimer(TimerHandleInterface::Listener* listener, std::string label) override;
|
|
34
35
|
|
|
35
36
|
BackoffTimerHandleInterface* CreateBackoffTimer(
|
|
36
37
|
const BackoffTimerHandleInterface::BackoffTimerHandleOptions& options) override;
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
int64_t GetTimeMs() override
|
|
39
40
|
{
|
|
40
|
-
return
|
|
41
|
+
return GetTimeUs() / 1000;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
int64_t GetTimeUs() override
|
|
44
45
|
{
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
uint64_t GetTimeNs() override
|
|
49
|
-
{
|
|
50
|
-
return GetTimeMs() * 1000 * 1000;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
int64_t GetTimeMsInt64() override
|
|
54
|
-
{
|
|
55
|
-
return static_cast<int64_t>(GetTimeMs());
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
int64_t GetTimeUsInt64() override
|
|
59
|
-
{
|
|
60
|
-
return static_cast<int64_t>(GetTimeUs());
|
|
46
|
+
return this->getTimeUs();
|
|
61
47
|
}
|
|
62
48
|
|
|
63
49
|
// NOTE: The NTP epoch is made to be the very clock given by argument, so that tests
|
|
64
50
|
// can reason about a single set of values.
|
|
65
|
-
|
|
51
|
+
int64_t GetNtpOffsetUs() override
|
|
66
52
|
{
|
|
67
53
|
return 0;
|
|
68
54
|
}
|
|
69
55
|
|
|
70
56
|
// Methods for testing.
|
|
71
57
|
public:
|
|
58
|
+
MockTimerHandle* GetTimer(const std::string_view label) const
|
|
59
|
+
{
|
|
60
|
+
const auto it = this->timers.find(std::string(label));
|
|
61
|
+
|
|
62
|
+
if (it != this->timers.end())
|
|
63
|
+
{
|
|
64
|
+
return it->second;
|
|
65
|
+
}
|
|
66
|
+
else
|
|
67
|
+
{
|
|
68
|
+
return nullptr;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
72
|
MockBackoffTimerHandle* GetBackoffTimer(const std::string_view label) const
|
|
73
73
|
{
|
|
74
74
|
const auto it = this->backoffTimers.find(std::string(label));
|
|
@@ -85,11 +85,12 @@ namespace mocks
|
|
|
85
85
|
|
|
86
86
|
private:
|
|
87
87
|
// Given by argument.
|
|
88
|
-
const std::function<
|
|
88
|
+
const std::function<int64_t()> getTimeUs;
|
|
89
89
|
// Others.
|
|
90
90
|
std::unique_ptr<::Channel::ChannelSocket> channelSocket;
|
|
91
91
|
std::unique_ptr<mocks::Channel::MockChannelMessageRegistrator> channelMessageRegistrator;
|
|
92
92
|
std::unique_ptr<::Channel::ChannelNotifier> channelNotifier;
|
|
93
|
+
std::map<std::string /*label*/, MockTimerHandle* /*timer*/> timers;
|
|
93
94
|
std::map<std::string /*label*/, MockBackoffTimerHandle* /*backoffTimer*/> backoffTimers;
|
|
94
95
|
};
|
|
95
96
|
} // namespace mocks
|
|
@@ -21,7 +21,7 @@ namespace mocks
|
|
|
21
21
|
: public ::RTC::SCTP::TransmissionControlBlockContextInterface
|
|
22
22
|
{
|
|
23
23
|
public:
|
|
24
|
-
using
|
|
24
|
+
using GetCurrentRtoUsAction = std::function<int64_t()>;
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
explicit MockTransmissionControlBlockContext(
|
|
@@ -49,18 +49,19 @@ namespace mocks
|
|
|
49
49
|
return 0;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
void
|
|
52
|
+
void ObserveRttUs(int64_t rttUs) override
|
|
53
53
|
{
|
|
54
|
-
this->
|
|
54
|
+
this->observeRttUsCallCount++;
|
|
55
|
+
this->observeRttUsCalledWith = rttUs;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
int64_t GetCurrentRtoUs() const override
|
|
58
59
|
{
|
|
59
|
-
if (!this->
|
|
60
|
+
if (!this->getCurrentRtoUsOnceActions.empty())
|
|
60
61
|
{
|
|
61
|
-
auto action = std::move(this->
|
|
62
|
+
auto action = std::move(this->getCurrentRtoUsOnceActions.front());
|
|
62
63
|
|
|
63
|
-
this->
|
|
64
|
+
this->getCurrentRtoUsOnceActions.pop();
|
|
64
65
|
|
|
65
66
|
return action();
|
|
66
67
|
}
|
|
@@ -101,12 +102,19 @@ namespace mocks
|
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
104
|
* @remarks
|
|
104
|
-
* - Must be called before expecting calls to `
|
|
105
|
+
* - Must be called before expecting calls to `ObserveRttUs()`.
|
|
105
106
|
*/
|
|
106
|
-
MockTransmissionControlBlockContext&
|
|
107
|
+
MockTransmissionControlBlockContext& ExpectObserveRttUsCalledTimes(size_t times)
|
|
107
108
|
{
|
|
108
|
-
this->
|
|
109
|
-
this->
|
|
109
|
+
this->observeRttUsCallCount = 0;
|
|
110
|
+
this->expectedObserveRttUsCallCount = times;
|
|
111
|
+
|
|
112
|
+
return *this;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
MockTransmissionControlBlockContext& ExpectObserveRttUsCalledWith(int64_t rttUs)
|
|
116
|
+
{
|
|
117
|
+
this->expectedObserveRttUsCalledWith = rttUs;
|
|
110
118
|
|
|
111
119
|
return *this;
|
|
112
120
|
}
|
|
@@ -123,9 +131,9 @@ namespace mocks
|
|
|
123
131
|
return *this;
|
|
124
132
|
}
|
|
125
133
|
|
|
126
|
-
MockTransmissionControlBlockContext&
|
|
134
|
+
MockTransmissionControlBlockContext& WillGetCurrentRtoUsOnce(GetCurrentRtoUsAction action)
|
|
127
135
|
{
|
|
128
|
-
this->
|
|
136
|
+
this->getCurrentRtoUsOnceActions.push(std::move(action));
|
|
129
137
|
|
|
130
138
|
return *this;
|
|
131
139
|
}
|
|
@@ -133,13 +141,27 @@ namespace mocks
|
|
|
133
141
|
mocks::VerificationResult VerifyExpectations() const
|
|
134
142
|
{
|
|
135
143
|
if (
|
|
136
|
-
this->
|
|
137
|
-
this->
|
|
144
|
+
this->expectedObserveRttUsCallCount.has_value() &&
|
|
145
|
+
this->observeRttUsCallCount != this->expectedObserveRttUsCallCount.value())
|
|
146
|
+
{
|
|
147
|
+
return { .ok = false,
|
|
148
|
+
.errorMessage = "ObserveRttUs() call count mismatch [expected:" +
|
|
149
|
+
std::to_string(this->expectedObserveRttUsCallCount.value()) +
|
|
150
|
+
", got:" + std::to_string(this->observeRttUsCallCount) + "]" };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (
|
|
154
|
+
this->expectedObserveRttUsCalledWith.has_value() &&
|
|
155
|
+
this->observeRttUsCalledWith != this->expectedObserveRttUsCalledWith)
|
|
138
156
|
{
|
|
139
157
|
return { .ok = false,
|
|
140
|
-
|
|
141
|
-
std::to_string(this->
|
|
142
|
-
", got:" +
|
|
158
|
+
.errorMessage = "ObserveRttUs() call mismatch [expected:" +
|
|
159
|
+
std::to_string(this->expectedObserveRttUsCalledWith.value()) +
|
|
160
|
+
", got:" +
|
|
161
|
+
(this->observeRttUsCalledWith.has_value()
|
|
162
|
+
? std::to_string(this->observeRttUsCalledWith.value())
|
|
163
|
+
: "none") +
|
|
164
|
+
"]" };
|
|
143
165
|
}
|
|
144
166
|
|
|
145
167
|
if (
|
|
@@ -148,10 +170,10 @@ namespace mocks
|
|
|
148
170
|
this->expectedIncrementTxErrorCounterCallCount.value())
|
|
149
171
|
{
|
|
150
172
|
return { .ok = false,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
173
|
+
.errorMessage =
|
|
174
|
+
"IncrementTxErrorCounter() call count mismatch [expected:" +
|
|
175
|
+
std::to_string(this->expectedIncrementTxErrorCounterCallCount.value()) +
|
|
176
|
+
", got:" + std::to_string(this->incrementTxErrorCounterCallCount) + "]" };
|
|
155
177
|
}
|
|
156
178
|
|
|
157
179
|
return { .ok = true, .errorMessage = "" };
|
|
@@ -162,12 +184,14 @@ namespace mocks
|
|
|
162
184
|
::RTC::SCTP::AssociationListenerInterface& associationListener;
|
|
163
185
|
const ::RTC::SCTP::SctpOptions sctpOptions;
|
|
164
186
|
|
|
165
|
-
//
|
|
166
|
-
size_t
|
|
167
|
-
std::optional<size_t>
|
|
187
|
+
// ObserveRttUs().
|
|
188
|
+
size_t observeRttUsCallCount{ 0 };
|
|
189
|
+
std::optional<size_t> expectedObserveRttUsCallCount;
|
|
190
|
+
std::optional<int64_t> observeRttUsCalledWith;
|
|
191
|
+
std::optional<int64_t> expectedObserveRttUsCalledWith;
|
|
168
192
|
|
|
169
|
-
//
|
|
170
|
-
mutable std::queue<
|
|
193
|
+
// GetCurrentRtoUs().
|
|
194
|
+
mutable std::queue<GetCurrentRtoUsAction> getCurrentRtoUsOnceActions;
|
|
171
195
|
|
|
172
196
|
// IncrementTxErrorCounter().
|
|
173
197
|
size_t incrementTxErrorCounterCallCount{ 0 };
|
|
@@ -18,7 +18,7 @@ namespace mocks
|
|
|
18
18
|
{
|
|
19
19
|
public:
|
|
20
20
|
using ProduceAction =
|
|
21
|
-
std::function<std::optional<DataToSend>(
|
|
21
|
+
std::function<std::optional<DataToSend>(int64_t /*nowUs*/, size_t /*maxLength*/)>;
|
|
22
22
|
|
|
23
23
|
struct DiscardExpectation
|
|
24
24
|
{
|
|
@@ -40,7 +40,7 @@ namespace mocks
|
|
|
40
40
|
this->messageInterleavingCalledWith = enabled;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
std::optional<DataToSend> Produce(
|
|
43
|
+
std::optional<DataToSend> Produce(int64_t nowUs, size_t maxLength) override
|
|
44
44
|
{
|
|
45
45
|
this->produceCallCount++;
|
|
46
46
|
|
|
@@ -50,11 +50,11 @@ namespace mocks
|
|
|
50
50
|
|
|
51
51
|
this->produceOnceActions.pop();
|
|
52
52
|
|
|
53
|
-
return action(
|
|
53
|
+
return action(nowUs, maxLength);
|
|
54
54
|
}
|
|
55
55
|
else if (this->produceRepeatedlyAction)
|
|
56
56
|
{
|
|
57
|
-
return this->produceRepeatedlyAction(
|
|
57
|
+
return this->produceRepeatedlyAction(nowUs, maxLength);
|
|
58
58
|
}
|
|
59
59
|
else
|
|
60
60
|
{
|
|
@@ -202,10 +202,10 @@ namespace mocks
|
|
|
202
202
|
this->messageInterleavingCalledWith != this->expectedMessageInterleavingCalledWith.value())
|
|
203
203
|
{
|
|
204
204
|
return { .ok = false,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
.errorMessage =
|
|
206
|
+
std::string("EnableMessageInterleaving() call mismatch [expected:") +
|
|
207
|
+
(this->expectedMessageInterleavingCalledWith.value() ? "true" : "false") +
|
|
208
|
+
", got:" + (this->messageInterleavingCalledWith ? "true" : "false") + "]" };
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
if (
|
|
@@ -213,7 +213,7 @@ namespace mocks
|
|
|
213
213
|
this->produceCallCount != this->expectedProduceCallCount.value())
|
|
214
214
|
{
|
|
215
215
|
return { .ok = false,
|
|
216
|
-
|
|
216
|
+
.errorMessage = "Produce() call count mismatch [expected:" +
|
|
217
217
|
std::to_string(this->expectedProduceCallCount.value()) +
|
|
218
218
|
", got:" + std::to_string(this->produceCallCount) + "]" };
|
|
219
219
|
}
|
|
@@ -223,7 +223,7 @@ namespace mocks
|
|
|
223
223
|
this->discardCallCount != this->expectedDiscardCallCount.value())
|
|
224
224
|
{
|
|
225
225
|
return { .ok = false,
|
|
226
|
-
|
|
226
|
+
.errorMessage = "Discard() call count mismatch [expected:" +
|
|
227
227
|
std::to_string(this->expectedDiscardCallCount.value()) +
|
|
228
228
|
", got:" + std::to_string(this->discardCallCount) + "]" };
|
|
229
229
|
}
|
|
@@ -231,7 +231,7 @@ namespace mocks
|
|
|
231
231
|
if (!this->discardExpectations.empty())
|
|
232
232
|
{
|
|
233
233
|
return { .ok = false,
|
|
234
|
-
|
|
234
|
+
.errorMessage = "Discard() has " +
|
|
235
235
|
std::to_string(this->discardExpectations.size()) +
|
|
236
236
|
" unconsumed expectation(s)" };
|
|
237
237
|
}
|
|
@@ -18,7 +18,7 @@ namespace mocks
|
|
|
18
18
|
private:
|
|
19
19
|
explicit MockBackoffTimerHandle(
|
|
20
20
|
BackoffTimerHandleOptions options,
|
|
21
|
-
std::function<
|
|
21
|
+
std::function<int64_t()> getTimeMs,
|
|
22
22
|
std::function<void()> onDelete);
|
|
23
23
|
|
|
24
24
|
public:
|
|
@@ -49,7 +49,7 @@ namespace mocks
|
|
|
49
49
|
// NOTE: Reset the expiration count, just like the real BackoffTimerHandle
|
|
50
50
|
// does.
|
|
51
51
|
this->expirationCount = 0;
|
|
52
|
-
this->expiresAtMs = std::numeric_limits<
|
|
52
|
+
this->expiresAtMs = std::numeric_limits<int64_t>::max();
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -60,7 +60,7 @@ namespace mocks
|
|
|
60
60
|
* during construction bypasses virtual dispatch
|
|
61
61
|
* [clang-analyzer-optin.cplusplus.VirtualCall]"
|
|
62
62
|
*/
|
|
63
|
-
void SetBaseTimeoutMs(
|
|
63
|
+
void SetBaseTimeoutMs(int64_t baseTimeoutMs) override;
|
|
64
64
|
|
|
65
65
|
bool IsRunning() const override
|
|
66
66
|
{
|
|
@@ -84,7 +84,7 @@ namespace mocks
|
|
|
84
84
|
|
|
85
85
|
// Methods for testing.
|
|
86
86
|
public:
|
|
87
|
-
|
|
87
|
+
int64_t GetExpiresAtMs() const
|
|
88
88
|
{
|
|
89
89
|
return this->expiresAtMs;
|
|
90
90
|
}
|
|
@@ -104,7 +104,7 @@ namespace mocks
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
private:
|
|
107
|
-
|
|
107
|
+
int64_t ComputeNextTimeoutMs() const
|
|
108
108
|
{
|
|
109
109
|
auto expirationCount = this->expirationCount;
|
|
110
110
|
|
|
@@ -130,7 +130,7 @@ namespace mocks
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
return std::min<
|
|
133
|
+
return std::min<int64_t>(timeoutMs, BackoffTimerHandleInterface::MaxTimeoutMs);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
NO_DEFAULT_GCC();
|
|
@@ -143,16 +143,16 @@ namespace mocks
|
|
|
143
143
|
// Passed by argument.
|
|
144
144
|
BackoffTimerHandleInterface::Listener* listener{ nullptr };
|
|
145
145
|
const std::string label;
|
|
146
|
-
|
|
146
|
+
int64_t baseTimeoutMs;
|
|
147
147
|
BackoffAlgorithm backoffAlgorithm;
|
|
148
|
-
std::optional<
|
|
148
|
+
std::optional<int64_t> maxBackoffTimeoutMs;
|
|
149
149
|
std::optional<size_t> maxRestarts;
|
|
150
|
-
std::function<
|
|
150
|
+
std::function<int64_t()> getTimeMs;
|
|
151
151
|
const std::function<void()> onDelete;
|
|
152
152
|
// Others.
|
|
153
153
|
bool running{ false };
|
|
154
154
|
size_t expirationCount{ 0 };
|
|
155
|
-
|
|
155
|
+
int64_t expiresAtMs{ std::numeric_limits<int64_t>::max() };
|
|
156
156
|
};
|
|
157
157
|
} // namespace mocks
|
|
158
158
|
|