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
|
@@ -100,6 +100,7 @@ namespace RTC
|
|
|
100
100
|
|
|
101
101
|
udpSocket = new RTC::UdpSocket(
|
|
102
102
|
this,
|
|
103
|
+
this->shared,
|
|
103
104
|
ip,
|
|
104
105
|
listenInfo->portRange()->min(),
|
|
105
106
|
listenInfo->portRange()->max(),
|
|
@@ -108,7 +109,7 @@ namespace RTC
|
|
|
108
109
|
}
|
|
109
110
|
else if (listenInfo->port() != 0)
|
|
110
111
|
{
|
|
111
|
-
udpSocket = new RTC::UdpSocket(this, ip, listenInfo->port(), flags);
|
|
112
|
+
udpSocket = new RTC::UdpSocket(this, this->shared, ip, listenInfo->port(), flags);
|
|
112
113
|
}
|
|
113
114
|
// NOTE: This is temporal to allow deprecated usage of worker port range.
|
|
114
115
|
// In the future this should throw since |port| or |portRange| will be
|
|
@@ -119,6 +120,7 @@ namespace RTC
|
|
|
119
120
|
|
|
120
121
|
udpSocket = new RTC::UdpSocket(
|
|
121
122
|
this,
|
|
123
|
+
this->shared,
|
|
122
124
|
ip,
|
|
123
125
|
Settings::configuration.rtcMinPort,
|
|
124
126
|
Settings::configuration.rtcMaxPort,
|
|
@@ -157,6 +159,7 @@ namespace RTC
|
|
|
157
159
|
tcpServer = new RTC::TcpServer(
|
|
158
160
|
this,
|
|
159
161
|
this,
|
|
162
|
+
this->shared,
|
|
160
163
|
ip,
|
|
161
164
|
listenInfo->portRange()->min(),
|
|
162
165
|
listenInfo->portRange()->max(),
|
|
@@ -165,7 +168,7 @@ namespace RTC
|
|
|
165
168
|
}
|
|
166
169
|
else if (listenInfo->port() != 0)
|
|
167
170
|
{
|
|
168
|
-
tcpServer = new RTC::TcpServer(this, this, ip, listenInfo->port(), flags);
|
|
171
|
+
tcpServer = new RTC::TcpServer(this, this, this->shared, ip, listenInfo->port(), flags);
|
|
169
172
|
}
|
|
170
173
|
// NOTE: This is temporal to allow deprecated usage of worker port range.
|
|
171
174
|
// In the future this should throw since |port| or |portRange| will be
|
|
@@ -177,6 +180,7 @@ namespace RTC
|
|
|
177
180
|
tcpServer = new RTC::TcpServer(
|
|
178
181
|
this,
|
|
179
182
|
this,
|
|
183
|
+
this->shared,
|
|
180
184
|
ip,
|
|
181
185
|
Settings::configuration.rtcMinPort,
|
|
182
186
|
Settings::configuration.rtcMaxPort,
|
|
@@ -409,21 +413,22 @@ namespace RTC
|
|
|
409
413
|
}
|
|
410
414
|
|
|
411
415
|
inline void WebRtcServer::OnPacketReceived(
|
|
412
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen)
|
|
416
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
413
417
|
{
|
|
414
418
|
MS_TRACE();
|
|
415
419
|
|
|
416
420
|
if (RTC::ICE::StunPacket::IsStun(data, len))
|
|
417
421
|
{
|
|
418
|
-
OnStunDataReceived(tuple, data, len);
|
|
422
|
+
OnStunDataReceived(tuple, data, len, receivedAtUs);
|
|
419
423
|
}
|
|
420
424
|
else
|
|
421
425
|
{
|
|
422
|
-
OnNonStunDataReceived(tuple, data, len, bufferLen);
|
|
426
|
+
OnNonStunDataReceived(tuple, data, len, bufferLen, receivedAtUs);
|
|
423
427
|
}
|
|
424
428
|
}
|
|
425
429
|
|
|
426
|
-
inline void WebRtcServer::OnStunDataReceived(
|
|
430
|
+
inline void WebRtcServer::OnStunDataReceived(
|
|
431
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, int64_t receivedAtUs)
|
|
427
432
|
{
|
|
428
433
|
MS_TRACE();
|
|
429
434
|
|
|
@@ -443,7 +448,7 @@ namespace RTC
|
|
|
443
448
|
{
|
|
444
449
|
auto* webRtcTransport = it1->second;
|
|
445
450
|
|
|
446
|
-
webRtcTransport->ProcessStunPacketFromWebRtcServer(tuple, packet);
|
|
451
|
+
webRtcTransport->ProcessStunPacketFromWebRtcServer(tuple, packet, receivedAtUs);
|
|
447
452
|
|
|
448
453
|
delete packet;
|
|
449
454
|
|
|
@@ -465,13 +470,13 @@ namespace RTC
|
|
|
465
470
|
|
|
466
471
|
auto* webRtcTransport = it2->second;
|
|
467
472
|
|
|
468
|
-
webRtcTransport->ProcessStunPacketFromWebRtcServer(tuple, packet);
|
|
473
|
+
webRtcTransport->ProcessStunPacketFromWebRtcServer(tuple, packet, receivedAtUs);
|
|
469
474
|
|
|
470
475
|
delete packet;
|
|
471
476
|
}
|
|
472
477
|
|
|
473
478
|
inline void WebRtcServer::OnNonStunDataReceived(
|
|
474
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen)
|
|
479
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
475
480
|
{
|
|
476
481
|
MS_TRACE();
|
|
477
482
|
|
|
@@ -486,7 +491,7 @@ namespace RTC
|
|
|
486
491
|
|
|
487
492
|
auto* webRtcTransport = it->second;
|
|
488
493
|
|
|
489
|
-
webRtcTransport->ProcessNonStunPacketFromWebRtcServer(tuple, data, len, bufferLen);
|
|
494
|
+
webRtcTransport->ProcessNonStunPacketFromWebRtcServer(tuple, data, len, bufferLen, receivedAtUs);
|
|
490
495
|
}
|
|
491
496
|
|
|
492
497
|
inline void WebRtcServer::OnWebRtcTransportCreated(RTC::WebRtcTransport* webRtcTransport)
|
|
@@ -583,13 +588,14 @@ namespace RTC
|
|
|
583
588
|
const uint8_t* data,
|
|
584
589
|
size_t len,
|
|
585
590
|
size_t bufferLen,
|
|
586
|
-
const struct sockaddr* remoteAddr
|
|
591
|
+
const struct sockaddr* remoteAddr,
|
|
592
|
+
int64_t receivedAtUs)
|
|
587
593
|
{
|
|
588
594
|
MS_TRACE();
|
|
589
595
|
|
|
590
596
|
RTC::TransportTuple tuple(socket, remoteAddr);
|
|
591
597
|
|
|
592
|
-
OnPacketReceived(std::addressof(tuple), data, len, bufferLen);
|
|
598
|
+
OnPacketReceived(std::addressof(tuple), data, len, bufferLen, receivedAtUs);
|
|
593
599
|
}
|
|
594
600
|
|
|
595
601
|
inline void WebRtcServer::OnRtcTcpConnectionClosed(
|
|
@@ -616,12 +622,12 @@ namespace RTC
|
|
|
616
622
|
}
|
|
617
623
|
|
|
618
624
|
inline void WebRtcServer::OnTcpConnectionPacketReceived(
|
|
619
|
-
RTC::TcpConnection* connection, const uint8_t* data, size_t len, size_t bufferLen)
|
|
625
|
+
RTC::TcpConnection* connection, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
620
626
|
{
|
|
621
627
|
MS_TRACE();
|
|
622
628
|
|
|
623
629
|
RTC::TransportTuple tuple(connection);
|
|
624
630
|
|
|
625
|
-
OnPacketReceived(std::addressof(tuple), data, len, bufferLen);
|
|
631
|
+
OnPacketReceived(std::addressof(tuple), data, len, bufferLen, receivedAtUs);
|
|
626
632
|
}
|
|
627
633
|
} // namespace RTC
|
|
@@ -89,6 +89,7 @@ namespace RTC
|
|
|
89
89
|
|
|
90
90
|
udpSocket = new RTC::UdpSocket(
|
|
91
91
|
this,
|
|
92
|
+
this->shared,
|
|
92
93
|
ip,
|
|
93
94
|
listenInfo->portRange()->min(),
|
|
94
95
|
listenInfo->portRange()->max(),
|
|
@@ -97,7 +98,7 @@ namespace RTC
|
|
|
97
98
|
}
|
|
98
99
|
else if (listenInfo->port() != 0)
|
|
99
100
|
{
|
|
100
|
-
udpSocket = new RTC::UdpSocket(this, ip, listenInfo->port(), flags);
|
|
101
|
+
udpSocket = new RTC::UdpSocket(this, this->shared, ip, listenInfo->port(), flags);
|
|
101
102
|
}
|
|
102
103
|
// NOTE: This is temporal to allow deprecated usage of worker port range.
|
|
103
104
|
// In the future this should throw since |port| or |portRange| will be
|
|
@@ -108,6 +109,7 @@ namespace RTC
|
|
|
108
109
|
|
|
109
110
|
udpSocket = new RTC::UdpSocket(
|
|
110
111
|
this,
|
|
112
|
+
this->shared,
|
|
111
113
|
ip,
|
|
112
114
|
Settings::configuration.rtcMinPort,
|
|
113
115
|
Settings::configuration.rtcMaxPort,
|
|
@@ -160,6 +162,7 @@ namespace RTC
|
|
|
160
162
|
tcpServer = new RTC::TcpServer(
|
|
161
163
|
this,
|
|
162
164
|
this,
|
|
165
|
+
this->shared,
|
|
163
166
|
ip,
|
|
164
167
|
listenInfo->portRange()->min(),
|
|
165
168
|
listenInfo->portRange()->max(),
|
|
@@ -168,7 +171,7 @@ namespace RTC
|
|
|
168
171
|
}
|
|
169
172
|
else if (listenInfo->port() != 0)
|
|
170
173
|
{
|
|
171
|
-
tcpServer = new RTC::TcpServer(this, this, ip, listenInfo->port(), flags);
|
|
174
|
+
tcpServer = new RTC::TcpServer(this, this, this->shared, ip, listenInfo->port(), flags);
|
|
172
175
|
}
|
|
173
176
|
// NOTE: This is temporal to allow deprecated usage of worker port range.
|
|
174
177
|
// In the future this should throw since |port| or |portRange| will be
|
|
@@ -180,6 +183,7 @@ namespace RTC
|
|
|
180
183
|
tcpServer = new RTC::TcpServer(
|
|
181
184
|
this,
|
|
182
185
|
this,
|
|
186
|
+
this->shared,
|
|
183
187
|
ip,
|
|
184
188
|
Settings::configuration.rtcMinPort,
|
|
185
189
|
Settings::configuration.rtcMaxPort,
|
|
@@ -226,7 +230,7 @@ namespace RTC
|
|
|
226
230
|
iceLocalPreferenceDecrement += 100;
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
auto
|
|
233
|
+
auto iceConsentTimeoutSec = options->iceConsentTimeout();
|
|
230
234
|
|
|
231
235
|
// Create a ICE server.
|
|
232
236
|
this->iceServer = new RTC::ICE::IceServer(
|
|
@@ -234,7 +238,7 @@ namespace RTC
|
|
|
234
238
|
this->shared,
|
|
235
239
|
Utils::Crypto::GetRandomString(32),
|
|
236
240
|
Utils::Crypto::GetRandomString(32),
|
|
237
|
-
|
|
241
|
+
iceConsentTimeoutSec);
|
|
238
242
|
|
|
239
243
|
// Create a DTLS transport.
|
|
240
244
|
this->dtlsTransport = new RTC::DtlsTransport(this, this->shared);
|
|
@@ -303,7 +307,7 @@ namespace RTC
|
|
|
303
307
|
MS_THROW_TYPE_ERROR("empty iceCandidates");
|
|
304
308
|
}
|
|
305
309
|
|
|
306
|
-
auto
|
|
310
|
+
auto iceConsentTimeoutSec = options->iceConsentTimeout();
|
|
307
311
|
|
|
308
312
|
// Create a ICE server.
|
|
309
313
|
this->iceServer = new RTC::ICE::IceServer(
|
|
@@ -311,7 +315,7 @@ namespace RTC
|
|
|
311
315
|
this->shared,
|
|
312
316
|
Utils::Crypto::GetRandomString(32),
|
|
313
317
|
Utils::Crypto::GetRandomString(32),
|
|
314
|
-
|
|
318
|
+
iceConsentTimeoutSec);
|
|
315
319
|
|
|
316
320
|
// Create a DTLS transport.
|
|
317
321
|
this->dtlsTransport = new RTC::DtlsTransport(this, this->shared);
|
|
@@ -621,7 +625,7 @@ namespace RTC
|
|
|
621
625
|
}
|
|
622
626
|
|
|
623
627
|
void WebRtcTransport::ProcessStunPacketFromWebRtcServer(
|
|
624
|
-
RTC::TransportTuple* tuple, const RTC::ICE::StunPacket* packet)
|
|
628
|
+
RTC::TransportTuple* tuple, const RTC::ICE::StunPacket* packet, int64_t /*receivedAtUs*/)
|
|
625
629
|
{
|
|
626
630
|
MS_TRACE();
|
|
627
631
|
|
|
@@ -630,7 +634,7 @@ namespace RTC
|
|
|
630
634
|
}
|
|
631
635
|
|
|
632
636
|
void WebRtcTransport::ProcessNonStunPacketFromWebRtcServer(
|
|
633
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen)
|
|
637
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
634
638
|
{
|
|
635
639
|
MS_TRACE();
|
|
636
640
|
|
|
@@ -640,17 +644,17 @@ namespace RTC
|
|
|
640
644
|
// Check if it's RTCP.
|
|
641
645
|
if (RTC::RTCP::Packet::IsRtcp(data, len))
|
|
642
646
|
{
|
|
643
|
-
OnRtcpDataReceived(tuple, data, len);
|
|
647
|
+
OnRtcpDataReceived(tuple, data, len, receivedAtUs);
|
|
644
648
|
}
|
|
645
649
|
// Check if it's RTP.
|
|
646
650
|
else if (RTC::RTP::Packet::IsRtp(data, len))
|
|
647
651
|
{
|
|
648
|
-
OnRtpDataReceived(tuple, data, len, bufferLen);
|
|
652
|
+
OnRtpDataReceived(tuple, data, len, bufferLen, receivedAtUs);
|
|
649
653
|
}
|
|
650
654
|
// Check if it's DTLS.
|
|
651
655
|
else if (RTC::DtlsTransport::IsDtls(data, len))
|
|
652
656
|
{
|
|
653
|
-
OnDtlsDataReceived(tuple, data, len);
|
|
657
|
+
OnDtlsDataReceived(tuple, data, len, receivedAtUs);
|
|
654
658
|
}
|
|
655
659
|
else
|
|
656
660
|
{
|
|
@@ -671,7 +675,7 @@ namespace RTC
|
|
|
671
675
|
|
|
672
676
|
return (
|
|
673
677
|
(this->iceServer->GetState() == RTC::ICE::IceServer::IceState::CONNECTED ||
|
|
674
|
-
|
|
678
|
+
this->iceServer->GetState() == RTC::ICE::IceServer::IceState::COMPLETED) &&
|
|
675
679
|
this->dtlsTransport->GetState() == RTC::DtlsTransport::DtlsState::CONNECTED);
|
|
676
680
|
}
|
|
677
681
|
|
|
@@ -909,7 +913,7 @@ namespace RTC
|
|
|
909
913
|
}
|
|
910
914
|
|
|
911
915
|
inline void WebRtcTransport::OnPacketReceived(
|
|
912
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen)
|
|
916
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
913
917
|
{
|
|
914
918
|
MS_TRACE();
|
|
915
919
|
|
|
@@ -919,22 +923,22 @@ namespace RTC
|
|
|
919
923
|
// Check if it's STUN.
|
|
920
924
|
if (RTC::ICE::StunPacket::IsStun(data, len))
|
|
921
925
|
{
|
|
922
|
-
OnStunDataReceived(tuple, data, len);
|
|
926
|
+
OnStunDataReceived(tuple, data, len, receivedAtUs);
|
|
923
927
|
}
|
|
924
928
|
// Check if it's RTCP.
|
|
925
929
|
else if (RTC::RTCP::Packet::IsRtcp(data, len))
|
|
926
930
|
{
|
|
927
|
-
OnRtcpDataReceived(tuple, data, len);
|
|
931
|
+
OnRtcpDataReceived(tuple, data, len, receivedAtUs);
|
|
928
932
|
}
|
|
929
933
|
// Check if it's RTP.
|
|
930
934
|
else if (RTC::RTP::Packet::IsRtp(data, len))
|
|
931
935
|
{
|
|
932
|
-
OnRtpDataReceived(tuple, data, len, bufferLen);
|
|
936
|
+
OnRtpDataReceived(tuple, data, len, bufferLen, receivedAtUs);
|
|
933
937
|
}
|
|
934
938
|
// Check if it's DTLS.
|
|
935
939
|
else if (RTC::DtlsTransport::IsDtls(data, len))
|
|
936
940
|
{
|
|
937
|
-
OnDtlsDataReceived(tuple, data, len);
|
|
941
|
+
OnDtlsDataReceived(tuple, data, len, receivedAtUs);
|
|
938
942
|
}
|
|
939
943
|
else
|
|
940
944
|
{
|
|
@@ -943,7 +947,7 @@ namespace RTC
|
|
|
943
947
|
}
|
|
944
948
|
|
|
945
949
|
inline void WebRtcTransport::OnStunDataReceived(
|
|
946
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len)
|
|
950
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, int64_t /*receivedAtUs*/)
|
|
947
951
|
{
|
|
948
952
|
MS_TRACE();
|
|
949
953
|
|
|
@@ -963,7 +967,7 @@ namespace RTC
|
|
|
963
967
|
}
|
|
964
968
|
|
|
965
969
|
inline void WebRtcTransport::OnDtlsDataReceived(
|
|
966
|
-
const RTC::TransportTuple* tuple, const uint8_t* data, size_t len)
|
|
970
|
+
const RTC::TransportTuple* tuple, const uint8_t* data, size_t len, int64_t receivedAtUs)
|
|
967
971
|
{
|
|
968
972
|
MS_TRACE();
|
|
969
973
|
|
|
@@ -985,7 +989,7 @@ namespace RTC
|
|
|
985
989
|
{
|
|
986
990
|
MS_DEBUG_DEV("DTLS data received, passing it to the DTLS transport");
|
|
987
991
|
|
|
988
|
-
this->dtlsTransport->ProcessDtlsData(data, len);
|
|
992
|
+
this->dtlsTransport->ProcessDtlsData(data, len, receivedAtUs);
|
|
989
993
|
}
|
|
990
994
|
else
|
|
991
995
|
{
|
|
@@ -996,7 +1000,7 @@ namespace RTC
|
|
|
996
1000
|
}
|
|
997
1001
|
|
|
998
1002
|
inline void WebRtcTransport::OnRtpDataReceived(
|
|
999
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen)
|
|
1003
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
1000
1004
|
{
|
|
1001
1005
|
MS_TRACE();
|
|
1002
1006
|
|
|
@@ -1061,11 +1065,11 @@ namespace RTC
|
|
|
1061
1065
|
this->iceServer->MayForceSelectedTuple(tuple);
|
|
1062
1066
|
|
|
1063
1067
|
// Pass the packet to the parent transport.
|
|
1064
|
-
RTC::Transport::ReceiveRtpPacket(packet);
|
|
1068
|
+
RTC::Transport::ReceiveRtpPacket(packet, receivedAtUs);
|
|
1065
1069
|
}
|
|
1066
1070
|
|
|
1067
1071
|
inline void WebRtcTransport::OnRtcpDataReceived(
|
|
1068
|
-
RTC::TransportTuple* tuple, const uint8_t* data, size_t len)
|
|
1072
|
+
RTC::TransportTuple* tuple, const uint8_t* data, size_t len, int64_t receivedAtUs)
|
|
1069
1073
|
{
|
|
1070
1074
|
MS_TRACE();
|
|
1071
1075
|
|
|
@@ -1109,7 +1113,7 @@ namespace RTC
|
|
|
1109
1113
|
}
|
|
1110
1114
|
|
|
1111
1115
|
// Pass the packet to the parent transport.
|
|
1112
|
-
RTC::Transport::ReceiveRtcpPacket(packet);
|
|
1116
|
+
RTC::Transport::ReceiveRtcpPacket(packet, receivedAtUs);
|
|
1113
1117
|
}
|
|
1114
1118
|
|
|
1115
1119
|
inline void WebRtcTransport::OnUdpSocketPacketReceived(
|
|
@@ -1117,13 +1121,14 @@ namespace RTC
|
|
|
1117
1121
|
const uint8_t* data,
|
|
1118
1122
|
size_t len,
|
|
1119
1123
|
size_t bufferLen,
|
|
1120
|
-
const struct sockaddr* remoteAddr
|
|
1124
|
+
const struct sockaddr* remoteAddr,
|
|
1125
|
+
int64_t receivedAtUs)
|
|
1121
1126
|
{
|
|
1122
1127
|
MS_TRACE();
|
|
1123
1128
|
|
|
1124
1129
|
RTC::TransportTuple tuple(socket, remoteAddr);
|
|
1125
1130
|
|
|
1126
|
-
OnPacketReceived(&tuple, data, len, bufferLen);
|
|
1131
|
+
OnPacketReceived(&tuple, data, len, bufferLen, receivedAtUs);
|
|
1127
1132
|
}
|
|
1128
1133
|
|
|
1129
1134
|
inline void WebRtcTransport::OnRtcTcpConnectionClosed(
|
|
@@ -1137,13 +1142,13 @@ namespace RTC
|
|
|
1137
1142
|
}
|
|
1138
1143
|
|
|
1139
1144
|
inline void WebRtcTransport::OnTcpConnectionPacketReceived(
|
|
1140
|
-
RTC::TcpConnection* connection, const uint8_t* data, size_t len, size_t bufferLen)
|
|
1145
|
+
RTC::TcpConnection* connection, const uint8_t* data, size_t len, size_t bufferLen, int64_t receivedAtUs)
|
|
1141
1146
|
{
|
|
1142
1147
|
MS_TRACE();
|
|
1143
1148
|
|
|
1144
1149
|
RTC::TransportTuple tuple(connection);
|
|
1145
1150
|
|
|
1146
|
-
OnPacketReceived(&tuple, data, len, bufferLen);
|
|
1151
|
+
OnPacketReceived(&tuple, data, len, bufferLen, receivedAtUs);
|
|
1147
1152
|
}
|
|
1148
1153
|
|
|
1149
1154
|
inline void WebRtcTransport::OnIceServerSendStunPacket(
|
|
@@ -1453,11 +1458,11 @@ namespace RTC
|
|
|
1453
1458
|
}
|
|
1454
1459
|
|
|
1455
1460
|
inline void WebRtcTransport::OnDtlsTransportApplicationDataReceived(
|
|
1456
|
-
const RTC::DtlsTransport* /*dtlsTransport*/, const uint8_t* data, size_t len)
|
|
1461
|
+
const RTC::DtlsTransport* /*dtlsTransport*/, const uint8_t* data, size_t len, int64_t receivedAtUs)
|
|
1457
1462
|
{
|
|
1458
1463
|
MS_TRACE();
|
|
1459
1464
|
|
|
1460
1465
|
// Pass it to the parent transport.
|
|
1461
|
-
RTC::Transport::ReceiveSctpData(data, len);
|
|
1466
|
+
RTC::Transport::ReceiveSctpData(data, len, receivedAtUs);
|
|
1462
1467
|
}
|
|
1463
1468
|
} // namespace RTC
|
package/worker/src/Settings.cpp
CHANGED
|
@@ -58,6 +58,9 @@ void Settings::SetConfiguration(int argc, char* argv[])
|
|
|
58
58
|
{ .name="rtcMaxPort", .has_arg=optional_argument, .flag=nullptr, .val='M' },
|
|
59
59
|
{ .name="dtlsCertificateFile", .has_arg=optional_argument, .flag=nullptr, .val='c' },
|
|
60
60
|
{ .name="dtlsPrivateKeyFile", .has_arg=optional_argument, .flag=nullptr, .val='p' },
|
|
61
|
+
// NOTE: The libwebrtcFieldTrials option is still allowed until we only
|
|
62
|
+
// support the built-in BWE.
|
|
63
|
+
// TODO: Remove when we only support the built-in BWE.
|
|
61
64
|
{ .name="libwebrtcFieldTrials", .has_arg=optional_argument, .flag=nullptr, .val='W' },
|
|
62
65
|
{ .name=nullptr, .has_arg=0, .flag=nullptr, .val=0 }
|
|
63
66
|
};
|
|
@@ -144,6 +147,10 @@ void Settings::SetConfiguration(int argc, char* argv[])
|
|
|
144
147
|
|
|
145
148
|
case 'W':
|
|
146
149
|
{
|
|
150
|
+
#ifdef MS_USE_BUILTIN_BWE
|
|
151
|
+
// TODO: Remove when we only support the built-in BWE.
|
|
152
|
+
MS_WARN_TAG(info, "ignoring libwebrtcFieldTrials since this worker uses the built-in BWE");
|
|
153
|
+
#else
|
|
147
154
|
stringValue = std::string(optarg);
|
|
148
155
|
|
|
149
156
|
if (stringValue != Settings::configuration.libwebrtcFieldTrials)
|
|
@@ -154,6 +161,7 @@ void Settings::SetConfiguration(int argc, char* argv[])
|
|
|
154
161
|
|
|
155
162
|
Settings::configuration.libwebrtcFieldTrials = stringValue;
|
|
156
163
|
}
|
|
164
|
+
#endif
|
|
157
165
|
|
|
158
166
|
break;
|
|
159
167
|
}
|
|
@@ -364,11 +372,13 @@ void Settings::PrintConfiguration()
|
|
|
364
372
|
info, " dtlsCertificateFile: %s", Settings::configuration.dtlsCertificateFile.c_str());
|
|
365
373
|
MS_DEBUG_TAG(info, " dtlsPrivateKeyFile: %s", Settings::configuration.dtlsPrivateKeyFile.c_str());
|
|
366
374
|
}
|
|
375
|
+
#ifndef MS_USE_BUILTIN_BWE
|
|
367
376
|
if (!Settings::configuration.libwebrtcFieldTrials.empty())
|
|
368
377
|
{
|
|
369
378
|
MS_DEBUG_TAG(
|
|
370
379
|
info, " libwebrtcFieldTrials: %s", Settings::configuration.libwebrtcFieldTrials.c_str());
|
|
371
380
|
}
|
|
381
|
+
#endif
|
|
372
382
|
|
|
373
383
|
MS_DEBUG_TAG(info, "</configuration>");
|
|
374
384
|
}
|
package/worker/src/Shared.cpp
CHANGED
|
@@ -19,11 +19,11 @@ Shared::~Shared()
|
|
|
19
19
|
MS_TRACE();
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
TimerHandleInterface* Shared::CreateTimer(TimerHandleInterface::Listener* listener)
|
|
22
|
+
TimerHandleInterface* Shared::CreateTimer(TimerHandleInterface::Listener* listener, std::string label)
|
|
23
23
|
{
|
|
24
24
|
MS_TRACE();
|
|
25
25
|
|
|
26
|
-
return new TimerHandle(listener);
|
|
26
|
+
return new TimerHandle(listener, std::move(label));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
BackoffTimerHandleInterface* Shared::CreateBackoffTimer(
|
|
@@ -126,8 +126,8 @@ namespace Utils
|
|
|
126
126
|
|
|
127
127
|
char buffer[64];
|
|
128
128
|
static constexpr char Chars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
|
130
|
+
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
|
|
131
131
|
|
|
132
132
|
len = std::min<size_t>(len, 64);
|
|
133
133
|
|
package/worker/src/Worker.cpp
CHANGED
|
@@ -19,6 +19,10 @@ Worker::Worker(::Channel::ChannelSocket* channel, SharedInterface* shared)
|
|
|
19
19
|
// Set us as Channel's listener.
|
|
20
20
|
this->channel->SetListener(this);
|
|
21
21
|
|
|
22
|
+
// Give the Channel the Shared instance, which it needs to take the arrival
|
|
23
|
+
// time of received notifications.
|
|
24
|
+
this->channel->SetShared(this->shared);
|
|
25
|
+
|
|
22
26
|
// Set the SignalHandle.
|
|
23
27
|
this->signalHandle = new SignalHandle(this);
|
|
24
28
|
|
|
@@ -369,7 +373,7 @@ void Worker::HandleNotification(Channel::ChannelNotification* notification)
|
|
|
369
373
|
|
|
370
374
|
MS_DEBUG_DEV("Channel notification received [event:%s]", notification->eventCStr);
|
|
371
375
|
|
|
372
|
-
switch (notification->event)
|
|
376
|
+
switch (notification->data->event())
|
|
373
377
|
{
|
|
374
378
|
case Channel::ChannelNotification::Event::WORKER_CLOSE:
|
|
375
379
|
{
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
#include "handles/BackoffTimerHandle.hpp"
|
|
5
5
|
#include "Logger.hpp"
|
|
6
6
|
#include "MediaSoupErrors.hpp"
|
|
7
|
-
#include <algorithm> // std::min()
|
|
8
7
|
|
|
9
8
|
/* Instance methods. */
|
|
10
9
|
|
|
@@ -20,7 +19,7 @@ BackoffTimerHandle::BackoffTimerHandle(BackoffTimerHandleOptions options)
|
|
|
20
19
|
|
|
21
20
|
if (!this->listener)
|
|
22
21
|
{
|
|
23
|
-
MS_THROW_TYPE_ERROR("options.listener must be given");
|
|
22
|
+
MS_THROW_TYPE_ERROR("[%s] options.listener must be given", this->label.c_str());
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
if (this->label.empty())
|
|
@@ -28,16 +27,24 @@ BackoffTimerHandle::BackoffTimerHandle(BackoffTimerHandleOptions options)
|
|
|
28
27
|
MS_THROW_TYPE_ERROR("options.label must be given");
|
|
29
28
|
}
|
|
30
29
|
|
|
30
|
+
if (this->baseTimeoutMs < 0)
|
|
31
|
+
{
|
|
32
|
+
MS_THROW_TYPE_ERROR(
|
|
33
|
+
"[%s] options.baseTimeoutMs (%" PRIi64 " ms) cannot be negative",
|
|
34
|
+
this->label.c_str(),
|
|
35
|
+
this->baseTimeoutMs);
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
if (this->baseTimeoutMs > BackoffTimerHandleInterface::MaxTimeoutMs)
|
|
32
39
|
{
|
|
33
|
-
|
|
34
|
-
"[%s]
|
|
40
|
+
MS_THROW_TYPE_ERROR(
|
|
41
|
+
"[%s] options.maxBackoffTimeoutMs (%" PRIi64 " ms) cannot be greater than %" PRIi64 " ms",
|
|
35
42
|
this->label.c_str(),
|
|
36
43
|
this->baseTimeoutMs,
|
|
37
44
|
BackoffTimerHandleInterface::MaxTimeoutMs);
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
this->timer = new TimerHandle(this);
|
|
47
|
+
this->timer = new TimerHandle(this, this->label);
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
BackoffTimerHandle::~BackoffTimerHandle()
|
|
@@ -68,14 +75,20 @@ void BackoffTimerHandle::Stop()
|
|
|
68
75
|
this->expirationCount = 0;
|
|
69
76
|
}
|
|
70
77
|
|
|
71
|
-
void BackoffTimerHandle::SetBaseTimeoutMs(
|
|
78
|
+
void BackoffTimerHandle::SetBaseTimeoutMs(int64_t baseTimeoutMs)
|
|
72
79
|
{
|
|
73
80
|
MS_TRACE();
|
|
74
81
|
|
|
82
|
+
if (baseTimeoutMs < 0)
|
|
83
|
+
{
|
|
84
|
+
MS_THROW_TYPE_ERROR(
|
|
85
|
+
"[%s] baseTimeoutMs (%" PRIi64 " ms) cannot be negative", this->label.c_str(), baseTimeoutMs);
|
|
86
|
+
}
|
|
87
|
+
|
|
75
88
|
if (baseTimeoutMs > BackoffTimerHandleInterface::MaxTimeoutMs)
|
|
76
89
|
{
|
|
77
|
-
|
|
78
|
-
"[%s]
|
|
90
|
+
MS_THROW_TYPE_ERROR(
|
|
91
|
+
"[%s] baseTimeoutMs (%" PRIi64 " ms) cannot be greater than %" PRIi64 " ms",
|
|
79
92
|
this->label.c_str(),
|
|
80
93
|
baseTimeoutMs,
|
|
81
94
|
BackoffTimerHandleInterface::MaxTimeoutMs);
|
|
@@ -84,7 +97,7 @@ void BackoffTimerHandle::SetBaseTimeoutMs(uint64_t baseTimeoutMs)
|
|
|
84
97
|
this->baseTimeoutMs = baseTimeoutMs;
|
|
85
98
|
}
|
|
86
99
|
|
|
87
|
-
|
|
100
|
+
int64_t BackoffTimerHandle::ComputeNextTimeoutMs() const
|
|
88
101
|
{
|
|
89
102
|
MS_TRACE();
|
|
90
103
|
|
|
@@ -112,7 +125,7 @@ uint64_t BackoffTimerHandle::ComputeNextTimeoutMs() const
|
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
|
|
115
|
-
return std::min<
|
|
128
|
+
return std::min<int64_t>(timeoutMs, BackoffTimerHandleInterface::MaxTimeoutMs);
|
|
116
129
|
}
|
|
117
130
|
|
|
118
131
|
NO_DEFAULT_GCC();
|
|
@@ -131,7 +144,7 @@ void BackoffTimerHandle::OnTimer(TimerHandleInterface* /*timer*/)
|
|
|
131
144
|
this->running =
|
|
132
145
|
!this->maxRestarts.has_value() || this->expirationCount <= this->maxRestarts.value();
|
|
133
146
|
|
|
134
|
-
|
|
147
|
+
int64_t baseTimeoutMs{ this->baseTimeoutMs };
|
|
135
148
|
bool stop{ false };
|
|
136
149
|
|
|
137
150
|
// Call the listener by passing base timeout as reference so the parent has
|