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
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
#define MS_CLASS "RTC::SenderBandwidthEstimator"
|
|
2
|
-
// #define MS_LOG_DEV_LEVEL 3
|
|
3
|
-
|
|
4
|
-
#include "RTC/SenderBandwidthEstimator.hpp"
|
|
5
|
-
#include "Logger.hpp"
|
|
6
|
-
|
|
7
|
-
namespace RTC
|
|
8
|
-
{
|
|
9
|
-
/* Static. */
|
|
10
|
-
|
|
11
|
-
// static constexpr uint64_t AvailableBitrateEventInterval{ 2000u }; // In ms.
|
|
12
|
-
static constexpr uint16_t MaxSentInfoAge{ 2000u }; // TODO: Let's see.
|
|
13
|
-
static constexpr float DefaultRtt{ 100 };
|
|
14
|
-
|
|
15
|
-
/* Instance methods. */
|
|
16
|
-
|
|
17
|
-
SenderBandwidthEstimator::SenderBandwidthEstimator(
|
|
18
|
-
RTC::SenderBandwidthEstimator::Listener* listener,
|
|
19
|
-
SharedInterface* shared,
|
|
20
|
-
uint32_t initialAvailableBitrate)
|
|
21
|
-
: listener(listener),
|
|
22
|
-
shared(shared),
|
|
23
|
-
initialAvailableBitrate(initialAvailableBitrate),
|
|
24
|
-
rtt(DefaultRtt),
|
|
25
|
-
sendTransmission(1000u),
|
|
26
|
-
sendTransmissionTrend(0.15f)
|
|
27
|
-
{
|
|
28
|
-
MS_TRACE();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
SenderBandwidthEstimator::~SenderBandwidthEstimator()
|
|
32
|
-
{
|
|
33
|
-
MS_TRACE();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
void SenderBandwidthEstimator::TransportConnected()
|
|
37
|
-
{
|
|
38
|
-
MS_TRACE();
|
|
39
|
-
|
|
40
|
-
this->availableBitrate = this->initialAvailableBitrate;
|
|
41
|
-
this->lastAvailableBitrateEventAtMs = this->shared->GetTimeMs();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
void SenderBandwidthEstimator::TransportDisconnected()
|
|
45
|
-
{
|
|
46
|
-
MS_TRACE();
|
|
47
|
-
|
|
48
|
-
this->availableBitrate = 0u;
|
|
49
|
-
|
|
50
|
-
this->sentInfos.clear();
|
|
51
|
-
this->cummulativeResult.Reset();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
void SenderBandwidthEstimator::RtpPacketSent(const SentInfo& sentInfo)
|
|
55
|
-
{
|
|
56
|
-
MS_TRACE();
|
|
57
|
-
|
|
58
|
-
auto nowMs = sentInfo.sentAtMs;
|
|
59
|
-
|
|
60
|
-
// Remove old sent infos.
|
|
61
|
-
auto it = this->sentInfos.lower_bound(sentInfo.wideSeq - MaxSentInfoAge + 1);
|
|
62
|
-
|
|
63
|
-
this->sentInfos.erase(this->sentInfos.begin(), it);
|
|
64
|
-
|
|
65
|
-
// Insert the sent info into the map.
|
|
66
|
-
this->sentInfos[sentInfo.wideSeq] = sentInfo;
|
|
67
|
-
|
|
68
|
-
// Fill the send transmission counter.
|
|
69
|
-
this->sendTransmission.Update(sentInfo.size, nowMs);
|
|
70
|
-
|
|
71
|
-
// Update the send transmission trend.
|
|
72
|
-
auto sendBitrate = this->sendTransmission.GetRate(nowMs);
|
|
73
|
-
|
|
74
|
-
this->sendTransmissionTrend.Update(sendBitrate, nowMs);
|
|
75
|
-
|
|
76
|
-
// TODO: Remove.
|
|
77
|
-
// MS_DEBUG_DEV(
|
|
78
|
-
// "[wideSeq:%" PRIu16 ", size:%zu, isProbation:%s, bitrate:%" PRIu32 "]",
|
|
79
|
-
// sentInfo.wideSeq,
|
|
80
|
-
// sentInfo.size,
|
|
81
|
-
// sentInfo.isProbation ? "true" : "false",
|
|
82
|
-
// sendBitrate);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
void SenderBandwidthEstimator::ReceiveRtcpTransportFeedback(
|
|
86
|
-
const RTC::RTCP::FeedbackRtpTransportPacket* feedback)
|
|
87
|
-
{
|
|
88
|
-
MS_TRACE();
|
|
89
|
-
|
|
90
|
-
auto nowMs = this->shared->GetTimeMs();
|
|
91
|
-
const uint64_t elapsedMs = nowMs - this->cummulativeResult.GetStartedAtMs();
|
|
92
|
-
|
|
93
|
-
// Drop ongoing cummulative result if too old.
|
|
94
|
-
if (elapsedMs > 1000u)
|
|
95
|
-
{
|
|
96
|
-
this->cummulativeResult.Reset();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
for (auto& result : feedback->GetPacketResults())
|
|
100
|
-
{
|
|
101
|
-
if (!result.received)
|
|
102
|
-
{
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const uint16_t wideSeq = result.sequenceNumber;
|
|
107
|
-
auto it = this->sentInfos.find(wideSeq);
|
|
108
|
-
|
|
109
|
-
if (it == this->sentInfos.end())
|
|
110
|
-
{
|
|
111
|
-
MS_WARN_DEV("received packet not present in sent infos [wideSeq:%" PRIu16 "]", wideSeq);
|
|
112
|
-
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
auto& sentInfo = it->second;
|
|
117
|
-
|
|
118
|
-
if (!sentInfo.isProbation)
|
|
119
|
-
{
|
|
120
|
-
this->cummulativeResult.AddPacket(
|
|
121
|
-
sentInfo.size, static_cast<int64_t>(sentInfo.sentAtMs), result.receivedAtMs);
|
|
122
|
-
}
|
|
123
|
-
else
|
|
124
|
-
{
|
|
125
|
-
this->probationCummulativeResult.AddPacket(
|
|
126
|
-
sentInfo.size, static_cast<int64_t>(sentInfo.sentAtMs), result.receivedAtMs);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Handle probation packets separately.
|
|
131
|
-
if (this->probationCummulativeResult.GetNumPackets() >= 2u)
|
|
132
|
-
{
|
|
133
|
-
// MS_DEBUG_DEV(
|
|
134
|
-
// "probation [packets:%zu, size:%zu] "
|
|
135
|
-
// "[send bps:%" PRIu32 ", recv bps:%" PRIu32 "] ",
|
|
136
|
-
// this->probationCummulativeResult.GetNumPackets(),
|
|
137
|
-
// this->probationCummulativeResult.GetTotalSize(),
|
|
138
|
-
// this->probationCummulativeResult.GetSendBitrate(),
|
|
139
|
-
// this->probationCummulativeResult.GetReceiveBitrate());
|
|
140
|
-
|
|
141
|
-
EstimateAvailableBitrate(this->probationCummulativeResult);
|
|
142
|
-
|
|
143
|
-
// Reset probation cummulative result.
|
|
144
|
-
this->probationCummulativeResult.Reset();
|
|
145
|
-
}
|
|
146
|
-
else
|
|
147
|
-
{
|
|
148
|
-
// Reset probation cummulative result.
|
|
149
|
-
this->probationCummulativeResult.Reset();
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Handle real and probation packets all together.
|
|
153
|
-
if (elapsedMs >= 100u && this->cummulativeResult.GetNumPackets() >= 20u)
|
|
154
|
-
{
|
|
155
|
-
// auto sendBitrate = this->sendTransmission.GetRate(nowMs);
|
|
156
|
-
// auto sendBitrateTrend = this->sendTransmissionTrend.GetValue();
|
|
157
|
-
|
|
158
|
-
// MS_DEBUG_DEV(
|
|
159
|
-
// "real+prob [packets:%zu, size:%zu] "
|
|
160
|
-
// "[send bps:%" PRIu32 ", recv bps:%" PRIu32
|
|
161
|
-
// "] "
|
|
162
|
-
// "[real bps:%" PRIu32 ", trend bps:%" PRIu32 "]",
|
|
163
|
-
// this->cummulativeResult.GetNumPackets(),
|
|
164
|
-
// this->cummulativeResult.GetTotalSize(),
|
|
165
|
-
// this->cummulativeResult.GetSendBitrate(),
|
|
166
|
-
// this->cummulativeResult.GetReceiveBitrate(),
|
|
167
|
-
// sendBitrate,
|
|
168
|
-
// sendBitrateTrend);
|
|
169
|
-
|
|
170
|
-
EstimateAvailableBitrate(this->cummulativeResult);
|
|
171
|
-
|
|
172
|
-
// Reset cummulative result.
|
|
173
|
-
this->cummulativeResult.Reset();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
void SenderBandwidthEstimator::EstimateAvailableBitrate(CummulativeResult& cummulativeResult)
|
|
178
|
-
{
|
|
179
|
-
MS_TRACE();
|
|
180
|
-
|
|
181
|
-
auto previousAvailableBitrate = this->availableBitrate;
|
|
182
|
-
|
|
183
|
-
const double ratio = static_cast<double>(cummulativeResult.GetReceiveBitrate()) /
|
|
184
|
-
static_cast<double>(cummulativeResult.GetSendBitrate());
|
|
185
|
-
auto bitrate =
|
|
186
|
-
std::min<uint32_t>(cummulativeResult.GetReceiveBitrate(), cummulativeResult.GetSendBitrate());
|
|
187
|
-
|
|
188
|
-
if (0.75f <= ratio && ratio <= 1.25f)
|
|
189
|
-
{
|
|
190
|
-
if (bitrate > this->availableBitrate)
|
|
191
|
-
{
|
|
192
|
-
this->availableBitrate = bitrate;
|
|
193
|
-
|
|
194
|
-
MS_DEBUG_DEV("BWE UP [ratio:%f, availableBitrate:%" PRIu32 "]", ratio, this->availableBitrate);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else
|
|
198
|
-
{
|
|
199
|
-
if (bitrate < this->availableBitrate)
|
|
200
|
-
{
|
|
201
|
-
this->availableBitrate = bitrate;
|
|
202
|
-
|
|
203
|
-
MS_DEBUG_DEV(
|
|
204
|
-
"BWE DOWN [ratio:%f, availableBitrate:%" PRIu32 "]", ratio, this->availableBitrate);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// TODO: No, should wait for AvailableBitrateEventInterval and so on.
|
|
209
|
-
this->listener->OnSenderBandwidthEstimatorAvailableBitrate(
|
|
210
|
-
this, this->availableBitrate, previousAvailableBitrate);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
void SenderBandwidthEstimator::UpdateRtt(float rtt)
|
|
214
|
-
{
|
|
215
|
-
MS_TRACE();
|
|
216
|
-
|
|
217
|
-
this->rtt = rtt;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
uint32_t SenderBandwidthEstimator::GetAvailableBitrate() const
|
|
221
|
-
{
|
|
222
|
-
MS_TRACE();
|
|
223
|
-
|
|
224
|
-
return this->availableBitrate;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
void SenderBandwidthEstimator::RescheduleNextAvailableBitrateEvent()
|
|
228
|
-
{
|
|
229
|
-
MS_TRACE();
|
|
230
|
-
|
|
231
|
-
this->lastAvailableBitrateEventAtMs = this->shared->GetTimeMs();
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
void SenderBandwidthEstimator::CummulativeResult::AddPacket(
|
|
235
|
-
size_t size, int64_t sentAtMs, int64_t receivedAtMs)
|
|
236
|
-
{
|
|
237
|
-
MS_TRACE();
|
|
238
|
-
|
|
239
|
-
if (this->numPackets == 0u)
|
|
240
|
-
{
|
|
241
|
-
this->firstPacketSentAtMs = sentAtMs;
|
|
242
|
-
this->firstPacketReceivedAtMs = receivedAtMs;
|
|
243
|
-
this->lastPacketSentAtMs = sentAtMs;
|
|
244
|
-
this->lastPacketReceivedAtMs = receivedAtMs;
|
|
245
|
-
}
|
|
246
|
-
else
|
|
247
|
-
{
|
|
248
|
-
this->firstPacketSentAtMs = std::min(sentAtMs, this->firstPacketSentAtMs);
|
|
249
|
-
this->firstPacketReceivedAtMs = std::min(receivedAtMs, this->firstPacketReceivedAtMs);
|
|
250
|
-
this->lastPacketSentAtMs = std::max(sentAtMs, this->lastPacketSentAtMs);
|
|
251
|
-
this->lastPacketReceivedAtMs = std::max(receivedAtMs, this->lastPacketReceivedAtMs);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
this->numPackets++;
|
|
255
|
-
this->totalSize += size;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
void SenderBandwidthEstimator::CummulativeResult::Reset()
|
|
259
|
-
{
|
|
260
|
-
MS_TRACE();
|
|
261
|
-
|
|
262
|
-
this->numPackets = 0u;
|
|
263
|
-
this->totalSize = 0u;
|
|
264
|
-
this->firstPacketSentAtMs = 0u;
|
|
265
|
-
this->lastPacketSentAtMs = 0u;
|
|
266
|
-
this->firstPacketReceivedAtMs = 0u;
|
|
267
|
-
this->lastPacketReceivedAtMs = 0u;
|
|
268
|
-
}
|
|
269
|
-
} // namespace RTC
|