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
|
@@ -24,11 +24,27 @@ static void onCloseTimer(uv_handle_t* handle)
|
|
|
24
24
|
|
|
25
25
|
/* Instance methods. */
|
|
26
26
|
|
|
27
|
-
TimerHandle::TimerHandle(TimerHandleInterface::Listener* listener)
|
|
28
|
-
: listener(listener), uvHandle(new uv_timer_t)
|
|
27
|
+
TimerHandle::TimerHandle(TimerHandleInterface::Listener* listener, std::string label)
|
|
28
|
+
: listener(listener), label(std::move(label)), uvHandle(new uv_timer_t)
|
|
29
29
|
{
|
|
30
30
|
MS_TRACE();
|
|
31
31
|
|
|
32
|
+
if (!this->listener)
|
|
33
|
+
{
|
|
34
|
+
delete this->uvHandle;
|
|
35
|
+
this->uvHandle = nullptr;
|
|
36
|
+
|
|
37
|
+
MS_THROW_TYPE_ERROR("[%s] listener must be given", this->label.c_str());
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (this->label.empty())
|
|
41
|
+
{
|
|
42
|
+
delete this->uvHandle;
|
|
43
|
+
this->uvHandle = nullptr;
|
|
44
|
+
|
|
45
|
+
MS_THROW_TYPE_ERROR("label must be given");
|
|
46
|
+
}
|
|
47
|
+
|
|
32
48
|
this->uvHandle->data = static_cast<void*>(this);
|
|
33
49
|
|
|
34
50
|
const int err = uv_timer_init(DepLibUV::GetLoop(), this->uvHandle);
|
|
@@ -38,7 +54,7 @@ TimerHandle::TimerHandle(TimerHandleInterface::Listener* listener)
|
|
|
38
54
|
delete this->uvHandle;
|
|
39
55
|
this->uvHandle = nullptr;
|
|
40
56
|
|
|
41
|
-
MS_THROW_ERROR("uv_timer_init() failed: %s", uv_strerror(err));
|
|
57
|
+
MS_THROW_ERROR("[%s] uv_timer_init() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
42
58
|
}
|
|
43
59
|
}
|
|
44
60
|
|
|
@@ -52,17 +68,29 @@ TimerHandle::~TimerHandle()
|
|
|
52
68
|
}
|
|
53
69
|
}
|
|
54
70
|
|
|
55
|
-
void TimerHandle::Start(
|
|
71
|
+
void TimerHandle::Start(int64_t timeoutMs, int64_t repeatMs)
|
|
56
72
|
{
|
|
57
73
|
MS_TRACE();
|
|
58
74
|
|
|
59
75
|
if (this->closed)
|
|
60
76
|
{
|
|
61
|
-
MS_THROW_ERROR("closed");
|
|
77
|
+
MS_THROW_ERROR("[%s] closed", this->label.c_str());
|
|
62
78
|
}
|
|
63
79
|
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
if (timeoutMs < 0)
|
|
81
|
+
{
|
|
82
|
+
MS_THROW_TYPE_ERROR(
|
|
83
|
+
"[%s] timeoutMs (%" PRIi64 " ms) cannot be negative", this->label.c_str(), timeoutMs);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (repeatMs < 0)
|
|
87
|
+
{
|
|
88
|
+
MS_THROW_TYPE_ERROR(
|
|
89
|
+
"[%s] repeatMs (%" PRIi64 " ms) cannot be negative", this->label.c_str(), repeatMs);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
this->timeoutMs = timeoutMs;
|
|
93
|
+
this->repeatMs = repeatMs;
|
|
66
94
|
|
|
67
95
|
int err;
|
|
68
96
|
|
|
@@ -72,16 +100,19 @@ void TimerHandle::Start(uint64_t timeout, uint64_t repeat)
|
|
|
72
100
|
|
|
73
101
|
if (err != 0)
|
|
74
102
|
{
|
|
75
|
-
MS_THROW_ERROR("uv_timer_stop() failed: %s", uv_strerror(err));
|
|
103
|
+
MS_THROW_ERROR("[%s] uv_timer_stop() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
76
104
|
}
|
|
77
105
|
}
|
|
78
106
|
|
|
79
|
-
err =
|
|
80
|
-
|
|
107
|
+
err = uv_timer_start(
|
|
108
|
+
this->uvHandle,
|
|
109
|
+
static_cast<uv_timer_cb>(onTimer),
|
|
110
|
+
static_cast<uint64_t>(this->timeoutMs),
|
|
111
|
+
static_cast<uint64_t>(this->repeatMs));
|
|
81
112
|
|
|
82
113
|
if (err != 0)
|
|
83
114
|
{
|
|
84
|
-
MS_THROW_ERROR("uv_timer_start() failed: %s", uv_strerror(err));
|
|
115
|
+
MS_THROW_ERROR("[%s] uv_timer_start() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
85
116
|
}
|
|
86
117
|
}
|
|
87
118
|
|
|
@@ -91,7 +122,7 @@ void TimerHandle::Stop()
|
|
|
91
122
|
|
|
92
123
|
if (this->closed)
|
|
93
124
|
{
|
|
94
|
-
MS_THROW_ERROR("closed");
|
|
125
|
+
MS_THROW_ERROR("[%s] closed", this->label.c_str());
|
|
95
126
|
}
|
|
96
127
|
|
|
97
128
|
const int err = uv_timer_stop(this->uvHandle);
|
|
@@ -108,7 +139,7 @@ void TimerHandle::Restart()
|
|
|
108
139
|
|
|
109
140
|
if (this->closed)
|
|
110
141
|
{
|
|
111
|
-
MS_THROW_ERROR("closed");
|
|
142
|
+
MS_THROW_ERROR("[%s] closed", this->label.c_str());
|
|
112
143
|
}
|
|
113
144
|
|
|
114
145
|
int err;
|
|
@@ -119,30 +150,45 @@ void TimerHandle::Restart()
|
|
|
119
150
|
|
|
120
151
|
if (err != 0)
|
|
121
152
|
{
|
|
122
|
-
MS_THROW_ERROR("uv_timer_stop() failed: %s", uv_strerror(err));
|
|
153
|
+
MS_THROW_ERROR("[%s] uv_timer_stop() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
123
154
|
}
|
|
124
155
|
}
|
|
125
156
|
|
|
126
|
-
err =
|
|
127
|
-
|
|
157
|
+
err = uv_timer_start(
|
|
158
|
+
this->uvHandle,
|
|
159
|
+
static_cast<uv_timer_cb>(onTimer),
|
|
160
|
+
static_cast<uint64_t>(this->timeoutMs),
|
|
161
|
+
static_cast<uint64_t>(this->repeatMs));
|
|
128
162
|
|
|
129
163
|
if (err != 0)
|
|
130
164
|
{
|
|
131
|
-
MS_THROW_ERROR("uv_timer_start() failed: %s", uv_strerror(err));
|
|
165
|
+
MS_THROW_ERROR("[%s] uv_timer_start() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
132
166
|
}
|
|
133
167
|
}
|
|
134
168
|
|
|
135
|
-
void TimerHandle::Restart(
|
|
169
|
+
void TimerHandle::Restart(int64_t timeoutMs, int64_t repeatMs)
|
|
136
170
|
{
|
|
137
171
|
MS_TRACE();
|
|
138
172
|
|
|
139
173
|
if (this->closed)
|
|
140
174
|
{
|
|
141
|
-
MS_THROW_ERROR("closed");
|
|
175
|
+
MS_THROW_ERROR("[%s] closed", this->label.c_str());
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (timeoutMs < 0)
|
|
179
|
+
{
|
|
180
|
+
MS_THROW_TYPE_ERROR(
|
|
181
|
+
"[%s] timeoutMs (%" PRIi64 " ms) cannot be negative", this->label.c_str(), timeoutMs);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (repeatMs < 0)
|
|
185
|
+
{
|
|
186
|
+
MS_THROW_TYPE_ERROR(
|
|
187
|
+
"[%s] repeatMs (%" PRIi64 " ms) cannot be negative", this->label.c_str(), repeatMs);
|
|
142
188
|
}
|
|
143
189
|
|
|
144
|
-
this->
|
|
145
|
-
this->
|
|
190
|
+
this->timeoutMs = timeoutMs;
|
|
191
|
+
this->repeatMs = repeatMs;
|
|
146
192
|
|
|
147
193
|
int err;
|
|
148
194
|
|
|
@@ -152,16 +198,19 @@ void TimerHandle::Restart(uint64_t timeout, uint64_t repeat)
|
|
|
152
198
|
|
|
153
199
|
if (err != 0)
|
|
154
200
|
{
|
|
155
|
-
MS_THROW_ERROR("uv_timer_stop() failed: %s", uv_strerror(err));
|
|
201
|
+
MS_THROW_ERROR("[%s] uv_timer_stop() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
156
202
|
}
|
|
157
203
|
}
|
|
158
204
|
|
|
159
|
-
err =
|
|
160
|
-
|
|
205
|
+
err = uv_timer_start(
|
|
206
|
+
this->uvHandle,
|
|
207
|
+
static_cast<uv_timer_cb>(onTimer),
|
|
208
|
+
static_cast<uint64_t>(this->timeoutMs),
|
|
209
|
+
static_cast<uint64_t>(this->repeatMs));
|
|
161
210
|
|
|
162
211
|
if (err != 0)
|
|
163
212
|
{
|
|
164
|
-
MS_THROW_ERROR("uv_timer_start() failed: %s", uv_strerror(err));
|
|
213
|
+
MS_THROW_ERROR("[%s] uv_timer_start() failed: %s", this->label.c_str(), uv_strerror(err));
|
|
165
214
|
}
|
|
166
215
|
}
|
|
167
216
|
|
package/worker/src/lib.cpp
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
#include "Channel/ChannelSocket.hpp"
|
|
9
9
|
#include "DepLibSRTP.hpp"
|
|
10
10
|
#include "DepLibUV.hpp"
|
|
11
|
+
#ifndef MS_USE_BUILTIN_BWE
|
|
11
12
|
#include "DepLibWebRTC.hpp"
|
|
13
|
+
#endif
|
|
12
14
|
#include "DepOpenSSL.hpp"
|
|
13
15
|
#include "Logger.hpp"
|
|
14
16
|
#include "MediaSoupErrors.hpp"
|
|
@@ -150,7 +152,9 @@ extern "C" int mediasoup_worker_run(
|
|
|
150
152
|
// Initialize static stuff.
|
|
151
153
|
DepOpenSSL::ClassInit();
|
|
152
154
|
DepLibSRTP::ClassInit();
|
|
155
|
+
#ifndef MS_USE_BUILTIN_BWE
|
|
153
156
|
DepLibWebRTC::ClassInit();
|
|
157
|
+
#endif
|
|
154
158
|
Utils::Crypto::ClassInit();
|
|
155
159
|
RTC::DtlsTransport::ClassInit();
|
|
156
160
|
RTC::SrtpSession::ClassInit();
|
|
@@ -168,7 +172,9 @@ extern "C" int mediasoup_worker_run(
|
|
|
168
172
|
// Free static stuff.
|
|
169
173
|
DepLibSRTP::ClassDestroy();
|
|
170
174
|
Utils::Crypto::ClassDestroy();
|
|
175
|
+
#ifndef MS_USE_BUILTIN_BWE
|
|
171
176
|
DepLibWebRTC::ClassDestroy();
|
|
177
|
+
#endif
|
|
172
178
|
RTC::DtlsTransport::ClassDestroy();
|
|
173
179
|
DepLibUV::ClassDestroy();
|
|
174
180
|
|