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
|
@@ -8,8 +8,8 @@ namespace RTC
|
|
|
8
8
|
{
|
|
9
9
|
/* Static. */
|
|
10
10
|
|
|
11
|
-
static constexpr
|
|
12
|
-
static constexpr
|
|
11
|
+
static constexpr int64_t BweDowngradeConservativeMs{ 10000 };
|
|
12
|
+
static constexpr int64_t BweDowngradeMinActiveMs{ 8000 };
|
|
13
13
|
|
|
14
14
|
/* Instance methods. */
|
|
15
15
|
|
|
@@ -122,23 +122,37 @@ namespace RTC
|
|
|
122
122
|
// Do nothing.
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
void SvcProducerStreamManager::ProducerSpatialLayerActivityChanged(
|
|
126
|
+
RTC::RTP::RtpStreamRecv* /*rtpStream*/, uint8_t /*spatialLayer*/, bool /*isActive*/)
|
|
127
127
|
{
|
|
128
128
|
MS_TRACE();
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
// All spatial layers share a single RTP stream, so neither its score nor its
|
|
131
|
+
// inactivity check can tell that just one of them started or stopped. This is
|
|
132
|
+
// the only chance to reconsider the target layers.
|
|
133
|
+
if (IsActive())
|
|
134
|
+
{
|
|
135
|
+
MayChangeLayers(/*force*/ false);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
int64_t SvcProducerStreamManager::IncreaseLayer(
|
|
140
|
+
int64_t bitrate, bool considerLoss, float lossPercentage, int64_t nowMs)
|
|
141
|
+
{
|
|
142
|
+
MS_TRACE();
|
|
143
|
+
|
|
144
|
+
if (!this->producerRtpStream || this->producerRtpStream->GetScore() == 0)
|
|
131
145
|
{
|
|
132
|
-
return
|
|
146
|
+
return 0;
|
|
133
147
|
}
|
|
134
148
|
|
|
135
149
|
// If already in the preferred layers, do nothing.
|
|
136
150
|
if (this->provisionalTargetLayers == this->preferredLayers)
|
|
137
151
|
{
|
|
138
|
-
return
|
|
152
|
+
return 0;
|
|
139
153
|
}
|
|
140
154
|
|
|
141
|
-
|
|
155
|
+
int64_t virtualBitrate;
|
|
142
156
|
|
|
143
157
|
if (considerLoss)
|
|
144
158
|
{
|
|
@@ -162,7 +176,7 @@ namespace RTC
|
|
|
162
176
|
virtualBitrate = bitrate;
|
|
163
177
|
}
|
|
164
178
|
|
|
165
|
-
|
|
179
|
+
int64_t requiredBitrate{ 0 };
|
|
166
180
|
int16_t spatialLayer{ 0 };
|
|
167
181
|
int16_t temporalLayer{ 0 };
|
|
168
182
|
|
|
@@ -215,7 +229,7 @@ namespace RTC
|
|
|
215
229
|
// layer if the new layer is the temporal layer 0 of a higher spatial
|
|
216
230
|
// layer.
|
|
217
231
|
if (
|
|
218
|
-
this->encodingContext->IsKSvc() && requiredBitrate && temporalLayer == 0 &&
|
|
232
|
+
this->encodingContext->IsKSvc() && requiredBitrate > 0 && temporalLayer == 0 &&
|
|
219
233
|
this->provisionalTargetLayers.spatial > -1 &&
|
|
220
234
|
spatialLayer > this->provisionalTargetLayers.spatial)
|
|
221
235
|
{
|
|
@@ -228,13 +242,13 @@ namespace RTC
|
|
|
228
242
|
}
|
|
229
243
|
else
|
|
230
244
|
{
|
|
231
|
-
requiredBitrate =
|
|
245
|
+
requiredBitrate = 1; // Don't set 0 since it would be ignored.
|
|
232
246
|
}
|
|
233
247
|
}
|
|
234
248
|
|
|
235
249
|
MS_DEBUG_DEV(
|
|
236
|
-
"testing layers %" PRIi16 ":%" PRIi16 " [virtual bitrate:%"
|
|
237
|
-
", required bitrate:%"
|
|
250
|
+
"testing layers %" PRIi16 ":%" PRIi16 " [virtual bitrate:%" PRIi64
|
|
251
|
+
", required bitrate:%" PRIi64 "]",
|
|
238
252
|
spatialLayer,
|
|
239
253
|
temporalLayer,
|
|
240
254
|
virtualBitrate,
|
|
@@ -242,7 +256,7 @@ namespace RTC
|
|
|
242
256
|
|
|
243
257
|
// If active layer, end iterations here. Otherwise move to next spatial
|
|
244
258
|
// layer.
|
|
245
|
-
if (requiredBitrate)
|
|
259
|
+
if (requiredBitrate > 0)
|
|
246
260
|
{
|
|
247
261
|
goto done;
|
|
248
262
|
}
|
|
@@ -263,15 +277,15 @@ namespace RTC
|
|
|
263
277
|
done:
|
|
264
278
|
|
|
265
279
|
// No higher active layers found.
|
|
266
|
-
if (
|
|
280
|
+
if (requiredBitrate <= 0)
|
|
267
281
|
{
|
|
268
|
-
return
|
|
282
|
+
return 0;
|
|
269
283
|
}
|
|
270
284
|
|
|
271
285
|
// No luck.
|
|
272
286
|
if (requiredBitrate > virtualBitrate)
|
|
273
287
|
{
|
|
274
|
-
return
|
|
288
|
+
return 0;
|
|
275
289
|
}
|
|
276
290
|
|
|
277
291
|
// Set provisional layers.
|
|
@@ -279,8 +293,8 @@ namespace RTC
|
|
|
279
293
|
this->provisionalTargetLayers.temporal = temporalLayer;
|
|
280
294
|
|
|
281
295
|
MS_DEBUG_DEV(
|
|
282
|
-
"upgrading to layers %" PRIi16 ":%" PRIi16 " [virtual bitrate:%"
|
|
283
|
-
", required bitrate:%"
|
|
296
|
+
"upgrading to layers %" PRIi16 ":%" PRIi16 " [virtual bitrate:%" PRIi64
|
|
297
|
+
", required bitrate:%" PRIi64 "]",
|
|
284
298
|
this->provisionalTargetLayers.spatial,
|
|
285
299
|
this->provisionalTargetLayers.temporal,
|
|
286
300
|
virtualBitrate,
|
|
@@ -300,7 +314,7 @@ namespace RTC
|
|
|
300
314
|
}
|
|
301
315
|
}
|
|
302
316
|
|
|
303
|
-
void SvcProducerStreamManager::ApplyLayers(
|
|
317
|
+
void SvcProducerStreamManager::ApplyLayers(int64_t rtpStreamActiveMs)
|
|
304
318
|
{
|
|
305
319
|
MS_TRACE();
|
|
306
320
|
|
|
@@ -332,16 +346,16 @@ namespace RTC
|
|
|
332
346
|
}
|
|
333
347
|
}
|
|
334
348
|
|
|
335
|
-
|
|
349
|
+
int64_t SvcProducerStreamManager::GetDesiredBitrate(int64_t nowMs) const
|
|
336
350
|
{
|
|
337
351
|
MS_TRACE();
|
|
338
352
|
|
|
339
|
-
if (!this->producerRtpStream || this->producerRtpStream->GetScore() ==
|
|
353
|
+
if (!this->producerRtpStream || this->producerRtpStream->GetScore() == 0)
|
|
340
354
|
{
|
|
341
|
-
return
|
|
355
|
+
return 0;
|
|
342
356
|
}
|
|
343
357
|
|
|
344
|
-
|
|
358
|
+
int64_t desiredBitrate{ 0 };
|
|
345
359
|
|
|
346
360
|
// When using K-SVC each spatial layer is independent of the others.
|
|
347
361
|
if (this->encodingContext->IsKSvc())
|
|
@@ -564,7 +578,7 @@ namespace RTC
|
|
|
564
578
|
// Start with no layers.
|
|
565
579
|
newTargetLayers.Reset();
|
|
566
580
|
|
|
567
|
-
|
|
581
|
+
const int64_t nowMs = this->shared->GetTimeMs();
|
|
568
582
|
int16_t spatialLayer{ 0 };
|
|
569
583
|
|
|
570
584
|
if (!this->producerRtpStream)
|
|
@@ -19,8 +19,8 @@ namespace RTC
|
|
|
19
19
|
|
|
20
20
|
/* Instance methods. */
|
|
21
21
|
|
|
22
|
-
TcpConnection::TcpConnection(Listener* listener, size_t bufferSize)
|
|
23
|
-
: ::TcpConnectionHandle::TcpConnectionHandle(bufferSize), listener(listener)
|
|
22
|
+
TcpConnection::TcpConnection(Listener* listener, SharedInterface* shared, size_t bufferSize)
|
|
23
|
+
: ::TcpConnectionHandle::TcpConnectionHandle(bufferSize), listener(listener), shared(shared)
|
|
24
24
|
{
|
|
25
25
|
MS_TRACE();
|
|
26
26
|
}
|
|
@@ -34,6 +34,11 @@ namespace RTC
|
|
|
34
34
|
{
|
|
35
35
|
MS_TRACE();
|
|
36
36
|
|
|
37
|
+
// NOTE: Take the arrival time before anything else is done with the read
|
|
38
|
+
// data, so that it doesn't include the cost of processing it. All the frames
|
|
39
|
+
// found within this read share it, since they all arrived in it.
|
|
40
|
+
const int64_t receivedAtUs = this->shared->GetTimeUs();
|
|
41
|
+
|
|
37
42
|
MS_DEBUG_DEV(
|
|
38
43
|
"data received [local:%s :%" PRIu16 ", remote:%s :%" PRIu16 "]",
|
|
39
44
|
GetLocalIp().c_str(),
|
|
@@ -88,7 +93,8 @@ namespace RTC
|
|
|
88
93
|
// later.
|
|
89
94
|
std::memcpy(ReadBuffer, packet, packetLen);
|
|
90
95
|
|
|
91
|
-
this->listener->OnTcpConnectionPacketReceived(
|
|
96
|
+
this->listener->OnTcpConnectionPacketReceived(
|
|
97
|
+
this, ReadBuffer, packetLen, ReadBufferSize, receivedAtUs);
|
|
92
98
|
}
|
|
93
99
|
|
|
94
100
|
// If there is no more space available in the buffer and that is because
|
|
@@ -17,6 +17,7 @@ namespace RTC
|
|
|
17
17
|
TcpServer::TcpServer(
|
|
18
18
|
Listener* listener,
|
|
19
19
|
RTC::TcpConnection::Listener* connListener,
|
|
20
|
+
SharedInterface* shared,
|
|
20
21
|
std::string& ip,
|
|
21
22
|
uint16_t port,
|
|
22
23
|
RTC::Transport::SocketFlags& flags)
|
|
@@ -24,6 +25,7 @@ namespace RTC
|
|
|
24
25
|
::TcpServerHandle::TcpServerHandle(RTC::PortManager::BindTcp(ip, port, flags)),
|
|
25
26
|
listener(listener),
|
|
26
27
|
connListener(connListener),
|
|
28
|
+
shared(shared),
|
|
27
29
|
fixedPort(true)
|
|
28
30
|
{
|
|
29
31
|
MS_TRACE();
|
|
@@ -32,6 +34,7 @@ namespace RTC
|
|
|
32
34
|
TcpServer::TcpServer(
|
|
33
35
|
Listener* listener,
|
|
34
36
|
RTC::TcpConnection::Listener* connListener,
|
|
37
|
+
SharedInterface* shared,
|
|
35
38
|
std::string& ip,
|
|
36
39
|
uint16_t minPort,
|
|
37
40
|
uint16_t maxPort,
|
|
@@ -41,7 +44,8 @@ namespace RTC
|
|
|
41
44
|
::TcpServerHandle::TcpServerHandle(
|
|
42
45
|
RTC::PortManager::BindTcp(ip, minPort, maxPort, flags, portRangeKey)),
|
|
43
46
|
listener(listener),
|
|
44
|
-
connListener(connListener)
|
|
47
|
+
connListener(connListener),
|
|
48
|
+
shared(shared)
|
|
45
49
|
{
|
|
46
50
|
MS_TRACE();
|
|
47
51
|
|
|
@@ -63,7 +67,8 @@ namespace RTC
|
|
|
63
67
|
MS_TRACE();
|
|
64
68
|
|
|
65
69
|
// Allocate a new RTC::TcpConnection for the TcpServer to handle it.
|
|
66
|
-
auto* connection =
|
|
70
|
+
auto* connection =
|
|
71
|
+
new RTC::TcpConnection(this->connListener, this->shared, TcpConnectionBufferSize);
|
|
67
72
|
|
|
68
73
|
// Accept it.
|
|
69
74
|
AcceptTcpConnection(connection);
|