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
|
@@ -12,18 +12,18 @@ namespace RTC
|
|
|
12
12
|
struct HeaderExtensionIds
|
|
13
13
|
{
|
|
14
14
|
// 0 means no id.
|
|
15
|
-
uint8_t mid{
|
|
16
|
-
uint8_t rid{
|
|
17
|
-
uint8_t rrid{
|
|
18
|
-
uint8_t absSendTime{
|
|
19
|
-
uint8_t transportWideCc01{
|
|
20
|
-
uint8_t ssrcAudioLevel{
|
|
21
|
-
uint8_t dependencyDescriptor{
|
|
22
|
-
uint8_t videoOrientation{
|
|
23
|
-
uint8_t timeOffset{
|
|
24
|
-
uint8_t absCaptureTime{
|
|
25
|
-
uint8_t playoutDelay{
|
|
26
|
-
uint8_t mediasoupPacketId{
|
|
15
|
+
uint8_t mid{ 0 };
|
|
16
|
+
uint8_t rid{ 0 };
|
|
17
|
+
uint8_t rrid{ 0 };
|
|
18
|
+
uint8_t absSendTime{ 0 };
|
|
19
|
+
uint8_t transportWideCc01{ 0 };
|
|
20
|
+
uint8_t ssrcAudioLevel{ 0 };
|
|
21
|
+
uint8_t dependencyDescriptor{ 0 };
|
|
22
|
+
uint8_t videoOrientation{ 0 };
|
|
23
|
+
uint8_t timeOffset{ 0 };
|
|
24
|
+
uint8_t absCaptureTime{ 0 };
|
|
25
|
+
uint8_t playoutDelay{ 0 };
|
|
26
|
+
uint8_t mediasoupPacketId{ 0 };
|
|
27
27
|
};
|
|
28
28
|
} // namespace RTP
|
|
29
29
|
} // namespace RTC
|
|
@@ -527,10 +527,10 @@ namespace RTC
|
|
|
527
527
|
|
|
528
528
|
/**
|
|
529
529
|
* @remarks
|
|
530
|
-
* -
|
|
531
|
-
*
|
|
530
|
+
* - `sentAtUs` is converted internally to the 3 bytes ABS Send Time format,
|
|
531
|
+
* unlike `ReadAbsSendTime()`, which exposes the raw extension value.
|
|
532
532
|
*/
|
|
533
|
-
bool UpdateAbsSendTime(
|
|
533
|
+
bool UpdateAbsSendTime(int64_t sentAtUs) const;
|
|
534
534
|
|
|
535
535
|
bool ReadTransportWideCc01(uint16_t& wideSeqNumber) const;
|
|
536
536
|
|
|
@@ -819,7 +819,7 @@ namespace RTC
|
|
|
819
819
|
{
|
|
820
820
|
if (!this->payloadDescriptorHandler)
|
|
821
821
|
{
|
|
822
|
-
return
|
|
822
|
+
return 0;
|
|
823
823
|
}
|
|
824
824
|
|
|
825
825
|
return this->payloadDescriptorHandler->GetSpatialLayer();
|
|
@@ -832,26 +832,26 @@ namespace RTC
|
|
|
832
832
|
{
|
|
833
833
|
if (!this->payloadDescriptorHandler)
|
|
834
834
|
{
|
|
835
|
-
return
|
|
835
|
+
return 0;
|
|
836
836
|
}
|
|
837
837
|
|
|
838
838
|
return this->payloadDescriptorHandler->GetTemporalLayer();
|
|
839
839
|
}
|
|
840
840
|
|
|
841
841
|
/**
|
|
842
|
-
* Capture time (in
|
|
842
|
+
* Capture time (in us) of the packet.
|
|
843
843
|
*/
|
|
844
|
-
std::optional<
|
|
844
|
+
std::optional<int64_t> GetCaptureAtUs() const
|
|
845
845
|
{
|
|
846
|
-
return this->
|
|
846
|
+
return this->captureAtUs;
|
|
847
847
|
}
|
|
848
848
|
|
|
849
849
|
/**
|
|
850
|
-
* Set the capture time (in
|
|
850
|
+
* Set the capture time (in us) of the packet.
|
|
851
851
|
*/
|
|
852
|
-
void
|
|
852
|
+
void SetCaptureAtUs(int64_t captureAtUs)
|
|
853
853
|
{
|
|
854
|
-
this->
|
|
854
|
+
this->captureAtUs = captureAtUs;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
857
|
private:
|
|
@@ -967,7 +967,7 @@ namespace RTC
|
|
|
967
967
|
// each entry is the offset (in bytes) from the beginning of the header
|
|
968
968
|
// extension value to the beginning of the extension.
|
|
969
969
|
std::array<ssize_t, 14> oneByteExtensions{ -1, -1, -1, -1, -1, -1, -1,
|
|
970
|
-
|
|
970
|
+
-1, -1, -1, -1, -1, -1, -1 };
|
|
971
971
|
// Ordered map of Two Bytes Extensions. Key is the id 1 of the extension,
|
|
972
972
|
// each entry is the offset (in bytes) from the beginning of the header
|
|
973
973
|
// extension value to the beginning of the extension.
|
|
@@ -977,7 +977,7 @@ namespace RTC
|
|
|
977
977
|
// Codec related.
|
|
978
978
|
std::shared_ptr<Codecs::PayloadDescriptorHandler> payloadDescriptorHandler;
|
|
979
979
|
// Capture time of the packet.
|
|
980
|
-
std::optional<
|
|
980
|
+
std::optional<int64_t> captureAtUs;
|
|
981
981
|
};
|
|
982
982
|
} // namespace RTP
|
|
983
983
|
} // namespace RTC
|
|
@@ -27,24 +27,24 @@ namespace RTC
|
|
|
27
27
|
// Payload descriptor encoder.
|
|
28
28
|
std::unique_ptr<RTP::Codecs::PayloadDescriptor::Encoder> encoder{ nullptr };
|
|
29
29
|
// Correct SSRC since original packet may not have the same.
|
|
30
|
-
uint32_t ssrc{
|
|
30
|
+
uint32_t ssrc{ 0 };
|
|
31
31
|
// Correct sequence number since original packet may not have the same.
|
|
32
|
-
uint16_t sequenceNumber{
|
|
32
|
+
uint16_t sequenceNumber{ 0 };
|
|
33
33
|
// Correct timestamp since original packet may not have the same.
|
|
34
|
-
uint32_t timestamp{
|
|
34
|
+
uint32_t timestamp{ 0 };
|
|
35
35
|
// Correct marker bit since original packet may not have the same.
|
|
36
36
|
bool marker{ false };
|
|
37
37
|
// Last time this packet was resent.
|
|
38
|
-
|
|
38
|
+
int64_t resentAtMs{ 0 };
|
|
39
39
|
// Number of times this packet was resent.
|
|
40
|
-
uint8_t sentTimes{
|
|
40
|
+
uint8_t sentTimes{ 0 };
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
private:
|
|
44
44
|
static Item* FillItem(Item* item, RTP::Packet* packet, const RTP::SharedPacket& sharedPacket);
|
|
45
45
|
|
|
46
46
|
public:
|
|
47
|
-
RetransmissionBuffer(uint16_t maxItems,
|
|
47
|
+
RetransmissionBuffer(uint16_t maxItems, int64_t maxRetransmissionDelayMs, uint32_t clockRate);
|
|
48
48
|
~RetransmissionBuffer();
|
|
49
49
|
|
|
50
50
|
void Dump(int indentation = 0) const;
|
|
@@ -67,7 +67,7 @@ namespace RTC
|
|
|
67
67
|
private:
|
|
68
68
|
// Given as argument.
|
|
69
69
|
uint16_t maxItems;
|
|
70
|
-
|
|
70
|
+
int64_t maxRetransmissionDelayMs;
|
|
71
71
|
uint32_t clockRate;
|
|
72
72
|
};
|
|
73
73
|
} // namespace RTP
|
|
@@ -3,15 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "FBS/rtpStream.h"
|
|
6
|
-
#include "RTC/RTCP/FeedbackPsFir.hpp"
|
|
7
|
-
#include "RTC/RTCP/FeedbackPsPli.hpp"
|
|
8
|
-
#include "RTC/RTCP/FeedbackRtpNack.hpp"
|
|
9
|
-
#include "RTC/RTCP/Packet.hpp"
|
|
10
|
-
#include "RTC/RTCP/ReceiverReport.hpp"
|
|
11
|
-
#include "RTC/RTCP/Sdes.hpp"
|
|
12
|
-
#include "RTC/RTCP/SenderReport.hpp"
|
|
13
|
-
#include "RTC/RTCP/XrDelaySinceLastRr.hpp"
|
|
14
|
-
#include "RTC/RTCP/XrReceiverReferenceTime.hpp"
|
|
15
6
|
#include "RTC/RTP/Packet.hpp"
|
|
16
7
|
#include "RTC/RTP/RtxStream.hpp"
|
|
17
8
|
#include "RTC/RtpDictionaries.hpp"
|
|
@@ -42,22 +33,22 @@ namespace RTC
|
|
|
42
33
|
flatbuffers::Offset<FBS::RtpStream::Params> FillBuffer(
|
|
43
34
|
flatbuffers::FlatBufferBuilder& builder) const;
|
|
44
35
|
|
|
45
|
-
size_t encodingIdx{
|
|
46
|
-
uint32_t ssrc{
|
|
47
|
-
uint8_t payloadType{
|
|
36
|
+
size_t encodingIdx{ 0 };
|
|
37
|
+
uint32_t ssrc{ 0 };
|
|
38
|
+
uint8_t payloadType{ 0 };
|
|
48
39
|
RTC::RtpCodecMimeType mimeType;
|
|
49
|
-
uint32_t clockRate{
|
|
40
|
+
uint32_t clockRate{ 0 };
|
|
50
41
|
std::string rid;
|
|
51
42
|
std::string cname;
|
|
52
|
-
uint32_t rtxSsrc{
|
|
53
|
-
uint8_t rtxPayloadType{
|
|
43
|
+
uint32_t rtxSsrc{ 0 };
|
|
44
|
+
uint8_t rtxPayloadType{ 0 };
|
|
54
45
|
bool useNack{ false };
|
|
55
46
|
bool usePli{ false };
|
|
56
47
|
bool useFir{ false };
|
|
57
48
|
bool useInBandFec{ false };
|
|
58
49
|
bool useDtx{ false };
|
|
59
|
-
uint8_t spatialLayers{
|
|
60
|
-
uint8_t temporalLayers{
|
|
50
|
+
uint8_t spatialLayers{ 1 };
|
|
51
|
+
uint8_t temporalLayers{ 1 };
|
|
61
52
|
};
|
|
62
53
|
|
|
63
54
|
public:
|
|
@@ -68,9 +59,9 @@ namespace RTC
|
|
|
68
59
|
struct SenderReportMapping
|
|
69
60
|
{
|
|
70
61
|
/**
|
|
71
|
-
* NTP timestamp of the Sender Report (
|
|
62
|
+
* NTP timestamp of the Sender Report (us).
|
|
72
63
|
*/
|
|
73
|
-
|
|
64
|
+
int64_t ntpUs;
|
|
74
65
|
/**
|
|
75
66
|
* RTP timestamp the NTP timestamp above corresponds to.
|
|
76
67
|
*/
|
|
@@ -165,13 +156,13 @@ namespace RTC
|
|
|
165
156
|
|
|
166
157
|
virtual void Resume() = 0;
|
|
167
158
|
|
|
168
|
-
virtual
|
|
159
|
+
virtual int64_t GetBitrate(int64_t nowMs) = 0;
|
|
169
160
|
|
|
170
|
-
virtual
|
|
161
|
+
virtual int64_t GetBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer) = 0;
|
|
171
162
|
|
|
172
|
-
virtual
|
|
163
|
+
virtual int64_t GetSpatialLayerBitrate(int64_t nowMs, uint8_t spatialLayer) = 0;
|
|
173
164
|
|
|
174
|
-
virtual
|
|
165
|
+
virtual int64_t GetLayerBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer) = 0;
|
|
175
166
|
|
|
176
167
|
void ResetScore(uint8_t score, bool notify);
|
|
177
168
|
|
|
@@ -185,14 +176,9 @@ namespace RTC
|
|
|
185
176
|
return static_cast<float>(this->fractionLost) * 100 / 256;
|
|
186
177
|
}
|
|
187
178
|
|
|
188
|
-
float
|
|
179
|
+
float GetRttMs() const
|
|
189
180
|
{
|
|
190
|
-
return this->
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
uint64_t GetMaxPacketMs() const
|
|
194
|
-
{
|
|
195
|
-
return this->maxPacketMs;
|
|
181
|
+
return this->rttMs;
|
|
196
182
|
}
|
|
197
183
|
|
|
198
184
|
uint32_t GetMaxPacketTs() const
|
|
@@ -216,7 +202,7 @@ namespace RTC
|
|
|
216
202
|
return this->score;
|
|
217
203
|
}
|
|
218
204
|
|
|
219
|
-
|
|
205
|
+
int64_t GetActiveMs() const
|
|
220
206
|
{
|
|
221
207
|
return this->shared->GetTimeMs() - this->activeSinceMs;
|
|
222
208
|
}
|
|
@@ -250,55 +236,55 @@ namespace RTC
|
|
|
250
236
|
// Others.
|
|
251
237
|
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
|
|
252
238
|
// Highest seq. number seen.
|
|
253
|
-
uint16_t maxSeq{
|
|
239
|
+
uint16_t maxSeq{ 0 };
|
|
254
240
|
// Shifted count of seq. number cycles.
|
|
255
|
-
uint32_t cycles{
|
|
241
|
+
uint32_t cycles{ 0 };
|
|
256
242
|
// Base seq number.
|
|
257
|
-
uint32_t baseSeq{
|
|
243
|
+
uint32_t baseSeq{ 0 };
|
|
258
244
|
// Last 'bad' seq number + 1.
|
|
259
|
-
uint32_t badSeq{
|
|
245
|
+
uint32_t badSeq{ 0 };
|
|
260
246
|
// Highest timestamp seen.
|
|
261
|
-
uint32_t maxPacketTs{
|
|
247
|
+
uint32_t maxPacketTs{ 0 };
|
|
262
248
|
// When the packet with highest timestammp was seen.
|
|
263
|
-
|
|
249
|
+
int64_t maxPacketAtUs{ 0 };
|
|
264
250
|
// When the media in the packet with highest timestamp was captured, in our own
|
|
265
251
|
// monotonic clock.
|
|
266
252
|
// NOTE: Only meaningful in a send stream, whose packets arrive already carrying
|
|
267
253
|
// their capture instant. In a receive stream it is the Producer that tells it,
|
|
268
254
|
// once this class has already seen the packet, so
|
|
269
255
|
// RtpStreamRecv::GetCaptureMapping() is what must be used there.
|
|
270
|
-
std::optional<
|
|
256
|
+
std::optional<int64_t> maxPacketCaptureAtUs;
|
|
271
257
|
int32_t packetsLost{ 0 };
|
|
272
|
-
uint8_t fractionLost{
|
|
258
|
+
uint8_t fractionLost{ 0 };
|
|
273
259
|
// Jitter in RTP timestamp units. As per spec it's kept as floating value
|
|
274
260
|
// although it's exposed as integer in the stats.
|
|
275
261
|
float jitter{ 0 };
|
|
276
|
-
size_t packetsDiscarded{
|
|
277
|
-
size_t packetsRetransmitted{
|
|
278
|
-
size_t packetsRepaired{
|
|
279
|
-
size_t nackCount{
|
|
280
|
-
size_t nackPacketCount{
|
|
281
|
-
size_t pliCount{
|
|
282
|
-
size_t firCount{
|
|
262
|
+
size_t packetsDiscarded{ 0 };
|
|
263
|
+
size_t packetsRetransmitted{ 0 };
|
|
264
|
+
size_t packetsRepaired{ 0 };
|
|
265
|
+
size_t nackCount{ 0 };
|
|
266
|
+
size_t nackPacketCount{ 0 };
|
|
267
|
+
size_t pliCount{ 0 };
|
|
268
|
+
size_t firCount{ 0 };
|
|
283
269
|
// Packets repaired at last interval for score calculation.
|
|
284
|
-
size_t repairedPriorScore{
|
|
270
|
+
size_t repairedPriorScore{ 0 };
|
|
285
271
|
// Packets retransmitted at last interval for score calculation.
|
|
286
|
-
size_t retransmittedPriorScore{
|
|
272
|
+
size_t retransmittedPriorScore{ 0 };
|
|
287
273
|
// Correspondence between wall clock and RTP timeline given by the last Sender
|
|
288
274
|
// Report.
|
|
289
275
|
std::optional<RTP::RtpStream::SenderReportMapping> lastSenderReportMapping;
|
|
290
|
-
float
|
|
276
|
+
float rttMs{ 0.0f };
|
|
291
277
|
// Instance of RtxStream.
|
|
292
278
|
RTP::RtxStream* rtxStream{ nullptr };
|
|
293
279
|
|
|
294
280
|
private:
|
|
295
281
|
// Score related.
|
|
296
|
-
uint8_t score{
|
|
282
|
+
uint8_t score{ 0 };
|
|
297
283
|
std::vector<uint8_t> scores;
|
|
298
284
|
// Whether at least a RTP packet has been received.
|
|
299
285
|
bool started{ false };
|
|
300
286
|
// Last time since the stream is active.
|
|
301
|
-
|
|
287
|
+
int64_t activeSinceMs{ 0 };
|
|
302
288
|
};
|
|
303
289
|
} // namespace RTP
|
|
304
290
|
} // namespace RTC
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
#include "handles/TimerHandleInterface.hpp"
|
|
5
5
|
#include "RTC/NackGenerator.hpp"
|
|
6
|
+
#include "RTC/RTCP/Packet.hpp"
|
|
7
|
+
#include "RTC/RTCP/ReceiverReport.hpp"
|
|
8
|
+
#include "RTC/RTCP/SenderReport.hpp"
|
|
6
9
|
#include "RTC/RTCP/XrDelaySinceLastRr.hpp"
|
|
7
10
|
#include "RTC/RTP/RtpStream.hpp"
|
|
8
11
|
#include "RTC/RateCalculator.hpp"
|
|
@@ -26,12 +29,12 @@ namespace RTC
|
|
|
26
29
|
* - Same value libwebrtc uses in `AbsoluteCaptureTimeInterpolator`, which
|
|
27
30
|
* pairs with senders emitting the extension at least once per second.
|
|
28
31
|
*/
|
|
29
|
-
static constexpr
|
|
32
|
+
static constexpr int64_t MaxAbsCaptureTimeInterpolationMs{ 5000 };
|
|
30
33
|
/**
|
|
31
34
|
* How far the RTP timestamp of a packet may be from the last received RTCP
|
|
32
35
|
* Sender Report for its capture instant to still be interpolated from it (ms).
|
|
33
36
|
*/
|
|
34
|
-
static constexpr
|
|
37
|
+
static constexpr int64_t MaxSenderReportInterpolationMs{ 10000 };
|
|
35
38
|
|
|
36
39
|
public:
|
|
37
40
|
class Listener : public RTP::RtpStream::Listener
|
|
@@ -44,6 +47,16 @@ namespace RTC
|
|
|
44
47
|
* streams consuming this RtpStreamRecv.
|
|
45
48
|
*/
|
|
46
49
|
virtual uint8_t OnRtpStreamNeedWorstRemoteFractionLost(RTP::RtpStreamRecv* rtpStream) = 0;
|
|
50
|
+
/**
|
|
51
|
+
* A spatial layer of this stream started or stopped carrying traffic, so
|
|
52
|
+
* whoever chose a target layer out of them must choose again.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* - Only fired by streams with more than a spatial layer, which are those
|
|
56
|
+
* of a SVC sender.
|
|
57
|
+
*/
|
|
58
|
+
virtual void OnRtpStreamSpatialLayerActivityChanged(
|
|
59
|
+
RTP::RtpStreamRecv* rtpStream, uint8_t spatialLayer, bool isActive) = 0;
|
|
47
60
|
};
|
|
48
61
|
|
|
49
62
|
public:
|
|
@@ -51,18 +64,18 @@ namespace RTC
|
|
|
51
64
|
{
|
|
52
65
|
public:
|
|
53
66
|
TransmissionCounter(
|
|
54
|
-
SharedInterface* shared, uint8_t spatialLayers, uint8_t temporalLayers,
|
|
67
|
+
SharedInterface* shared, uint8_t spatialLayers, uint8_t temporalLayers, int64_t windowSizeMs);
|
|
55
68
|
|
|
56
69
|
public:
|
|
57
70
|
void Update(const RTP::Packet* packet);
|
|
58
71
|
|
|
59
|
-
|
|
72
|
+
int64_t GetBitrate(int64_t nowMs);
|
|
60
73
|
|
|
61
|
-
|
|
74
|
+
int64_t GetBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer);
|
|
62
75
|
|
|
63
|
-
|
|
76
|
+
int64_t GetSpatialLayerBitrate(int64_t nowMs, uint8_t spatialLayer);
|
|
64
77
|
|
|
65
|
-
|
|
78
|
+
int64_t GetLayerBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer);
|
|
66
79
|
|
|
67
80
|
size_t GetPacketCount() const;
|
|
68
81
|
|
|
@@ -81,9 +94,9 @@ namespace RTC
|
|
|
81
94
|
{
|
|
82
95
|
/**
|
|
83
96
|
* Capture instant of the media carried by the RTP timestamp below, in our own
|
|
84
|
-
* monotonic clock (
|
|
97
|
+
* monotonic clock (us).
|
|
85
98
|
*/
|
|
86
|
-
|
|
99
|
+
int64_t captureAtUs;
|
|
87
100
|
/**
|
|
88
101
|
* RTP timestamp the capture instant above refers to.
|
|
89
102
|
*/
|
|
@@ -104,7 +117,7 @@ namespace RTC
|
|
|
104
117
|
/**
|
|
105
118
|
* Local time at which the Sender Report arrived.
|
|
106
119
|
*/
|
|
107
|
-
|
|
120
|
+
int64_t receivedAtUs;
|
|
108
121
|
};
|
|
109
122
|
|
|
110
123
|
/**
|
|
@@ -118,9 +131,9 @@ namespace RTC
|
|
|
118
131
|
*/
|
|
119
132
|
uint32_t ts;
|
|
120
133
|
/**
|
|
121
|
-
* Capture instant in the remote sender's wall clock (
|
|
134
|
+
* Capture instant in the remote sender's wall clock (us).
|
|
122
135
|
*/
|
|
123
|
-
|
|
136
|
+
int64_t ntpUs;
|
|
124
137
|
};
|
|
125
138
|
|
|
126
139
|
public:
|
|
@@ -128,7 +141,7 @@ namespace RTC
|
|
|
128
141
|
RTP::RtpStreamRecv::Listener* listener,
|
|
129
142
|
SharedInterface* shared,
|
|
130
143
|
RTP::RtpStream::Params& params,
|
|
131
|
-
|
|
144
|
+
int64_t sendNackDelayMs,
|
|
132
145
|
bool useRtpInactivityCheck);
|
|
133
146
|
|
|
134
147
|
~RtpStreamRecv() override;
|
|
@@ -137,7 +150,7 @@ namespace RTC
|
|
|
137
150
|
flatbuffers::Offset<FBS::RtpStream::Stats> FillBufferStats(
|
|
138
151
|
flatbuffers::FlatBufferBuilder& builder) override;
|
|
139
152
|
|
|
140
|
-
bool ReceivePacket(RTP::Packet* packet);
|
|
153
|
+
bool ReceivePacket(RTP::Packet* packet, int64_t receivedAtUs);
|
|
141
154
|
|
|
142
155
|
bool ReceiveRtxPacket(RTP::Packet* packet);
|
|
143
156
|
|
|
@@ -145,25 +158,26 @@ namespace RTC
|
|
|
145
158
|
|
|
146
159
|
RTC::RTCP::ReceiverReport* GetRtxRtcpReceiverReport();
|
|
147
160
|
|
|
148
|
-
void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report);
|
|
161
|
+
void ReceiveRtcpSenderReport(RTC::RTCP::SenderReport* report, int64_t receivedAtUs);
|
|
149
162
|
|
|
150
|
-
void ReceiveRtxRtcpSenderReport(RTC::RTCP::SenderReport* report);
|
|
163
|
+
void ReceiveRtxRtcpSenderReport(RTC::RTCP::SenderReport* report, int64_t receivedAtUs);
|
|
151
164
|
|
|
152
|
-
void ReceiveRtcpXrDelaySinceLastRr(
|
|
165
|
+
void ReceiveRtcpXrDelaySinceLastRr(
|
|
166
|
+
RTC::RTCP::DelaySinceLastRr::SsrcInfo* ssrcInfo, int64_t receivedAtUs);
|
|
153
167
|
|
|
154
168
|
/**
|
|
155
169
|
* Local time at which the last RTCP Sender Report arrived.
|
|
156
170
|
*
|
|
157
171
|
* @returns No value if no Sender Report has arrived yet.
|
|
158
172
|
*/
|
|
159
|
-
std::optional<
|
|
173
|
+
std::optional<int64_t> GetSenderReportReceivedAtUs() const
|
|
160
174
|
{
|
|
161
175
|
if (!this->lastSenderReportTiming.has_value())
|
|
162
176
|
{
|
|
163
177
|
return std::nullopt;
|
|
164
178
|
}
|
|
165
179
|
|
|
166
|
-
return this->lastSenderReportTiming.value().
|
|
180
|
+
return this->lastSenderReportTiming.value().receivedAtUs;
|
|
167
181
|
}
|
|
168
182
|
|
|
169
183
|
/**
|
|
@@ -175,14 +189,14 @@ namespace RTC
|
|
|
175
189
|
* remote sender into our own clock needs the whole set of streams of that
|
|
176
190
|
* sender.
|
|
177
191
|
*
|
|
178
|
-
* @param
|
|
192
|
+
* @param captureAtUs - Capture instant of `ts` in our own monotonic clock.
|
|
179
193
|
* @param ts - RTP timestamp the capture instant refers to.
|
|
180
194
|
*/
|
|
181
|
-
void SetCaptureMapping(
|
|
195
|
+
void SetCaptureMapping(int64_t captureAtUs, uint32_t ts)
|
|
182
196
|
{
|
|
183
197
|
this->lastCaptureMapping = RTP::RtpStreamRecv::CaptureMapping{
|
|
184
|
-
.
|
|
185
|
-
.ts
|
|
198
|
+
.captureAtUs = captureAtUs,
|
|
199
|
+
.ts = ts,
|
|
186
200
|
};
|
|
187
201
|
}
|
|
188
202
|
|
|
@@ -211,7 +225,7 @@ namespace RTC
|
|
|
211
225
|
* @returns No value if no such extension has been received, or if the given RTP
|
|
212
226
|
* timestamp is too far away from the one it referred to.
|
|
213
227
|
*/
|
|
214
|
-
std::optional<
|
|
228
|
+
std::optional<int64_t> GetRemoteCaptureAtUsFromAbsCaptureTime(uint32_t ts) const;
|
|
215
229
|
|
|
216
230
|
/**
|
|
217
231
|
* Capture instant of the given RTP timestamp, expressed in the remote sender's
|
|
@@ -222,7 +236,7 @@ namespace RTC
|
|
|
222
236
|
* @returns No value if no Sender Report has been received, or if the given RTP
|
|
223
237
|
* timestamp is too far away from the one it reported.
|
|
224
238
|
*/
|
|
225
|
-
std::optional<
|
|
239
|
+
std::optional<int64_t> GetRemoteCaptureAtUsFromSenderReport(uint32_t ts) const;
|
|
226
240
|
|
|
227
241
|
void RequestKeyFrame();
|
|
228
242
|
|
|
@@ -230,22 +244,22 @@ namespace RTC
|
|
|
230
244
|
|
|
231
245
|
void Resume() override;
|
|
232
246
|
|
|
233
|
-
|
|
247
|
+
int64_t GetBitrate(int64_t nowMs) override
|
|
234
248
|
{
|
|
235
249
|
return this->transmissionCounter.GetBitrate(nowMs);
|
|
236
250
|
}
|
|
237
251
|
|
|
238
|
-
|
|
252
|
+
int64_t GetBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer) override
|
|
239
253
|
{
|
|
240
254
|
return this->transmissionCounter.GetBitrate(nowMs, spatialLayer, temporalLayer);
|
|
241
255
|
}
|
|
242
256
|
|
|
243
|
-
|
|
257
|
+
int64_t GetSpatialLayerBitrate(int64_t nowMs, uint8_t spatialLayer) override
|
|
244
258
|
{
|
|
245
259
|
return this->transmissionCounter.GetSpatialLayerBitrate(nowMs, spatialLayer);
|
|
246
260
|
}
|
|
247
261
|
|
|
248
|
-
|
|
262
|
+
int64_t GetLayerBitrate(int64_t nowMs, uint8_t spatialLayer, uint8_t temporalLayer) override
|
|
249
263
|
{
|
|
250
264
|
return this->transmissionCounter.GetLayerBitrate(nowMs, spatialLayer, temporalLayer);
|
|
251
265
|
}
|
|
@@ -256,7 +270,7 @@ namespace RTC
|
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
private:
|
|
259
|
-
void CalculateJitter(uint32_t rtpTimestamp);
|
|
273
|
+
void CalculateJitter(uint32_t rtpTimestamp, int64_t receivedAtUs);
|
|
260
274
|
|
|
261
275
|
void UpdateScore();
|
|
262
276
|
|
|
@@ -264,13 +278,13 @@ namespace RTC
|
|
|
264
278
|
* Interpolate the capture instant of `ts` from a reference pair, all of them
|
|
265
279
|
* expressed in the remote sender's wall clock.
|
|
266
280
|
*
|
|
267
|
-
* @param
|
|
281
|
+
* @param referenceNtpUs - Capture instant of `referenceTs`.
|
|
268
282
|
* @param referenceTs - RTP timestamp the reference instant refers to.
|
|
269
283
|
* @param ts - RTP timestamp whose capture instant is wanted.
|
|
270
|
-
* @param
|
|
284
|
+
* @param maxDistanceUs - How far `ts` may be from `referenceTs`.
|
|
271
285
|
*/
|
|
272
|
-
std::optional<
|
|
273
|
-
|
|
286
|
+
std::optional<int64_t> InterpolateRemoteCaptureAtUs(
|
|
287
|
+
int64_t referenceNtpUs, uint32_t referenceTs, uint32_t ts, int64_t maxDistanceUs) const;
|
|
274
288
|
|
|
275
289
|
/* Pure virtual methods inherited from RTP::RtpStream. */
|
|
276
290
|
public:
|
|
@@ -288,17 +302,17 @@ namespace RTC
|
|
|
288
302
|
|
|
289
303
|
private:
|
|
290
304
|
// Passed by argument.
|
|
291
|
-
|
|
305
|
+
int64_t sendNackDelayMs{ 0 };
|
|
292
306
|
bool useRtpInactivityCheck{ false };
|
|
293
307
|
// Others.
|
|
294
308
|
// Packets expected at last interval.
|
|
295
|
-
uint32_t expectedPrior{
|
|
309
|
+
uint32_t expectedPrior{ 0 };
|
|
296
310
|
// Packets expected at last interval for score calculation.
|
|
297
|
-
uint32_t expectedPriorScore{
|
|
311
|
+
uint32_t expectedPriorScore{ 0 };
|
|
298
312
|
// Packets received at last interval.
|
|
299
|
-
uint32_t receivedPrior{
|
|
313
|
+
uint32_t receivedPrior{ 0 };
|
|
300
314
|
// Packets received at last interval for score calculation.
|
|
301
|
-
uint32_t receivedPriorScore{
|
|
315
|
+
uint32_t receivedPriorScore{ 0 };
|
|
302
316
|
// Timing data of the most recent Sender Report received.
|
|
303
317
|
std::optional<SenderReportTiming> lastSenderReportTiming;
|
|
304
318
|
// Most recent `abs-capture-time` RTP header extension received.
|
|
@@ -306,12 +320,16 @@ namespace RTC
|
|
|
306
320
|
// Most recent RTP timestamp whose capture instant could be told, along with it.
|
|
307
321
|
std::optional<CaptureMapping> lastCaptureMapping;
|
|
308
322
|
// Relative transit time for prev packet.
|
|
309
|
-
int32_t transit{
|
|
310
|
-
uint8_t firSeqNumber{
|
|
323
|
+
int32_t transit{ 0 };
|
|
324
|
+
uint8_t firSeqNumber{ 0 };
|
|
311
325
|
int32_t reportedPacketsLost{ 0 };
|
|
312
326
|
std::unique_ptr<RTC::NackGenerator> nackGenerator;
|
|
313
327
|
TimerHandleInterface* inactivityCheckPeriodicTimer{ nullptr };
|
|
314
328
|
bool inactive{ false };
|
|
329
|
+
TimerHandleInterface* spatialLayersActivityCheckPeriodicTimer{ nullptr };
|
|
330
|
+
// Whether each spatial layer was carrying traffic at the latest check.
|
|
331
|
+
// Empty unless this stream has more than a spatial layer.
|
|
332
|
+
std::vector<bool> spatialLayersActivity;
|
|
315
333
|
// Valid media + valid RTX.
|
|
316
334
|
TransmissionCounter transmissionCounter;
|
|
317
335
|
// Just valid media.
|