mediasoup 3.26.0 → 3.27.1
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 +16 -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/FBS/meson.build +25 -0
- package/worker/fbs/meson.build +15 -18
- 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/LossBasedController.hpp +520 -0
- package/worker/include/RTC/BWE/RobustThroughputEstimator.hpp +94 -0
- package/worker/include/RTC/BWE/SendPacketHistory.hpp +137 -0
- package/worker/include/RTC/BWE/TargetRateController.hpp +306 -0
- package/worker/include/RTC/BWE/TrendlineEstimator.hpp +143 -0
- package/worker/include/RTC/BWE/Utils.hpp +39 -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 +38 -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 +6 -6
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +10 -0
- 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 +87 -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/LossBasedController.cpp +1046 -0
- package/worker/src/RTC/BWE/RobustThroughputEstimator.cpp +245 -0
- package/worker/src/RTC/BWE/SendPacketHistory.cpp +184 -0
- package/worker/src/RTC/BWE/TargetRateController.cpp +435 -0
- package/worker/src/RTC/BWE/TrendlineEstimator.cpp +311 -0
- package/worker/src/RTC/BWE/Utils.cpp +54 -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 +146 -103
- 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 +122 -14
- 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 +2 -2
- 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 +266 -307
- 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 +197 -45
- 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/TestLossBasedController.cpp +1199 -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/TestTargetRateController.cpp +337 -0
- package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +182 -0
- package/worker/test/src/RTC/BWE/TestUtils.cpp +61 -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 +128 -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,245 @@
|
|
|
1
|
+
#define MS_CLASS "RTC::BWE::RobustThroughputEstimator"
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
3
|
+
|
|
4
|
+
#include "RTC/BWE/RobustThroughputEstimator.hpp"
|
|
5
|
+
#include "Logger.hpp"
|
|
6
|
+
#include <cmath>
|
|
7
|
+
|
|
8
|
+
namespace RTC
|
|
9
|
+
{
|
|
10
|
+
namespace BWE
|
|
11
|
+
{
|
|
12
|
+
/* Static. */
|
|
13
|
+
|
|
14
|
+
// Difference between arrival times beyond which the window is dropped, since
|
|
15
|
+
// such a jump means either severe reordering or that the remote clock moved.
|
|
16
|
+
static constexpr int64_t MaxReorderingTimeUs{ 1000 * 1000 };
|
|
17
|
+
// Smallest duration a rate is computed over, which keeps the division from
|
|
18
|
+
// blowing up when every packet of the window shares a timestamp.
|
|
19
|
+
static constexpr int64_t MinDurationUs{ 1000 };
|
|
20
|
+
|
|
21
|
+
/* Instance methods. */
|
|
22
|
+
|
|
23
|
+
RobustThroughputEstimator::RobustThroughputEstimator()
|
|
24
|
+
: RobustThroughputEstimator(RobustThroughputEstimatorOptions{})
|
|
25
|
+
{
|
|
26
|
+
MS_TRACE();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
RobustThroughputEstimator::RobustThroughputEstimator(RobustThroughputEstimatorOptions options)
|
|
30
|
+
: options(options)
|
|
31
|
+
{
|
|
32
|
+
MS_TRACE();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
void RobustThroughputEstimator::IncomingPacketFeedbackVector(
|
|
36
|
+
const std::vector<Types::PacketResult>& packetResults)
|
|
37
|
+
{
|
|
38
|
+
MS_TRACE();
|
|
39
|
+
|
|
40
|
+
MS_ASSERT(
|
|
41
|
+
std::ranges::is_sorted(packetResults, Types::PacketResult::ReceiveTimeOrder()),
|
|
42
|
+
"packets are not sorted by arrival time");
|
|
43
|
+
|
|
44
|
+
for (const auto& packetResult : packetResults)
|
|
45
|
+
{
|
|
46
|
+
// Ignore the packets without a valid send or arrival time. It shouldn't
|
|
47
|
+
// happen, since the lost ones are filtered out before reaching here, but
|
|
48
|
+
// handling it explicitly avoids a state that would be hard to diagnose.
|
|
49
|
+
if (!packetResult.IsReceived() || packetResult.sentPacket.sendTimeUs == Types::TimeUsInfinite)
|
|
50
|
+
{
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
this->window.push_back(packetResult);
|
|
55
|
+
|
|
56
|
+
this->window.back().sentPacket.priorUnackedData = static_cast<size_t>(std::llround(
|
|
57
|
+
static_cast<double>(this->window.back().sentPacket.priorUnackedData) *
|
|
58
|
+
this->options.unackedWeight));
|
|
59
|
+
|
|
60
|
+
// Arrival times are usually already in order, but a reordered feedback
|
|
61
|
+
// needs a few swaps to keep the window sorted.
|
|
62
|
+
for (size_t idx = this->window.size() - 1;
|
|
63
|
+
idx > 0 && this->window[idx].receiveTimeUs < this->window[idx - 1].receiveTimeUs;
|
|
64
|
+
--idx)
|
|
65
|
+
{
|
|
66
|
+
std::swap(this->window[idx], this->window[idx - 1]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const int64_t receiveDeltaUs =
|
|
70
|
+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
|
71
|
+
this->window.back().receiveTimeUs.value() - packetResult.receiveTimeUs.value();
|
|
72
|
+
|
|
73
|
+
if (receiveDeltaUs > MaxReorderingTimeUs)
|
|
74
|
+
{
|
|
75
|
+
MS_WARN_TAG(
|
|
76
|
+
bwe,
|
|
77
|
+
"severe packet reordering or arrival time offset changed, dropping the window"
|
|
78
|
+
" [receiveDelta:%" PRIi64 " us]",
|
|
79
|
+
receiveDeltaUs);
|
|
80
|
+
|
|
81
|
+
this->window.clear();
|
|
82
|
+
|
|
83
|
+
this->latestDiscardedSendTimeUs.reset();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Remove the packets that no longer belong to the window.
|
|
88
|
+
while (IsFirstPacketOutsideWindow())
|
|
89
|
+
{
|
|
90
|
+
this->latestDiscardedSendTimeUs = std::max(
|
|
91
|
+
this->latestDiscardedSendTimeUs.value_or(this->window.front().sentPacket.sendTimeUs),
|
|
92
|
+
this->window.front().sentPacket.sendTimeUs);
|
|
93
|
+
|
|
94
|
+
this->window.pop_front();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
bool RobustThroughputEstimator::IsFirstPacketOutsideWindow() const
|
|
99
|
+
{
|
|
100
|
+
MS_TRACE();
|
|
101
|
+
|
|
102
|
+
if (this->window.empty())
|
|
103
|
+
{
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (this->window.size() > this->options.maxWindowPackets)
|
|
108
|
+
{
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const int64_t currentWindowDurationUs =
|
|
113
|
+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
|
114
|
+
this->window.back().receiveTimeUs.value() - this->window.front().receiveTimeUs.value();
|
|
115
|
+
|
|
116
|
+
if (currentWindowDurationUs > this->options.maxWindowDurationUs)
|
|
117
|
+
{
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return this->window.size() > this->options.windowPackets &&
|
|
122
|
+
currentWindowDurationUs > this->options.minWindowDurationUs;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
std::optional<int64_t> RobustThroughputEstimator::GetBitrate() const
|
|
126
|
+
{
|
|
127
|
+
MS_TRACE();
|
|
128
|
+
|
|
129
|
+
if (this->window.empty() || this->window.size() < this->options.requiredPackets)
|
|
130
|
+
{
|
|
131
|
+
return std::nullopt;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
int64_t largestRecvGapUs{ 0 };
|
|
135
|
+
int64_t secondLargestRecvGapUs{ 0 };
|
|
136
|
+
|
|
137
|
+
for (size_t idx = 1; idx < this->window.size(); ++idx)
|
|
138
|
+
{
|
|
139
|
+
const int64_t gapUs =
|
|
140
|
+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
|
141
|
+
this->window[idx].receiveTimeUs.value() - this->window[idx - 1].receiveTimeUs.value();
|
|
142
|
+
|
|
143
|
+
if (gapUs > largestRecvGapUs)
|
|
144
|
+
{
|
|
145
|
+
secondLargestRecvGapUs = largestRecvGapUs;
|
|
146
|
+
largestRecvGapUs = gapUs;
|
|
147
|
+
}
|
|
148
|
+
else if (gapUs > secondLargestRecvGapUs)
|
|
149
|
+
{
|
|
150
|
+
secondLargestRecvGapUs = gapUs;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
std::optional<int64_t> firstSendTimeUs;
|
|
155
|
+
std::optional<int64_t> lastSendTimeUs;
|
|
156
|
+
std::optional<int64_t> firstRecvTimeUs;
|
|
157
|
+
std::optional<int64_t> lastRecvTimeUs;
|
|
158
|
+
int64_t recvSize{ 0 };
|
|
159
|
+
int64_t sendSize{ 0 };
|
|
160
|
+
int64_t firstRecvSize{ 0 };
|
|
161
|
+
int64_t lastSendSize{ 0 };
|
|
162
|
+
size_t numSentPacketsInWindow{ 0 };
|
|
163
|
+
|
|
164
|
+
for (const auto& packetResult : this->window)
|
|
165
|
+
{
|
|
166
|
+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
|
167
|
+
const int64_t receiveTimeUs = packetResult.receiveTimeUs.value();
|
|
168
|
+
|
|
169
|
+
if (!firstRecvTimeUs.has_value() || receiveTimeUs < firstRecvTimeUs.value())
|
|
170
|
+
{
|
|
171
|
+
firstRecvTimeUs = receiveTimeUs;
|
|
172
|
+
firstRecvSize = packetResult.sentPacket.size + packetResult.sentPacket.priorUnackedData;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
lastRecvTimeUs = std::max(lastRecvTimeUs.value_or(receiveTimeUs), receiveTimeUs);
|
|
176
|
+
|
|
177
|
+
recvSize += packetResult.sentPacket.size;
|
|
178
|
+
recvSize += packetResult.sentPacket.priorUnackedData;
|
|
179
|
+
|
|
180
|
+
// Packets sent before something that was already dropped from the window
|
|
181
|
+
// were reordered, and their send time may be so far in the past that it
|
|
182
|
+
// would drag the send rate down. Leave them out of it.
|
|
183
|
+
if (
|
|
184
|
+
this->latestDiscardedSendTimeUs.has_value() &&
|
|
185
|
+
packetResult.sentPacket.sendTimeUs < this->latestDiscardedSendTimeUs.value())
|
|
186
|
+
{
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (!lastSendTimeUs.has_value() || packetResult.sentPacket.sendTimeUs > lastSendTimeUs.value())
|
|
191
|
+
{
|
|
192
|
+
lastSendTimeUs = packetResult.sentPacket.sendTimeUs;
|
|
193
|
+
lastSendSize = packetResult.sentPacket.size + packetResult.sentPacket.priorUnackedData;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
firstSendTimeUs = std::min(
|
|
197
|
+
firstSendTimeUs.value_or(packetResult.sentPacket.sendTimeUs),
|
|
198
|
+
packetResult.sentPacket.sendTimeUs);
|
|
199
|
+
|
|
200
|
+
sendSize += packetResult.sentPacket.size;
|
|
201
|
+
sendSize += packetResult.sentPacket.priorUnackedData;
|
|
202
|
+
|
|
203
|
+
++numSentPacketsInWindow;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Suppose a packet of size S is sent every T microseconds. A window of N
|
|
207
|
+
// packets holds N*S bytes, but the time between the first and the last one
|
|
208
|
+
// is only (N-1)*T, so one packet has to be left out to get the rate S/T.
|
|
209
|
+
// Which one depends on the direction: the receive rate doesn't depend on
|
|
210
|
+
// the size of the first packet, and the send rate doesn't depend on the
|
|
211
|
+
// size of the last one.
|
|
212
|
+
recvSize -= firstRecvSize;
|
|
213
|
+
sendSize -= lastSendSize;
|
|
214
|
+
|
|
215
|
+
// Replace the largest gap by the second largest one, so that a short pause
|
|
216
|
+
// followed by a burst of delayed packets doesn't drop the estimate. That
|
|
217
|
+
// can overestimate, which is guarded against by never returning more than
|
|
218
|
+
// the send rate.
|
|
219
|
+
MS_ASSERT(firstRecvTimeUs.has_value(), "no arrival time in a non empty window");
|
|
220
|
+
MS_ASSERT(lastRecvTimeUs.has_value(), "no arrival time in a non empty window");
|
|
221
|
+
|
|
222
|
+
const int64_t recvDurationUs = std::max(
|
|
223
|
+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
|
224
|
+
(lastRecvTimeUs.value() - firstRecvTimeUs.value()) - largestRecvGapUs + secondLargestRecvGapUs,
|
|
225
|
+
MinDurationUs);
|
|
226
|
+
|
|
227
|
+
if (numSentPacketsInWindow < this->options.requiredPackets)
|
|
228
|
+
{
|
|
229
|
+
// Too few send times to compute a reliable send rate.
|
|
230
|
+
return recvSize * 8 * 1000000 / recvDurationUs;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
MS_ASSERT(firstSendTimeUs.has_value(), "no send time although packets were counted");
|
|
234
|
+
MS_ASSERT(lastSendTimeUs.has_value(), "no send time although packets were counted");
|
|
235
|
+
|
|
236
|
+
const int64_t sendDurationUs = std::max(
|
|
237
|
+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
|
238
|
+
lastSendTimeUs.value() - firstSendTimeUs.value(),
|
|
239
|
+
MinDurationUs);
|
|
240
|
+
|
|
241
|
+
return std::min(
|
|
242
|
+
sendSize * 8 * 1000000 / sendDurationUs, recvSize * 8 * 1000000 / recvDurationUs);
|
|
243
|
+
}
|
|
244
|
+
} // namespace BWE
|
|
245
|
+
} // namespace RTC
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#define MS_CLASS "RTC::BWE::SendPacketHistory"
|
|
2
|
+
// #define MS_LOG_DEV_LEVEL 3
|
|
3
|
+
|
|
4
|
+
#include "RTC/BWE/SendPacketHistory.hpp"
|
|
5
|
+
#include "Logger.hpp"
|
|
6
|
+
|
|
7
|
+
namespace RTC
|
|
8
|
+
{
|
|
9
|
+
namespace BWE
|
|
10
|
+
{
|
|
11
|
+
/* Instance methods. */
|
|
12
|
+
|
|
13
|
+
SendPacketHistory::SendPacketHistory() : SendPacketHistory(SendPacketHistoryOptions{})
|
|
14
|
+
{
|
|
15
|
+
MS_TRACE();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
SendPacketHistory::SendPacketHistory(SendPacketHistoryOptions options) : options(options)
|
|
19
|
+
{
|
|
20
|
+
MS_TRACE();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
int64_t SendPacketHistory::AddPacket(
|
|
24
|
+
uint32_t ssrc, uint16_t seq, size_t size, bool audio, int64_t sentAtUs)
|
|
25
|
+
{
|
|
26
|
+
MS_TRACE();
|
|
27
|
+
|
|
28
|
+
// Drop the packets held for longer than the window, since a feedback
|
|
29
|
+
// reporting on them is not of any use anymore.
|
|
30
|
+
while (!this->history.empty() && sentAtUs - this->history.begin()->second.sentPacket.sendTimeUs >
|
|
31
|
+
this->options.windowDurationUs)
|
|
32
|
+
{
|
|
33
|
+
const auto& entry = this->history.begin()->second;
|
|
34
|
+
|
|
35
|
+
// Only the packets that no feedback has reported on yet count as in
|
|
36
|
+
// flight, since those already reported had their bytes removed then.
|
|
37
|
+
if (entry.sentPacket.sequenceNumber > this->lastAckSequenceNumber)
|
|
38
|
+
{
|
|
39
|
+
RemoveOutstandingBytes(entry);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
RemoveSsrcAndSeq(entry);
|
|
43
|
+
|
|
44
|
+
this->history.erase(this->history.begin());
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const int64_t sequenceNumber = this->nextSequenceNumber++;
|
|
48
|
+
|
|
49
|
+
SentPacketEntry entry;
|
|
50
|
+
|
|
51
|
+
entry.sentPacket.sequenceNumber = sequenceNumber;
|
|
52
|
+
entry.sentPacket.sendTimeUs = sentAtUs;
|
|
53
|
+
entry.sentPacket.size = size;
|
|
54
|
+
entry.sentPacket.audio = audio;
|
|
55
|
+
entry.ssrc = ssrc;
|
|
56
|
+
entry.seq = seq;
|
|
57
|
+
|
|
58
|
+
// The very same SSRC and RTP sequence number can be sent twice, as an audio
|
|
59
|
+
// retransmission does, so let the latest send take the mapping over.
|
|
60
|
+
this->ssrcAndSeqToSequenceNumber[SsrcAndSeq{ .ssrc = ssrc, .seq = seq }] = sequenceNumber;
|
|
61
|
+
|
|
62
|
+
this->outstandingBytes += size;
|
|
63
|
+
|
|
64
|
+
entry.sentPacket.dataInFlight = this->outstandingBytes;
|
|
65
|
+
|
|
66
|
+
this->history.emplace(sequenceNumber, entry);
|
|
67
|
+
|
|
68
|
+
return sequenceNumber;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
std::optional<Types::SentPacket> SendPacketHistory::RetrievePacket(
|
|
72
|
+
int64_t sequenceNumber, bool received)
|
|
73
|
+
{
|
|
74
|
+
MS_TRACE();
|
|
75
|
+
|
|
76
|
+
// A sequence number this history never gave out cannot be resolved, and
|
|
77
|
+
// must not move the acknowledged mark either.
|
|
78
|
+
if (sequenceNumber < 0 || sequenceNumber >= this->nextSequenceNumber)
|
|
79
|
+
{
|
|
80
|
+
MS_DEBUG_DEV(
|
|
81
|
+
"sequence number was never given out [sequenceNumber:%" PRIi64 "]", sequenceNumber);
|
|
82
|
+
|
|
83
|
+
return std::nullopt;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// The feedback settles whether every packet up to the reported one arrived
|
|
87
|
+
// or not, so none of them is in flight anymore.
|
|
88
|
+
if (sequenceNumber > this->lastAckSequenceNumber)
|
|
89
|
+
{
|
|
90
|
+
for (auto it = this->history.upper_bound(this->lastAckSequenceNumber);
|
|
91
|
+
it != this->history.upper_bound(sequenceNumber);
|
|
92
|
+
++it)
|
|
93
|
+
{
|
|
94
|
+
RemoveOutstandingBytes(it->second);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this->lastAckSequenceNumber = sequenceNumber;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const auto it = this->history.find(sequenceNumber);
|
|
101
|
+
|
|
102
|
+
if (it == this->history.end())
|
|
103
|
+
{
|
|
104
|
+
// Either the window already dropped it or a previous feedback reported it
|
|
105
|
+
// as received.
|
|
106
|
+
MS_DEBUG_DEV("packet not held anymore [sequenceNumber:%" PRIi64 "]", sequenceNumber);
|
|
107
|
+
|
|
108
|
+
return std::nullopt;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const auto sentPacket = it->second.sentPacket;
|
|
112
|
+
|
|
113
|
+
// A packet reported as lost is kept, since a later feedback may still
|
|
114
|
+
// report it as received.
|
|
115
|
+
if (received)
|
|
116
|
+
{
|
|
117
|
+
RemoveSsrcAndSeq(it->second);
|
|
118
|
+
|
|
119
|
+
this->history.erase(it);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return sentPacket;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
std::optional<Types::SentPacket> SendPacketHistory::RetrievePacket(
|
|
126
|
+
uint32_t ssrc, uint16_t seq, bool received)
|
|
127
|
+
{
|
|
128
|
+
MS_TRACE();
|
|
129
|
+
|
|
130
|
+
const auto it = this->ssrcAndSeqToSequenceNumber.find(SsrcAndSeq{ .ssrc = ssrc, .seq = seq });
|
|
131
|
+
|
|
132
|
+
if (it == this->ssrcAndSeqToSequenceNumber.end())
|
|
133
|
+
{
|
|
134
|
+
MS_DEBUG_DEV("packet not held anymore [ssrc:%" PRIu32 ", seq:%" PRIu16 "]", ssrc, seq);
|
|
135
|
+
|
|
136
|
+
return std::nullopt;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return RetrievePacket(it->second, received);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
std::optional<int64_t> SendPacketHistory::GetLastSequenceNumber() const
|
|
143
|
+
{
|
|
144
|
+
MS_TRACE();
|
|
145
|
+
|
|
146
|
+
if (this->nextSequenceNumber == 0)
|
|
147
|
+
{
|
|
148
|
+
return std::nullopt;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return this->nextSequenceNumber - 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
void SendPacketHistory::RemoveOutstandingBytes(const SentPacketEntry& entry)
|
|
155
|
+
{
|
|
156
|
+
MS_TRACE();
|
|
157
|
+
|
|
158
|
+
// The acknowledged mark only moves forward, so the bytes of a packet are
|
|
159
|
+
// removed at most once.
|
|
160
|
+
MS_ASSERT(
|
|
161
|
+
this->outstandingBytes >= entry.sentPacket.size,
|
|
162
|
+
"less bytes in flight than the size of the packet being removed");
|
|
163
|
+
|
|
164
|
+
this->outstandingBytes -= entry.sentPacket.size;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
void SendPacketHistory::RemoveSsrcAndSeq(const SentPacketEntry& entry)
|
|
168
|
+
{
|
|
169
|
+
MS_TRACE();
|
|
170
|
+
|
|
171
|
+
const auto it =
|
|
172
|
+
this->ssrcAndSeqToSequenceNumber.find(SsrcAndSeq{ .ssrc = entry.ssrc, .seq = entry.seq });
|
|
173
|
+
|
|
174
|
+
// A later send of the very same SSRC and RTP sequence number took the
|
|
175
|
+
// mapping over, so it's not this packet's to drop.
|
|
176
|
+
if (it == this->ssrcAndSeqToSequenceNumber.end() || it->second != entry.sentPacket.sequenceNumber)
|
|
177
|
+
{
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
this->ssrcAndSeqToSequenceNumber.erase(it);
|
|
182
|
+
}
|
|
183
|
+
} // namespace BWE
|
|
184
|
+
} // namespace RTC
|