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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#ifndef MS_RTC_BWE_ROBUST_THROUGHPUT_ESTIMATOR_HPP
|
|
2
|
+
#define MS_RTC_BWE_ROBUST_THROUGHPUT_ESTIMATOR_HPP
|
|
3
|
+
|
|
4
|
+
#include "common.hpp"
|
|
5
|
+
#include "RTC/BWE/AcknowledgedBitrateEstimatorInterface.hpp"
|
|
6
|
+
#include "RTC/BWE/BweTypes.hpp"
|
|
7
|
+
#include <deque>
|
|
8
|
+
|
|
9
|
+
namespace RTC
|
|
10
|
+
{
|
|
11
|
+
namespace BWE
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* Measures the acknowledged bitrate over a sliding window of the packets the
|
|
15
|
+
* receiver reported.
|
|
16
|
+
*
|
|
17
|
+
* The estimate is the smaller of the send rate and the receive rate observed
|
|
18
|
+
* over that window, so that it never claims more than what was actually put
|
|
19
|
+
* on the wire. The largest gap between arrivals is replaced by the second
|
|
20
|
+
* largest one before dividing, which is what keeps a short pause followed by
|
|
21
|
+
* a burst of delayed packets from collapsing the estimate.
|
|
22
|
+
*/
|
|
23
|
+
class RobustThroughputEstimator : public AcknowledgedBitrateEstimatorInterface
|
|
24
|
+
{
|
|
25
|
+
public:
|
|
26
|
+
struct RobustThroughputEstimatorOptions
|
|
27
|
+
{
|
|
28
|
+
/**
|
|
29
|
+
* Smallest number of packets the window holds.
|
|
30
|
+
*/
|
|
31
|
+
size_t windowPackets{ 20 };
|
|
32
|
+
/**
|
|
33
|
+
* Largest number of packets the window holds, so that a high bitrate
|
|
34
|
+
* doesn't make it grow without bound.
|
|
35
|
+
*/
|
|
36
|
+
size_t maxWindowPackets{ 500 };
|
|
37
|
+
/**
|
|
38
|
+
* Smallest duration the window covers, so that a low bitrate still gets
|
|
39
|
+
* enough packets to measure.
|
|
40
|
+
*/
|
|
41
|
+
int64_t minWindowDurationUs{ 1000 * 1000 };
|
|
42
|
+
/**
|
|
43
|
+
* Largest duration the window covers, so that very old packets don't
|
|
44
|
+
* weigh on the estimate after sending was paused.
|
|
45
|
+
*/
|
|
46
|
+
int64_t maxWindowDurationUs{ 5 * 1000 * 1000 };
|
|
47
|
+
/**
|
|
48
|
+
* Number of packets the window needs before it produces an estimate.
|
|
49
|
+
*/
|
|
50
|
+
size_t requiredPackets{ 10 };
|
|
51
|
+
/**
|
|
52
|
+
* Weight given to the data that was sent but is not covered by any
|
|
53
|
+
* feedback.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* - Set it to 0 when audio is not included in the allocation, and to 1
|
|
57
|
+
* when it is included in the allocation but not in the estimation.
|
|
58
|
+
* Its value is irrelevant once every packet is tracked.
|
|
59
|
+
*/
|
|
60
|
+
double unackedWeight{ 1.0 };
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
RobustThroughputEstimator();
|
|
65
|
+
|
|
66
|
+
explicit RobustThroughputEstimator(RobustThroughputEstimatorOptions options);
|
|
67
|
+
|
|
68
|
+
void IncomingPacketFeedbackVector(const std::vector<Types::PacketResult>& packetResults) override;
|
|
69
|
+
|
|
70
|
+
std::optional<int64_t> GetBitrate() const override;
|
|
71
|
+
|
|
72
|
+
void SetAlr(bool /*inAlr*/) override
|
|
73
|
+
{
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
void SetAlrEndedTimeUs(int64_t /*alrEndedTimeUs*/) override
|
|
77
|
+
{
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private:
|
|
81
|
+
/**
|
|
82
|
+
* Whether the oldest packet of the window no longer belongs to it.
|
|
83
|
+
*/
|
|
84
|
+
bool IsFirstPacketOutsideWindow() const;
|
|
85
|
+
|
|
86
|
+
private:
|
|
87
|
+
const RobustThroughputEstimatorOptions options;
|
|
88
|
+
std::deque<Types::PacketResult> window;
|
|
89
|
+
std::optional<int64_t> latestDiscardedSendTimeUs;
|
|
90
|
+
};
|
|
91
|
+
} // namespace BWE
|
|
92
|
+
} // namespace RTC
|
|
93
|
+
|
|
94
|
+
#endif
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#ifndef MS_RTC_BWE_SEND_PACKET_HISTORY_HPP
|
|
2
|
+
#define MS_RTC_BWE_SEND_PACKET_HISTORY_HPP
|
|
3
|
+
|
|
4
|
+
#include "common.hpp"
|
|
5
|
+
#include "RTC/BWE/BweTypes.hpp"
|
|
6
|
+
#include <map>
|
|
7
|
+
#include <tuple>
|
|
8
|
+
|
|
9
|
+
namespace RTC
|
|
10
|
+
{
|
|
11
|
+
namespace BWE
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* Holds every packet that was sent until a feedback reports on it.
|
|
15
|
+
*
|
|
16
|
+
* Packets are indexed by a sequence number of its own, handed out by this
|
|
17
|
+
* history, so that nothing about how a feedback identifies a packet leaks
|
|
18
|
+
* in here. Each packet also keeps its SSRC and RTP sequence number, which
|
|
19
|
+
* is what allows a feedback that identifies packets that way to be resolved
|
|
20
|
+
* against this very same history.
|
|
21
|
+
*
|
|
22
|
+
* It also tracks how many bytes are in flight, which are those that were
|
|
23
|
+
* sent and no feedback has reported on yet.
|
|
24
|
+
*
|
|
25
|
+
* @see https://datatracker.ietf.org/doc/html/draft-holmer-rmcat-transport-wide-cc-extensions
|
|
26
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8888
|
|
27
|
+
*/
|
|
28
|
+
class SendPacketHistory
|
|
29
|
+
{
|
|
30
|
+
public:
|
|
31
|
+
struct SendPacketHistoryOptions
|
|
32
|
+
{
|
|
33
|
+
/**
|
|
34
|
+
* Time a packet is kept for, beyond which a feedback reporting on it
|
|
35
|
+
* arrives too late to be of any use.
|
|
36
|
+
*/
|
|
37
|
+
int64_t windowDurationUs{ 60 * 1000 * 1000 };
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
private:
|
|
41
|
+
struct SentPacketEntry
|
|
42
|
+
{
|
|
43
|
+
Types::SentPacket sentPacket;
|
|
44
|
+
uint32_t ssrc{ 0 };
|
|
45
|
+
uint16_t seq{ 0 };
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
struct SsrcAndSeq
|
|
49
|
+
{
|
|
50
|
+
bool operator<(const SsrcAndSeq& other) const
|
|
51
|
+
{
|
|
52
|
+
return std::tie(this->ssrc, this->seq) < std::tie(other.ssrc, other.seq);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
uint32_t ssrc{ 0 };
|
|
56
|
+
uint16_t seq{ 0 };
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
SendPacketHistory();
|
|
61
|
+
|
|
62
|
+
explicit SendPacketHistory(SendPacketHistoryOptions options);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Take note of a packet that has just been sent.
|
|
66
|
+
*
|
|
67
|
+
* @param size - Size of the packet including overhead up to the IP layer
|
|
68
|
+
* (bytes).
|
|
69
|
+
* @param audio - Whether it's an audio packet. False for video, padding
|
|
70
|
+
* and RTX.
|
|
71
|
+
* @returns The sequence number given to the packet, which is what a
|
|
72
|
+
* feedback has to be resolved into.
|
|
73
|
+
*/
|
|
74
|
+
int64_t AddPacket(uint32_t ssrc, uint16_t seq, size_t size, bool audio, int64_t sentAtUs);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Resolve what a feedback reported about a single packet.
|
|
78
|
+
*
|
|
79
|
+
* @param received - Whether the feedback reported the packet as received.
|
|
80
|
+
* @returns The packet as it was sent, or no value if this history doesn't
|
|
81
|
+
* hold it anymore.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* - Every packet up to the given one stops counting as in flight, since
|
|
85
|
+
* the feedback settles whether it arrived or not.
|
|
86
|
+
* - A packet reported as received is dropped, while one reported as lost
|
|
87
|
+
* is kept, since a later feedback may still report it as received.
|
|
88
|
+
*/
|
|
89
|
+
std::optional<Types::SentPacket> RetrievePacket(int64_t sequenceNumber, bool received);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Same, for a feedback that identifies the packet by its SSRC and RTP
|
|
93
|
+
* sequence number rather than by the sequence number given to it.
|
|
94
|
+
*/
|
|
95
|
+
std::optional<Types::SentPacket> RetrievePacket(uint32_t ssrc, uint16_t seq, bool received);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Sequence number this history gave to the latest packet added, or no
|
|
99
|
+
* value if no packet was ever added.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* - It's the sequence number of this history, not the RTP one, so it
|
|
103
|
+
* never wraps around. It's also the highest a feedback carrying only
|
|
104
|
+
* the lowest bits of it can possibly stand for.
|
|
105
|
+
*/
|
|
106
|
+
std::optional<int64_t> GetLastSequenceNumber() const;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Bytes that were sent and no feedback has reported on yet.
|
|
110
|
+
*/
|
|
111
|
+
size_t GetOutstandingBytes() const
|
|
112
|
+
{
|
|
113
|
+
return this->outstandingBytes;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private:
|
|
117
|
+
void RemoveOutstandingBytes(const SentPacketEntry& entry);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Drop the mapping of a packet, unless the same SSRC and RTP sequence
|
|
121
|
+
* number were sent again afterwards and hence took it over.
|
|
122
|
+
*/
|
|
123
|
+
void RemoveSsrcAndSeq(const SentPacketEntry& entry);
|
|
124
|
+
|
|
125
|
+
private:
|
|
126
|
+
const SendPacketHistoryOptions options;
|
|
127
|
+
std::map<int64_t, SentPacketEntry> history;
|
|
128
|
+
std::map<SsrcAndSeq, int64_t> ssrcAndSeqToSequenceNumber;
|
|
129
|
+
int64_t nextSequenceNumber{ 0 };
|
|
130
|
+
// Sequence numbers are never negative, so this sits below all of them.
|
|
131
|
+
int64_t lastAckSequenceNumber{ -1 };
|
|
132
|
+
size_t outstandingBytes{ 0 };
|
|
133
|
+
};
|
|
134
|
+
} // namespace BWE
|
|
135
|
+
} // namespace RTC
|
|
136
|
+
|
|
137
|
+
#endif
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#ifndef MS_RTC_BWE_TRENDLINE_ESTIMATOR_HPP
|
|
2
|
+
#define MS_RTC_BWE_TRENDLINE_ESTIMATOR_HPP
|
|
3
|
+
|
|
4
|
+
#include "common.hpp"
|
|
5
|
+
#include "RTC/BWE/BweTypes.hpp"
|
|
6
|
+
#include <deque>
|
|
7
|
+
|
|
8
|
+
namespace RTC
|
|
9
|
+
{
|
|
10
|
+
namespace BWE
|
|
11
|
+
{
|
|
12
|
+
/**
|
|
13
|
+
* Detects network congestion from the delay between groups of packets,
|
|
14
|
+
* before any packet is lost.
|
|
15
|
+
*
|
|
16
|
+
* For each pair of consecutive groups it accumulates `arrivalDelta -
|
|
17
|
+
* sendDelta`, smooths it, and fits a least squares line over the last
|
|
18
|
+
* `WindowSize` samples. The slope of that line approximates
|
|
19
|
+
* `(sendRate - capacity) / capacity`, so a positive slope means that queues
|
|
20
|
+
* are filling up somewhere in the network.
|
|
21
|
+
*
|
|
22
|
+
* That slope is compared against a threshold that adapts itself to the
|
|
23
|
+
* observed noise, and overuse is only declared once the condition persists,
|
|
24
|
+
* which is what prevents an isolated jitter spike from bringing the estimate
|
|
25
|
+
* down.
|
|
26
|
+
*/
|
|
27
|
+
class TrendlineEstimator
|
|
28
|
+
{
|
|
29
|
+
private:
|
|
30
|
+
struct PacketTiming
|
|
31
|
+
{
|
|
32
|
+
double arrivalTimeUs;
|
|
33
|
+
double smoothedDelayUs;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
/**
|
|
38
|
+
* Number of samples of the least squares regression window used unless
|
|
39
|
+
* another one is given.
|
|
40
|
+
*/
|
|
41
|
+
static constexpr size_t DefaultWindowSize{ 20 };
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
/**
|
|
45
|
+
* @param windowSize - Number of samples of the least squares regression
|
|
46
|
+
* window. A shorter window reacts sooner at the cost of being noisier.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* - `windowSize` must be at least 2, since a line cannot be fitted to a
|
|
50
|
+
* single point.
|
|
51
|
+
*/
|
|
52
|
+
explicit TrendlineEstimator(size_t windowSize = DefaultWindowSize);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Feed the deltas between two consecutive groups of packets.
|
|
56
|
+
*
|
|
57
|
+
* @param sendDeltaUs - Time elapsed between the send times of both groups.
|
|
58
|
+
* @param arrivalDeltaUs - Time elapsed between the arrival times of both
|
|
59
|
+
* groups.
|
|
60
|
+
* @param arrivalTimeUs - Arrival time of the latest group, in the remote
|
|
61
|
+
* clock reference.
|
|
62
|
+
*/
|
|
63
|
+
void Update(int64_t sendDeltaUs, int64_t arrivalDeltaUs, int64_t arrivalTimeUs);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Current hypothesis about how the network is behaving.
|
|
67
|
+
*/
|
|
68
|
+
Types::BandwidthUsage GetState() const
|
|
69
|
+
{
|
|
70
|
+
return this->state;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
/**
|
|
75
|
+
* Slope of the least squares line fitted to the samples window, or no
|
|
76
|
+
* value if it cannot be computed.
|
|
77
|
+
*/
|
|
78
|
+
std::optional<double> GetLinearFitSlope() const;
|
|
79
|
+
|
|
80
|
+
void Detect(double trend, double sendDeltaUs, int64_t arrivalTimeUs);
|
|
81
|
+
|
|
82
|
+
void UpdateThreshold(double modifiedTrend, int64_t arrivalTimeUs);
|
|
83
|
+
|
|
84
|
+
private:
|
|
85
|
+
const size_t windowSize;
|
|
86
|
+
int numOfDeltas{ 0 };
|
|
87
|
+
std::optional<int64_t> firstArrivalTimeUs;
|
|
88
|
+
double accumulatedDelayUs{ 0 };
|
|
89
|
+
double smoothedDelayUs{ 0 };
|
|
90
|
+
std::deque<PacketTiming> delayHist;
|
|
91
|
+
double threshold{ 12.5 };
|
|
92
|
+
double prevTrend{ 0 };
|
|
93
|
+
std::optional<double> timeOverUsingUs;
|
|
94
|
+
int overuseCounter{ 0 };
|
|
95
|
+
std::optional<int64_t> lastThresholdUpdateAtUs;
|
|
96
|
+
Types::BandwidthUsage state{ Types::BandwidthUsage::NORMAL };
|
|
97
|
+
};
|
|
98
|
+
} // namespace BWE
|
|
99
|
+
} // namespace RTC
|
|
100
|
+
|
|
101
|
+
#endif
|
|
@@ -10,7 +10,7 @@ namespace RTC
|
|
|
10
10
|
/**
|
|
11
11
|
* Max MTU size.
|
|
12
12
|
*/
|
|
13
|
-
constexpr size_t MtuSize{
|
|
13
|
+
constexpr size_t MtuSize{ 1500 };
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Maximum size for a RTCP compound packet.
|
|
@@ -21,23 +21,23 @@ namespace RTC
|
|
|
21
21
|
* be added to an RTCP packet by srtp_protect_rtcp().
|
|
22
22
|
* - srtp.h: SRTP_MAX_TRAILER_LEN (SRTP_MAX_TAG_LEN + SRTP_MAX_MKI_LEN).
|
|
23
23
|
*/
|
|
24
|
-
constexpr size_t RtcpPacketMaxSize{ RTC::Consts::MtuSize - 40 - 20 -
|
|
24
|
+
constexpr size_t RtcpPacketMaxSize{ RTC::Consts::MtuSize - 40 - 20 - 148 };
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Max length for a 1 byte RTP header extension.
|
|
28
28
|
*/
|
|
29
|
-
constexpr uint8_t OneByteRtpExtensionMaxLength{
|
|
29
|
+
constexpr uint8_t OneByteRtpExtensionMaxLength{ 16 };
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Max length for a 2 bytes RTP header extension.
|
|
33
33
|
*/
|
|
34
|
-
constexpr uint8_t TwoBytesRtpExtensionMaxLength{
|
|
34
|
+
constexpr uint8_t TwoBytesRtpExtensionMaxLength{ 255 };
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* MID RTP header extension max length (just used when setting/updating MID
|
|
38
38
|
* extension).
|
|
39
39
|
*/
|
|
40
|
-
constexpr uint8_t MidRtpExtensionMaxLength{
|
|
40
|
+
constexpr uint8_t MidRtpExtensionMaxLength{ 8 };
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Largest safe SCTP packet. Starting from the minimum guaranteed MTU value
|
|
@@ -59,7 +59,7 @@ namespace RTC
|
|
|
59
59
|
* @remarks
|
|
60
60
|
* Value copied from dcSCTP library.
|
|
61
61
|
*/
|
|
62
|
-
constexpr size_t MaxSafeMtuSizeForSctp{
|
|
62
|
+
constexpr size_t MaxSafeMtuSizeForSctp{ 1191 };
|
|
63
63
|
} // namespace Consts
|
|
64
64
|
} // namespace RTC
|
|
65
65
|
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
#include "RTC/RTP/SharedPacket.hpp"
|
|
19
19
|
#include "RTC/RtpDictionaries.hpp"
|
|
20
20
|
#include "RTC/SeqManager.hpp"
|
|
21
|
-
#include "Shared.hpp"
|
|
22
21
|
#include "SharedInterface.hpp"
|
|
23
22
|
#include <ankerl/unordered_dense.h>
|
|
24
23
|
#include <bitset>
|
|
@@ -134,6 +133,8 @@ namespace RTC
|
|
|
134
133
|
void ProducerRtpStreamScores(const std::vector<uint8_t>* scores);
|
|
135
134
|
void ProducerRtpStreamScore(RTC::RTP::RtpStreamRecv* rtpStream, uint8_t score, uint8_t previousScore);
|
|
136
135
|
void ProducerRtcpSenderReport(RTC::RTP::RtpStreamRecv* rtpStream, bool first);
|
|
136
|
+
void ProducerSpatialLayerActivityChanged(
|
|
137
|
+
RTC::RTP::RtpStreamRecv* rtpStream, uint8_t spatialLayer, bool isActive);
|
|
137
138
|
void ProducerClosed();
|
|
138
139
|
void SetExternallyManagedBitrate()
|
|
139
140
|
{
|
|
@@ -141,21 +142,22 @@ namespace RTC
|
|
|
141
142
|
this->producerStreamManager->SetExternallyManagedBitrate();
|
|
142
143
|
}
|
|
143
144
|
uint8_t GetBitratePriority() const;
|
|
144
|
-
|
|
145
|
+
int64_t IncreaseLayer(int64_t bitrate, bool considerLoss);
|
|
145
146
|
void ApplyLayers();
|
|
146
|
-
|
|
147
|
+
int64_t GetDesiredBitrate() const;
|
|
147
148
|
void SendRtpPacket(RTC::RTP::Packet* packet, RTC::RTP::SharedPacket& sharedPacket);
|
|
148
|
-
bool GetRtcp(RTC::RTCP::CompoundPacket* packet,
|
|
149
|
+
bool GetRtcp(RTC::RTCP::CompoundPacket* packet, int64_t nowUs);
|
|
149
150
|
/**
|
|
150
151
|
* Worst remote fraction lost among the RTP streams of this Consumer.
|
|
151
152
|
*/
|
|
152
153
|
uint8_t GetWorstRemoteFractionLost(uint32_t mappedSsrc) const;
|
|
153
154
|
void ReceiveNack(RTC::RTCP::FeedbackRtpNackPacket* nackPacket);
|
|
154
155
|
void ReceiveKeyFrameRequest(RTC::RTCP::FeedbackPs::MessageType messageType, uint32_t ssrc);
|
|
155
|
-
void ReceiveRtcpReceiverReport(RTC::RTCP::ReceiverReport* report);
|
|
156
|
-
void ReceiveRtcpXrReceiverReferenceTime(
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
void ReceiveRtcpReceiverReport(RTC::RTCP::ReceiverReport* report, int64_t receivedAtUs);
|
|
157
|
+
void ReceiveRtcpXrReceiverReferenceTime(
|
|
158
|
+
RTC::RTCP::ReceiverReferenceTime* report, int64_t receivedAtUs);
|
|
159
|
+
int64_t GetTransmissionRate(int64_t nowMs);
|
|
160
|
+
float GetRttMs() const;
|
|
159
161
|
|
|
160
162
|
/* Methods inherited from Channel::ChannelSocket::RequestHandler. */
|
|
161
163
|
public:
|
|
@@ -215,11 +217,11 @@ namespace RTC
|
|
|
215
217
|
struct RTC::RTP::HeaderExtensionIds rtpHeaderExtensionIds;
|
|
216
218
|
const std::vector<uint8_t>* producerRtpStreamScores{ nullptr };
|
|
217
219
|
// Others.
|
|
218
|
-
std::bitset<
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
std::bitset<128> supportedCodecPayloadTypes;
|
|
221
|
+
int64_t lastRtcpSentAtUs{ 0 };
|
|
222
|
+
int64_t maxRtcpIntervalMs{ 0 };
|
|
221
223
|
bool externallyManagedBitrate{ false };
|
|
222
|
-
uint8_t priority{
|
|
224
|
+
uint8_t priority{ 1 };
|
|
223
225
|
struct TraceEventTypes traceEventTypes;
|
|
224
226
|
|
|
225
227
|
private:
|
|
@@ -125,7 +125,7 @@ namespace RTC
|
|
|
125
125
|
// Passed by argument.
|
|
126
126
|
SharedInterface* shared{ nullptr };
|
|
127
127
|
RTC::DataConsumer::Listener* listener{ nullptr };
|
|
128
|
-
size_t maxMessageSize{
|
|
128
|
+
size_t maxMessageSize{ 0 };
|
|
129
129
|
bool pipe{ false };
|
|
130
130
|
// Others.
|
|
131
131
|
Type type;
|
|
@@ -137,8 +137,8 @@ namespace RTC
|
|
|
137
137
|
bool paused{ false };
|
|
138
138
|
bool dataProducerPaused{ false };
|
|
139
139
|
bool dataProducerClosed{ false };
|
|
140
|
-
size_t messagesSent{
|
|
141
|
-
size_t bytesSent{
|
|
140
|
+
size_t messagesSent{ 0 };
|
|
141
|
+
size_t bytesSent{ 0 };
|
|
142
142
|
};
|
|
143
143
|
} // namespace RTC
|
|
144
144
|
|
|
@@ -87,7 +87,7 @@ namespace RTC
|
|
|
87
87
|
private:
|
|
88
88
|
// Passed by argument.
|
|
89
89
|
SharedInterface* shared{ nullptr };
|
|
90
|
-
size_t maxMessageSize{
|
|
90
|
+
size_t maxMessageSize{ 0 };
|
|
91
91
|
RTC::DataProducer::Listener* listener{ nullptr };
|
|
92
92
|
// Others.
|
|
93
93
|
Type type;
|
|
@@ -95,8 +95,8 @@ namespace RTC
|
|
|
95
95
|
std::string label;
|
|
96
96
|
std::string protocol;
|
|
97
97
|
bool paused{ false };
|
|
98
|
-
size_t messagesReceived{
|
|
99
|
-
size_t bytesReceived{
|
|
98
|
+
size_t messagesReceived{ 0 };
|
|
99
|
+
size_t bytesReceived{ 0 };
|
|
100
100
|
};
|
|
101
101
|
} // namespace RTC
|
|
102
102
|
|
|
@@ -91,7 +91,10 @@ namespace RTC
|
|
|
91
91
|
const RTC::DtlsTransport* dtlsTransport, const uint8_t* data, size_t len) = 0;
|
|
92
92
|
// DTLS application data received.
|
|
93
93
|
virtual void OnDtlsTransportApplicationDataReceived(
|
|
94
|
-
const RTC::DtlsTransport* dtlsTransport,
|
|
94
|
+
const RTC::DtlsTransport* dtlsTransport,
|
|
95
|
+
const uint8_t* data,
|
|
96
|
+
size_t len,
|
|
97
|
+
int64_t receivedAtUs) = 0;
|
|
95
98
|
};
|
|
96
99
|
|
|
97
100
|
public:
|
|
@@ -143,7 +146,7 @@ namespace RTC
|
|
|
143
146
|
void Dump(int indentation = 0) const;
|
|
144
147
|
void Run(Role localRole);
|
|
145
148
|
bool SetRemoteFingerprint(const Fingerprint& fingerprint);
|
|
146
|
-
void ProcessDtlsData(const uint8_t* data, size_t len);
|
|
149
|
+
void ProcessDtlsData(const uint8_t* data, size_t len, int64_t receivedAtUs);
|
|
147
150
|
DtlsState GetState() const
|
|
148
151
|
{
|
|
149
152
|
return this->state;
|
|
@@ -80,10 +80,10 @@ namespace RTC
|
|
|
80
80
|
private:
|
|
81
81
|
// Others.
|
|
82
82
|
std::string foundation;
|
|
83
|
-
uint32_t priority{
|
|
83
|
+
uint32_t priority{ 0 };
|
|
84
84
|
std::string address;
|
|
85
85
|
Protocol protocol;
|
|
86
|
-
uint16_t port{
|
|
86
|
+
uint16_t port{ 0 };
|
|
87
87
|
CandidateType type{ CandidateType::HOST };
|
|
88
88
|
TcpCandidateType tcpType{ TcpCandidateType::PASSIVE };
|
|
89
89
|
};
|
|
@@ -121,7 +121,7 @@ namespace RTC
|
|
|
121
121
|
void SetSelectedTuple(RTC::TransportTuple* storedTuple);
|
|
122
122
|
bool IsConsentCheckSupported() const
|
|
123
123
|
{
|
|
124
|
-
return this->consentTimeoutMs !=
|
|
124
|
+
return this->consentTimeoutMs != 0;
|
|
125
125
|
}
|
|
126
126
|
bool IsConsentCheckRunning() const
|
|
127
127
|
{
|
|
@@ -141,12 +141,12 @@ namespace RTC
|
|
|
141
141
|
SharedInterface* shared{ nullptr };
|
|
142
142
|
std::string usernameFragment;
|
|
143
143
|
std::string password;
|
|
144
|
-
|
|
144
|
+
int64_t consentTimeoutMs{ 30000 };
|
|
145
145
|
// Others.
|
|
146
146
|
std::string oldUsernameFragment;
|
|
147
147
|
std::string oldPassword;
|
|
148
148
|
IceState state{ IceState::NEW };
|
|
149
|
-
uint32_t remoteNomination{
|
|
149
|
+
uint32_t remoteNomination{ 0 };
|
|
150
150
|
std::list<RTC::TransportTuple> tuples;
|
|
151
151
|
RTC::TransportTuple* selectedTuple{ nullptr };
|
|
152
152
|
TimerHandleInterface* consentCheckTimer{ nullptr };
|
|
@@ -64,7 +64,7 @@ namespace RTC
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
public:
|
|
67
|
-
KeyFrameRequestDelayer(Listener* listener, SharedInterface* shared, uint32_t ssrc,
|
|
67
|
+
KeyFrameRequestDelayer(Listener* listener, SharedInterface* shared, uint32_t ssrc, int64_t delayMs);
|
|
68
68
|
~KeyFrameRequestDelayer() override;
|
|
69
69
|
|
|
70
70
|
uint32_t GetSsrc() const
|
|
@@ -106,7 +106,7 @@ namespace RTC
|
|
|
106
106
|
|
|
107
107
|
public:
|
|
108
108
|
explicit KeyFrameRequestManager(
|
|
109
|
-
Listener* listener, SharedInterface* shared,
|
|
109
|
+
Listener* listener, SharedInterface* shared, int64_t keyFrameRequestDelayMs);
|
|
110
110
|
~KeyFrameRequestManager() override;
|
|
111
111
|
|
|
112
112
|
void KeyFrameNeeded(uint32_t ssrc);
|
|
@@ -124,7 +124,7 @@ namespace RTC
|
|
|
124
124
|
private:
|
|
125
125
|
Listener* listener{ nullptr };
|
|
126
126
|
SharedInterface* shared{ nullptr };
|
|
127
|
-
|
|
127
|
+
int64_t keyFrameRequestDelayMs{ 0 }; // 0 means disabled.
|
|
128
128
|
ankerl::unordered_dense::map<uint32_t, PendingKeyFrameInfo*> mapSsrcPendingKeyFrameInfo;
|
|
129
129
|
ankerl::unordered_dense::map<uint32_t, KeyFrameRequestDelayer*> mapSsrcKeyFrameRequestDelayer;
|
|
130
130
|
};
|
|
@@ -28,16 +28,16 @@ namespace RTC
|
|
|
28
28
|
private:
|
|
29
29
|
struct NackInfo
|
|
30
30
|
{
|
|
31
|
-
explicit NackInfo(
|
|
31
|
+
explicit NackInfo(int64_t createdAtMs, uint16_t seq, uint16_t sendAtSeq)
|
|
32
32
|
: createdAtMs(createdAtMs), seq(seq), sendAtSeq(sendAtSeq)
|
|
33
33
|
{
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
uint16_t seq{
|
|
38
|
-
uint16_t sendAtSeq{
|
|
39
|
-
|
|
40
|
-
uint8_t retries{
|
|
36
|
+
int64_t createdAtMs{ 0 };
|
|
37
|
+
uint16_t seq{ 0 };
|
|
38
|
+
uint16_t sendAtSeq{ 0 };
|
|
39
|
+
int64_t sentAtMs{ 0 };
|
|
40
|
+
uint8_t retries{ 0 };
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
enum class NackFilter : uint8_t
|
|
@@ -47,7 +47,7 @@ namespace RTC
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
public:
|
|
50
|
-
explicit NackGenerator(Listener* listener, SharedInterface* shared,
|
|
50
|
+
explicit NackGenerator(Listener* listener, SharedInterface* shared, int64_t sendNackDelayMs);
|
|
51
51
|
~NackGenerator() override;
|
|
52
52
|
|
|
53
53
|
bool ReceivePacket(const RTC::RTP::Packet* packet, bool isRecovered);
|
|
@@ -55,9 +55,9 @@ namespace RTC
|
|
|
55
55
|
{
|
|
56
56
|
return this->nackList.size();
|
|
57
57
|
}
|
|
58
|
-
void
|
|
58
|
+
void UpdateRttMs(int64_t rttMs)
|
|
59
59
|
{
|
|
60
|
-
this->
|
|
60
|
+
this->rttMs = rttMs;
|
|
61
61
|
}
|
|
62
62
|
void Reset();
|
|
63
63
|
|
|
@@ -75,7 +75,7 @@ namespace RTC
|
|
|
75
75
|
// Passed by argument.
|
|
76
76
|
Listener* listener{ nullptr };
|
|
77
77
|
SharedInterface* shared{ nullptr };
|
|
78
|
-
|
|
78
|
+
int64_t sendNackDelayMs{ 0 };
|
|
79
79
|
// Allocated by this.
|
|
80
80
|
TimerHandleInterface* timer{ nullptr };
|
|
81
81
|
// Others.
|
|
@@ -83,8 +83,8 @@ namespace RTC
|
|
|
83
83
|
std::set<uint16_t, RTC::SeqManager<uint16_t>::SeqLowerThan> keyFrameList;
|
|
84
84
|
std::set<uint16_t, RTC::SeqManager<uint16_t>::SeqLowerThan> recoveredList;
|
|
85
85
|
bool started{ false };
|
|
86
|
-
uint16_t lastSeq{
|
|
87
|
-
|
|
86
|
+
uint16_t lastSeq{ 0 }; // Seq number of last valid packet.
|
|
87
|
+
int64_t rttMs{ 0 };
|
|
88
88
|
};
|
|
89
89
|
} // namespace RTC
|
|
90
90
|
|
|
@@ -50,10 +50,9 @@ namespace RTC
|
|
|
50
50
|
void ProducerRtpStreamScore(
|
|
51
51
|
RTC::RTP::RtpStreamRecv* rtpStream, uint8_t score, uint8_t previousScore) override;
|
|
52
52
|
void ProducerRtcpSenderReport(RTC::RTP::RtpStreamRecv* rtpStream, bool first) override;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
uint32_t GetDesiredBitrate(uint64_t nowMs) const override;
|
|
53
|
+
int64_t IncreaseLayer(int64_t bitrate, bool considerLoss, float lossPercentage, int64_t nowMs) override;
|
|
54
|
+
void ApplyLayers(int64_t rtpStreamActiveMs) override;
|
|
55
|
+
int64_t GetDesiredBitrate(int64_t nowMs) const override;
|
|
57
56
|
RtpPacketProcessResult ProcessRtpPacket(
|
|
58
57
|
RTC::RTP::Packet* packet,
|
|
59
58
|
bool lastSentPacketHasMarker,
|