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,6 +1,11 @@
|
|
|
1
1
|
#ifndef MS_RTC_RTP_RTP_STREAM_SEND_HPP
|
|
2
2
|
#define MS_RTC_RTP_RTP_STREAM_SEND_HPP
|
|
3
3
|
|
|
4
|
+
#include "RTC/RTCP/FeedbackPs.hpp"
|
|
5
|
+
#include "RTC/RTCP/FeedbackRtpNack.hpp"
|
|
6
|
+
#include "RTC/RTCP/Sdes.hpp"
|
|
7
|
+
#include "RTC/RTCP/XrDelaySinceLastRr.hpp"
|
|
8
|
+
#include "RTC/RTCP/XrReceiverReferenceTime.hpp"
|
|
4
9
|
#include "RTC/RTP/RetransmissionBuffer.hpp"
|
|
5
10
|
#include "RTC/RTP/RtpStream.hpp"
|
|
6
11
|
#include "RTC/RTP/SharedPacket.hpp"
|
|
@@ -16,11 +21,11 @@ namespace RTC
|
|
|
16
21
|
/**
|
|
17
22
|
* Maximum retransmission buffer size for video (ms).
|
|
18
23
|
*/
|
|
19
|
-
static constexpr
|
|
24
|
+
static constexpr int64_t MaxRetransmissionDelayForVideoMs{ 2000 };
|
|
20
25
|
/**
|
|
21
26
|
* Maximum retransmission buffer size for audio (ms).
|
|
22
27
|
*/
|
|
23
|
-
static constexpr
|
|
28
|
+
static constexpr int64_t MaxRetransmissionDelayForAudioMs{ 1000 };
|
|
24
29
|
/**
|
|
25
30
|
* How old the last packet sent may be for a Sender Report to still be generated
|
|
26
31
|
* (ms).
|
|
@@ -30,7 +35,7 @@ namespace RTC
|
|
|
30
35
|
* with a 120 ms ptime and screen sharing at 1 fps, so that it only triggers on
|
|
31
36
|
* a stream that has really stopped sending.
|
|
32
37
|
*/
|
|
33
|
-
static constexpr
|
|
38
|
+
static constexpr int64_t MaxSenderReportReferenceAgeMs{ 2000 };
|
|
34
39
|
|
|
35
40
|
public:
|
|
36
41
|
enum class ReceivePacketResult : uint8_t
|
|
@@ -63,7 +68,7 @@ namespace RTC
|
|
|
63
68
|
/**
|
|
64
69
|
* Local time at which the Receiver Reference Time arrived.
|
|
65
70
|
*/
|
|
66
|
-
|
|
71
|
+
int64_t receivedAtUs;
|
|
67
72
|
};
|
|
68
73
|
|
|
69
74
|
public:
|
|
@@ -87,13 +92,14 @@ namespace RTC
|
|
|
87
92
|
|
|
88
93
|
void ReceiveKeyFrameRequest(RTC::RTCP::FeedbackPs::MessageType messageType);
|
|
89
94
|
|
|
90
|
-
void ReceiveRtcpReceiverReport(RTC::RTCP::ReceiverReport* report);
|
|
95
|
+
void ReceiveRtcpReceiverReport(RTC::RTCP::ReceiverReport* report, int64_t receivedAtUs);
|
|
91
96
|
|
|
92
|
-
void ReceiveRtcpXrReceiverReferenceTime(
|
|
97
|
+
void ReceiveRtcpXrReceiverReferenceTime(
|
|
98
|
+
RTC::RTCP::ReceiverReferenceTime* report, int64_t receivedAtUs);
|
|
93
99
|
|
|
94
|
-
RTC::RTCP::SenderReport* GetRtcpSenderReport(
|
|
100
|
+
RTC::RTCP::SenderReport* GetRtcpSenderReport(int64_t nowUs);
|
|
95
101
|
|
|
96
|
-
RTC::RTCP::DelaySinceLastRr::SsrcInfo* GetRtcpXrDelaySinceLastRrSsrcInfo(
|
|
102
|
+
RTC::RTCP::DelaySinceLastRr::SsrcInfo* GetRtcpXrDelaySinceLastRrSsrcInfo(int64_t nowUs);
|
|
97
103
|
|
|
98
104
|
RTC::RTCP::SdesChunk* GetRtcpSdesChunk();
|
|
99
105
|
|
|
@@ -101,16 +107,16 @@ namespace RTC
|
|
|
101
107
|
|
|
102
108
|
void Resume() override;
|
|
103
109
|
|
|
104
|
-
|
|
110
|
+
int64_t GetBitrate(int64_t nowMs) override
|
|
105
111
|
{
|
|
106
112
|
return this->transmissionCounter.GetBitrate(nowMs);
|
|
107
113
|
}
|
|
108
114
|
|
|
109
|
-
|
|
115
|
+
int64_t GetBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer) override;
|
|
110
116
|
|
|
111
|
-
|
|
117
|
+
int64_t GetSpatialLayerBitrate(int64_t nowMs, uint8_t spatialLayer) override;
|
|
112
118
|
|
|
113
|
-
|
|
119
|
+
int64_t GetLayerBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer) override;
|
|
114
120
|
|
|
115
121
|
private:
|
|
116
122
|
void FillRetransmissionContainer(uint16_t seq, uint16_t bitmask);
|
|
@@ -125,9 +131,9 @@ namespace RTC
|
|
|
125
131
|
// Packets lost at last interval for score calculation.
|
|
126
132
|
int32_t lostPriorScore{ 0 };
|
|
127
133
|
// Packets sent at last interval for score calculation.
|
|
128
|
-
uint32_t sentPriorScore{
|
|
134
|
+
uint32_t sentPriorScore{ 0 };
|
|
129
135
|
std::string mid;
|
|
130
|
-
uint16_t rtxSeq{
|
|
136
|
+
uint16_t rtxSeq{ 0 };
|
|
131
137
|
RTC::RtpDataCounter transmissionCounter;
|
|
132
138
|
RTP::RetransmissionBuffer* retransmissionBuffer{ nullptr };
|
|
133
139
|
// Timing data of the most recent Receiver Reference Time received.
|
|
@@ -44,7 +44,7 @@ namespace RTC
|
|
|
44
44
|
/**
|
|
45
45
|
* Local time at which the Sender Report arrived.
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
int64_t receivedAtUs;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
public:
|
|
@@ -105,7 +105,7 @@ namespace RTC
|
|
|
105
105
|
|
|
106
106
|
RTC::RTCP::ReceiverReport* GetRtcpReceiverReport();
|
|
107
107
|
|
|
108
|
-
void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report);
|
|
108
|
+
void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report, int64_t receivedAtUs);
|
|
109
109
|
|
|
110
110
|
protected:
|
|
111
111
|
bool UpdateSeq(const RTP::Packet* packet);
|
|
@@ -124,23 +124,22 @@ namespace RTC
|
|
|
124
124
|
Params params;
|
|
125
125
|
// Others.
|
|
126
126
|
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
|
|
127
|
-
uint16_t maxSeq{
|
|
128
|
-
uint32_t cycles{
|
|
129
|
-
uint32_t baseSeq{
|
|
130
|
-
uint32_t badSeq{
|
|
131
|
-
uint32_t maxPacketTs{
|
|
132
|
-
uint64_t maxPacketMs{ 0u }; // When the packet with highest timestammp was seen.
|
|
127
|
+
uint16_t maxSeq{ 0 }; // Highest seq. number seen.
|
|
128
|
+
uint32_t cycles{ 0 }; // Shifted count of seq. number cycles.
|
|
129
|
+
uint32_t baseSeq{ 0 }; // Base seq number.
|
|
130
|
+
uint32_t badSeq{ 0 }; // Last 'bad' seq number + 1.
|
|
131
|
+
uint32_t maxPacketTs{ 0 }; // Highest timestamp seen.
|
|
133
132
|
int32_t packetsLost{ 0 };
|
|
134
|
-
uint8_t fractionLost{
|
|
135
|
-
size_t packetsDiscarded{
|
|
136
|
-
size_t packetsCount{
|
|
133
|
+
uint8_t fractionLost{ 0 };
|
|
134
|
+
size_t packetsDiscarded{ 0 };
|
|
135
|
+
size_t packetsCount{ 0 };
|
|
137
136
|
|
|
138
137
|
private:
|
|
139
138
|
// Whether at least a RTP packet has been received.
|
|
140
139
|
bool started{ false };
|
|
141
140
|
// Fields for generating Receiver Reports.
|
|
142
|
-
uint32_t expectedPrior{
|
|
143
|
-
uint32_t receivedPrior{
|
|
141
|
+
uint32_t expectedPrior{ 0 };
|
|
142
|
+
uint32_t receivedPrior{ 0 };
|
|
144
143
|
// Timing data of the most recent Sender Report received.
|
|
145
144
|
std::optional<SenderReportTiming> lastSenderReportTiming;
|
|
146
145
|
int32_t reportedPacketsLost{ 0 };
|
|
@@ -8,24 +8,34 @@
|
|
|
8
8
|
|
|
9
9
|
namespace RTC
|
|
10
10
|
{
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Sliding window rate meter.
|
|
13
|
+
*
|
|
14
|
+
* Data is accumulated into a ring of fixed duration items that covers the
|
|
15
|
+
* whole window. The in-window total is kept incrementally, so both Update()
|
|
16
|
+
* and GetRate() are O(1) amortized.
|
|
17
|
+
*
|
|
18
|
+
* It is considered that the time source increases monotonically. Timestamps
|
|
19
|
+
* going backwards are however tolerated (time comparisons are wrap safe):
|
|
20
|
+
* data still within the window is added to the newest item, older data is
|
|
21
|
+
* ignored, and nothing is ever expired ahead of time.
|
|
22
|
+
*/
|
|
13
23
|
class RateCalculator
|
|
14
24
|
{
|
|
15
25
|
public:
|
|
16
|
-
static constexpr
|
|
26
|
+
static constexpr int64_t DefaultWindowSizeMs{ 1000 };
|
|
17
27
|
static constexpr float DefaultBpsScale{ 8000.0f };
|
|
18
|
-
static constexpr uint16_t DefaultWindowItems{
|
|
28
|
+
static constexpr uint16_t DefaultWindowItems{ 100 };
|
|
19
29
|
|
|
20
30
|
public:
|
|
21
31
|
explicit RateCalculator(
|
|
22
|
-
|
|
32
|
+
int64_t windowSizeMs = DefaultWindowSizeMs,
|
|
23
33
|
float scale = DefaultBpsScale,
|
|
24
34
|
uint16_t windowItems = DefaultWindowItems);
|
|
25
35
|
|
|
26
|
-
void Update(size_t size,
|
|
36
|
+
void Update(size_t size, int64_t nowMs);
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
int64_t GetRate(int64_t nowMs);
|
|
29
39
|
|
|
30
40
|
size_t GetBytes() const
|
|
31
41
|
{
|
|
@@ -35,49 +45,45 @@ namespace RTC
|
|
|
35
45
|
void Reset();
|
|
36
46
|
|
|
37
47
|
private:
|
|
38
|
-
|
|
48
|
+
bool SlideWindow(int64_t nowMs);
|
|
39
49
|
|
|
40
50
|
private:
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
size_t
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
size_t
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
// Total
|
|
69
|
-
size_t
|
|
70
|
-
// Last value calculated by GetRate().
|
|
71
|
-
uint32_t lastRate{ 0u };
|
|
72
|
-
// Last time GetRate() was called.
|
|
73
|
-
std::optional<uint64_t> lastTimeMs{ std::nullopt };
|
|
51
|
+
// Window size (in milliseconds). Always >= 1.
|
|
52
|
+
int64_t windowSizeMs{ DefaultWindowSizeMs };
|
|
53
|
+
// Item size (in milliseconds). Always >= 1.
|
|
54
|
+
int64_t itemSizeMs{ 1 };
|
|
55
|
+
// Precomputed `scale / windowSizeMs`.
|
|
56
|
+
double rateScale{ 0.0 };
|
|
57
|
+
// Ring of items, each one holding the count of the data within it. Never
|
|
58
|
+
// empty, and always long enough to cover the whole window.
|
|
59
|
+
std::vector<size_t> buffer;
|
|
60
|
+
// Index of the newest item. Always < buffer.size().
|
|
61
|
+
size_t newestItemIndex{ 0 };
|
|
62
|
+
// Time (in milliseconds) at which the newest item starts.
|
|
63
|
+
int64_t newestItemStartTimeMs{ 0 };
|
|
64
|
+
// Sum of the count of every item.
|
|
65
|
+
size_t totalCount{ 0 };
|
|
66
|
+
// Total bytes accounted for. Not affected by Reset().
|
|
67
|
+
size_t bytes{ 0 };
|
|
68
|
+
// Rate memoized by GetRate(), only valid while both `lastTimeMs` and
|
|
69
|
+
// `lastTotalCount` below still match. `lastTotalCount` is the one that makes
|
|
70
|
+
// any Update() changing the rate invalidate this implicitly, so that the hot
|
|
71
|
+
// path needs no memoization store.
|
|
72
|
+
// NOTE: No "not calculated yet" mark is needed, since the initial and post
|
|
73
|
+
// Reset() state is a valid entry on its own: a zero rate for a zero count.
|
|
74
|
+
int64_t lastRate{ 0 };
|
|
75
|
+
// Time of the latest GetRate() call. Prevents reusing `lastRate` once time
|
|
76
|
+
// has moved on and there is data pending expiration.
|
|
77
|
+
int64_t lastTimeMs{ 0 };
|
|
78
|
+
// Total count at the latest GetRate() call.
|
|
79
|
+
size_t lastTotalCount{ 0 };
|
|
74
80
|
};
|
|
75
81
|
|
|
76
82
|
class RtpDataCounter
|
|
77
83
|
{
|
|
78
84
|
public:
|
|
79
85
|
explicit RtpDataCounter(
|
|
80
|
-
SharedInterface* shared, bool ignorePaddingOnlyPackets,
|
|
86
|
+
SharedInterface* shared, bool ignorePaddingOnlyPackets, int64_t windowSizeMs = 2500)
|
|
81
87
|
: shared(shared), ignorePaddingOnlyPackets(ignorePaddingOnlyPackets), rate(windowSizeMs)
|
|
82
88
|
{
|
|
83
89
|
}
|
|
@@ -85,7 +91,7 @@ namespace RTC
|
|
|
85
91
|
public:
|
|
86
92
|
void Update(const RTC::RTP::Packet* packet);
|
|
87
93
|
|
|
88
|
-
|
|
94
|
+
int64_t GetBitrate(int64_t nowMs)
|
|
89
95
|
{
|
|
90
96
|
return this->rate.GetRate(nowMs);
|
|
91
97
|
}
|
|
@@ -106,7 +112,7 @@ namespace RTC
|
|
|
106
112
|
// account.
|
|
107
113
|
bool ignorePaddingOnlyPackets{ false };
|
|
108
114
|
RateCalculator rate;
|
|
109
|
-
size_t packets{
|
|
115
|
+
size_t packets{ 0 };
|
|
110
116
|
};
|
|
111
117
|
} // namespace RTC
|
|
112
118
|
|
|
@@ -61,13 +61,13 @@ namespace RTC
|
|
|
61
61
|
void SenderReportReceived(const RTC::RTP::RtpStreamRecv* rtpStream);
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Offset between the wall clock of this sender and our own monotonic one (
|
|
64
|
+
* Offset between the wall clock of this sender and our own monotonic one (us).
|
|
65
65
|
*
|
|
66
66
|
* @returns No value while the offset cannot be told yet.
|
|
67
67
|
*/
|
|
68
|
-
std::optional<int64_t>
|
|
68
|
+
std::optional<int64_t> GetClockOffsetUs() const
|
|
69
69
|
{
|
|
70
|
-
return this->clockOffsetEstimator.
|
|
70
|
+
return this->clockOffsetEstimator.GetOffsetUs();
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -79,7 +79,8 @@ namespace RTC
|
|
|
79
79
|
*
|
|
80
80
|
* @returns No value while the capture instant cannot be told yet.
|
|
81
81
|
*/
|
|
82
|
-
std::optional<
|
|
82
|
+
std::optional<int64_t> GetLocalCaptureAtUs(
|
|
83
|
+
const RTC::RTP::RtpStreamRecv* rtpStream, uint32_t ts) const;
|
|
83
84
|
|
|
84
85
|
private:
|
|
85
86
|
// Offset between the wall clock of the sender and our monotonic one.
|
|
@@ -9,9 +9,9 @@ namespace RTC
|
|
|
9
9
|
/**
|
|
10
10
|
* Estimates the offset between the wall clock of a remote sender, as reported in
|
|
11
11
|
* the NTP field of the RTCP Sender Reports it sends, and mediasoup's own monotonic
|
|
12
|
-
* clock. Both are expressed in
|
|
12
|
+
* clock. Both are expressed in microseconds, so the estimated offset satisfies:
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* localUs = remoteUs + offsetUs
|
|
15
15
|
*
|
|
16
16
|
* Each sample is the difference between the arrival time of a Sender Report and
|
|
17
17
|
* the NTP value it carries, so it holds the clock offset plus the one way delay
|
|
@@ -46,19 +46,19 @@ namespace RTC
|
|
|
46
46
|
/**
|
|
47
47
|
* Feed a received RTCP Sender Report.
|
|
48
48
|
*
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
49
|
+
* @param remoteNtpUs - NTP field of the Sender Report, in microseconds.
|
|
50
|
+
* @param localArrivalAtUs - Our local time at which the Sender Report arrived.
|
|
51
51
|
* @param rttMs - RTT towards the sender, or 0 if not known yet.
|
|
52
52
|
*/
|
|
53
|
-
void AddSenderReport(
|
|
53
|
+
void AddSenderReport(int64_t remoteNtpUs, int64_t localArrivalAtUs, int64_t rttMs);
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* The estimated offset, or no value while less than `MinSampleCount` samples
|
|
57
57
|
* have been gathered.
|
|
58
58
|
*/
|
|
59
|
-
std::optional<int64_t>
|
|
59
|
+
std::optional<int64_t> GetOffsetUs() const
|
|
60
60
|
{
|
|
61
|
-
return this->
|
|
61
|
+
return this->offsetUs;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -66,21 +66,21 @@ namespace RTC
|
|
|
66
66
|
* monotonic clock. Returns no value if there is no offset yet or if the given
|
|
67
67
|
* time does not map into our clock.
|
|
68
68
|
*/
|
|
69
|
-
std::optional<
|
|
69
|
+
std::optional<int64_t> RemoteUsToLocalUs(int64_t remoteUs) const;
|
|
70
70
|
|
|
71
71
|
void Reset();
|
|
72
72
|
|
|
73
73
|
private:
|
|
74
|
-
void
|
|
74
|
+
void UpdateOffsetUs();
|
|
75
75
|
|
|
76
76
|
private:
|
|
77
77
|
// Most recent samples, oldest first.
|
|
78
78
|
std::vector<int64_t> samples;
|
|
79
79
|
// Arrival time of the last accepted Sender Report, so that all the Sender
|
|
80
80
|
// Reports of a same compound packet produce a single sample.
|
|
81
|
-
|
|
81
|
+
int64_t lastLocalArrivalAtUs{ 0 };
|
|
82
82
|
// Median of the samples in the window.
|
|
83
|
-
std::optional<int64_t>
|
|
83
|
+
std::optional<int64_t> offsetUs;
|
|
84
84
|
};
|
|
85
85
|
} // namespace RTC
|
|
86
86
|
|
|
@@ -77,6 +77,12 @@ namespace RTC
|
|
|
77
77
|
RTC::Producer* producer,
|
|
78
78
|
RTC::RTP::RtpStreamRecv* rtpStream,
|
|
79
79
|
bool first) override;
|
|
80
|
+
void OnTransportProducerSpatialLayerActivityChanged(
|
|
81
|
+
RTC::Transport* transport,
|
|
82
|
+
RTC::Producer* producer,
|
|
83
|
+
RTC::RTP::RtpStreamRecv* rtpStream,
|
|
84
|
+
uint8_t spatialLayer,
|
|
85
|
+
bool isActive) override;
|
|
80
86
|
void OnTransportProducerRtpPacketReceived(
|
|
81
87
|
RTC::Transport* transport, RTC::Producer* producer, RTC::RTP::Packet* packet) override;
|
|
82
88
|
uint8_t OnTransportNeedWorstRemoteFractionLost(
|
|
@@ -162,9 +162,9 @@ namespace RTC
|
|
|
162
162
|
|
|
163
163
|
public:
|
|
164
164
|
RtpCodecMimeType mimeType;
|
|
165
|
-
uint8_t payloadType{
|
|
166
|
-
uint32_t clockRate{
|
|
167
|
-
uint8_t channels{
|
|
165
|
+
uint8_t payloadType{ 0 };
|
|
166
|
+
uint32_t clockRate{ 0 };
|
|
167
|
+
uint8_t channels{ 1 };
|
|
168
168
|
RTC::Parameters parameters;
|
|
169
169
|
std::vector<RtcpFeedback> rtcpFeedback;
|
|
170
170
|
};
|
|
@@ -178,7 +178,7 @@ namespace RTC
|
|
|
178
178
|
flatbuffers::Offset<FBS::RtpParameters::Rtx> FillBuffer(flatbuffers::FlatBufferBuilder& builder) const;
|
|
179
179
|
|
|
180
180
|
public:
|
|
181
|
-
uint32_t ssrc{
|
|
181
|
+
uint32_t ssrc{ 0 };
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
class RtpEncodingParameters
|
|
@@ -191,18 +191,18 @@ namespace RTC
|
|
|
191
191
|
flatbuffers::FlatBufferBuilder& builder) const;
|
|
192
192
|
|
|
193
193
|
public:
|
|
194
|
-
uint32_t ssrc{
|
|
194
|
+
uint32_t ssrc{ 0 };
|
|
195
195
|
std::string rid;
|
|
196
|
-
uint8_t codecPayloadType{
|
|
196
|
+
uint8_t codecPayloadType{ 0 };
|
|
197
197
|
bool hasCodecPayloadType{ false };
|
|
198
198
|
RtpRtxParameters rtx;
|
|
199
199
|
bool hasRtx{ false };
|
|
200
|
-
|
|
200
|
+
int64_t maxBitrate{ 0 };
|
|
201
201
|
double maxFramerate{ 0 };
|
|
202
202
|
bool dtx{ false };
|
|
203
203
|
std::string scalabilityMode{ "S1T1" };
|
|
204
|
-
uint8_t spatialLayers{
|
|
205
|
-
uint8_t temporalLayers{
|
|
204
|
+
uint8_t spatialLayers{ 1 };
|
|
205
|
+
uint8_t temporalLayers{ 1 };
|
|
206
206
|
bool ksvc{ false };
|
|
207
207
|
};
|
|
208
208
|
|
|
@@ -218,7 +218,7 @@ namespace RTC
|
|
|
218
218
|
|
|
219
219
|
public:
|
|
220
220
|
RtpHeaderExtensionUri::Type type;
|
|
221
|
-
uint8_t id{
|
|
221
|
+
uint8_t id{ 0 };
|
|
222
222
|
bool encrypt{ false };
|
|
223
223
|
RTC::Parameters parameters;
|
|
224
224
|
};
|
|
@@ -345,7 +345,7 @@ namespace RTC
|
|
|
345
345
|
/**
|
|
346
346
|
* Receives SCTP data (hopefully an SCTP packet) from the remote peer.
|
|
347
347
|
*/
|
|
348
|
-
void ReceiveSctpData(const uint8_t* data, size_t len) override;
|
|
348
|
+
void ReceiveSctpData(const uint8_t* data, size_t len, int64_t receivedAtUs) override;
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
351
|
* Get negotiated max outbound streams. Returns 0 if the association is
|
|
@@ -418,65 +418,93 @@ namespace RTC
|
|
|
418
418
|
|
|
419
419
|
bool ValidateReceivedPacket(const Packet* receivedPacket);
|
|
420
420
|
|
|
421
|
-
bool HandleReceivedChunk(
|
|
421
|
+
bool HandleReceivedChunk(
|
|
422
|
+
const Packet* receivedPacket, const Chunk* receivedChunk, int64_t receivedAtUs);
|
|
422
423
|
|
|
423
|
-
void HandleReceivedInitChunk(
|
|
424
|
+
void HandleReceivedInitChunk(
|
|
425
|
+
const Packet* receivedPacket, const InitChunk* receivedInitChunk, int64_t receivedAtUs);
|
|
424
426
|
|
|
425
427
|
void HandleReceivedInitAckChunk(
|
|
426
|
-
const Packet* receivedPacket, const InitAckChunk* receivedInitAckChunk);
|
|
428
|
+
const Packet* receivedPacket, const InitAckChunk* receivedInitAckChunk, int64_t receivedAtUs);
|
|
427
429
|
|
|
428
430
|
void HandleReceivedCookieEchoChunk(
|
|
429
|
-
const Packet* receivedPacket,
|
|
431
|
+
const Packet* receivedPacket,
|
|
432
|
+
const CookieEchoChunk* receivedCookieEchoChunk,
|
|
433
|
+
int64_t receivedAtUs);
|
|
430
434
|
|
|
431
|
-
bool HandleReceivedCookieEchoChunkWithTcb(
|
|
435
|
+
bool HandleReceivedCookieEchoChunkWithTcb(
|
|
436
|
+
const Packet* receivedPacket, const StateCookie* cookie, int64_t receivedAtUs);
|
|
432
437
|
|
|
433
438
|
void HandleReceivedCookieAckChunk(
|
|
434
|
-
const Packet* receivedPacket,
|
|
439
|
+
const Packet* receivedPacket,
|
|
440
|
+
const CookieAckChunk* receivedCookieAckChunk,
|
|
441
|
+
int64_t receivedAtUs);
|
|
435
442
|
|
|
436
443
|
void HandleReceivedShutdownChunk(
|
|
437
|
-
const Packet* receivedPacket, const ShutdownChunk* receivedShutdownChunk);
|
|
444
|
+
const Packet* receivedPacket, const ShutdownChunk* receivedShutdownChunk, int64_t receivedAtUs);
|
|
438
445
|
|
|
439
446
|
void HandleReceivedShutdownAckChunk(
|
|
440
|
-
const Packet* receivedPacket,
|
|
447
|
+
const Packet* receivedPacket,
|
|
448
|
+
const ShutdownAckChunk* receivedShutdownAckChunk,
|
|
449
|
+
int64_t receivedAtUs);
|
|
441
450
|
|
|
442
451
|
void HandleReceivedShutdownCompleteChunk(
|
|
443
|
-
const Packet* receivedPacket,
|
|
452
|
+
const Packet* receivedPacket,
|
|
453
|
+
const ShutdownCompleteChunk* receivedShutdownCompleteChunk,
|
|
454
|
+
int64_t receivedAtUs);
|
|
444
455
|
|
|
445
456
|
void HandleReceivedOperationErrorChunk(
|
|
446
|
-
const Packet* receivedPacket,
|
|
457
|
+
const Packet* receivedPacket,
|
|
458
|
+
const OperationErrorChunk* receivedOperationErrorChunk,
|
|
459
|
+
int64_t receivedAtUs);
|
|
447
460
|
|
|
448
461
|
void HandleReceivedAbortAssociationChunk(
|
|
449
|
-
const Packet* receivedPacket,
|
|
462
|
+
const Packet* receivedPacket,
|
|
463
|
+
const AbortAssociationChunk* receivedAbortAssociationChunk,
|
|
464
|
+
int64_t receivedAtUs);
|
|
450
465
|
|
|
451
466
|
void HandleReceivedHeartbeatRequestChunk(
|
|
452
|
-
const Packet* receivedPacket,
|
|
467
|
+
const Packet* receivedPacket,
|
|
468
|
+
const HeartbeatRequestChunk* receivedHeartbeatRequestChunk,
|
|
469
|
+
int64_t receivedAtUs);
|
|
453
470
|
|
|
454
471
|
void HandleReceivedHeartbeatAckChunk(
|
|
455
|
-
const Packet* receivedPacket,
|
|
472
|
+
const Packet* receivedPacket,
|
|
473
|
+
const HeartbeatAckChunk* receivedHeartbeatAckChunk,
|
|
474
|
+
int64_t receivedAtUs);
|
|
456
475
|
|
|
457
476
|
void HandleReceivedReConfigChunk(
|
|
458
|
-
const Packet* receivedPacket, const ReConfigChunk* receivedReConfigChunk);
|
|
477
|
+
const Packet* receivedPacket, const ReConfigChunk* receivedReConfigChunk, int64_t receivedAtUs);
|
|
459
478
|
|
|
460
479
|
void HandleReceivedForwardTsnChunk(
|
|
461
|
-
const Packet* receivedPacket,
|
|
480
|
+
const Packet* receivedPacket,
|
|
481
|
+
const ForwardTsnChunk* receivedForwardTsnChunk,
|
|
482
|
+
int64_t receivedAtUs);
|
|
462
483
|
|
|
463
484
|
void HandleReceivedIForwardTsnChunk(
|
|
464
|
-
const Packet* receivedPacket,
|
|
485
|
+
const Packet* receivedPacket,
|
|
486
|
+
const IForwardTsnChunk* receivedIForwardTsnChunk,
|
|
487
|
+
int64_t receivedAtUs);
|
|
465
488
|
|
|
466
489
|
void HandleReceivedAnyForwardTsnChunk(
|
|
467
|
-
const Packet* receivedPacket,
|
|
490
|
+
const Packet* receivedPacket,
|
|
491
|
+
const AnyForwardTsnChunk* receivedAnyForwardTsnChunk,
|
|
492
|
+
int64_t receivedAtUs);
|
|
468
493
|
|
|
469
|
-
void HandleReceivedDataChunk(
|
|
494
|
+
void HandleReceivedDataChunk(
|
|
495
|
+
const Packet* receivedPacket, const DataChunk* receivedDataChunk, int64_t receivedAtUs);
|
|
470
496
|
|
|
471
|
-
void HandleReceivedIDataChunk(
|
|
497
|
+
void HandleReceivedIDataChunk(
|
|
498
|
+
const Packet* receivedPacket, const IDataChunk* receivedIDataChunk, int64_t receivedAtUs);
|
|
472
499
|
|
|
473
500
|
void HandleReceivedAnyDataChunk(
|
|
474
|
-
const Packet* receivedPacket, const AnyDataChunk* receivedAnyDataChunk);
|
|
501
|
+
const Packet* receivedPacket, const AnyDataChunk* receivedAnyDataChunk, int64_t receivedAtUs);
|
|
475
502
|
|
|
476
|
-
void HandleReceivedSackChunk(
|
|
503
|
+
void HandleReceivedSackChunk(
|
|
504
|
+
const Packet* receivedPacket, const SackChunk* receivedSackChunk, int64_t receivedAtUs);
|
|
477
505
|
|
|
478
506
|
bool HandleReceivedUnknownChunk(
|
|
479
|
-
const Packet* receivedPacket, const UnknownChunk* receivedUnknownChunk);
|
|
507
|
+
const Packet* receivedPacket, const UnknownChunk* receivedUnknownChunk, int64_t receivedAtUs);
|
|
480
508
|
|
|
481
509
|
/**
|
|
482
510
|
* Verify the MAC and freshness of an authenticated State Cookie received
|
|
@@ -489,13 +517,13 @@ namespace RTC
|
|
|
489
517
|
*
|
|
490
518
|
* @see RFC 9260 section 5.1.4.
|
|
491
519
|
*/
|
|
492
|
-
bool VerifyReceivedStateCookie(const StateCookie* cookie);
|
|
520
|
+
bool VerifyReceivedStateCookie(const StateCookie* cookie, int64_t receivedAtUs);
|
|
493
521
|
|
|
494
|
-
void OnT1InitTimer(
|
|
522
|
+
void OnT1InitTimer(int64_t& baseTimeoutMs, bool& stop);
|
|
495
523
|
|
|
496
|
-
void OnT1CookieTimer(
|
|
524
|
+
void OnT1CookieTimer(int64_t& baseTimeoutMs, bool& stop);
|
|
497
525
|
|
|
498
|
-
void OnT2ShutdownTimer(
|
|
526
|
+
void OnT2ShutdownTimer(int64_t& baseTimeoutMs, bool& stop);
|
|
499
527
|
|
|
500
528
|
template<typename... States>
|
|
501
529
|
void AssertState(States... expectedStates) const;
|
|
@@ -520,7 +548,7 @@ namespace RTC
|
|
|
520
548
|
/* Pure virtual methods inherited from BackoffTimerHandleInterface::Listener. */
|
|
521
549
|
public:
|
|
522
550
|
void OnBackoffTimer(
|
|
523
|
-
BackoffTimerHandleInterface* backoffTimer,
|
|
551
|
+
BackoffTimerHandleInterface* backoffTimer, int64_t& baseTimeoutMs, bool& stop) override;
|
|
524
552
|
|
|
525
553
|
/* Pure virtual methods inherited from TransmissionControlBlockContextInterface::Listener. */
|
|
526
554
|
public:
|
|
@@ -53,14 +53,14 @@ namespace RTC
|
|
|
53
53
|
void HandleReceivedHeartbeatAckChunk(const HeartbeatAckChunk* receivedHeartbeatAckChunk);
|
|
54
54
|
|
|
55
55
|
private:
|
|
56
|
-
void OnIntervalTimer(
|
|
56
|
+
void OnIntervalTimer(int64_t& baseTimeoutMs, bool& stop);
|
|
57
57
|
|
|
58
|
-
void OnTimeoutTimer(
|
|
58
|
+
void OnTimeoutTimer(int64_t& baseTimeoutMs, bool& stop);
|
|
59
59
|
|
|
60
60
|
/* Pure virtual methods inherited from BackoffTimerHandleInterface::Listener. */
|
|
61
61
|
public:
|
|
62
62
|
void OnBackoffTimer(
|
|
63
|
-
BackoffTimerHandleInterface* backoffTimer,
|
|
63
|
+
BackoffTimerHandleInterface* backoffTimer, int64_t& baseTimeoutMs, bool& stop) override;
|
|
64
64
|
|
|
65
65
|
private:
|
|
66
66
|
AssociationListenerDeferrer& associationListenerDeferrer;
|
|
@@ -68,7 +68,7 @@ namespace RTC
|
|
|
68
68
|
SharedInterface* shared;
|
|
69
69
|
TransmissionControlBlockContextInterface* tcbContext;
|
|
70
70
|
// The time for a connection to be idle before a heartbeat is sent.
|
|
71
|
-
const
|
|
71
|
+
const int64_t intervalDurationMs;
|
|
72
72
|
// Adding RTT to the duration will add some jitter, which is good in
|
|
73
73
|
// production, but less good in unit tests, which is why it can be disabled.
|
|
74
74
|
const bool intervalDurationShouldIncludeRtt;
|