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
|
@@ -42,21 +42,25 @@ namespace RTC
|
|
|
42
42
|
class FeedbackRtpTransportPacket : public FeedbackRtpPacket
|
|
43
43
|
{
|
|
44
44
|
public:
|
|
45
|
-
|
|
46
|
-
static constexpr int64_t
|
|
45
|
+
// Receive deltas are expressed in multiples of this.
|
|
46
|
+
static constexpr int64_t DeltaTickUs = 250;
|
|
47
|
+
// The reference time is expressed in multiples of this.
|
|
48
|
+
static constexpr int64_t BaseTimeTickUs = DeltaTickUs * (1 << 8);
|
|
49
|
+
// Period after which the reference time wraps around.
|
|
50
|
+
static constexpr int64_t TimeWrapPeriodUs = BaseTimeTickUs * (1ll << 24);
|
|
47
51
|
|
|
48
52
|
public:
|
|
49
|
-
struct
|
|
53
|
+
struct PacketStatus
|
|
50
54
|
{
|
|
51
|
-
|
|
55
|
+
PacketStatus(uint16_t sequenceNumber, bool received)
|
|
52
56
|
: sequenceNumber(sequenceNumber), received(received)
|
|
53
57
|
{
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
uint16_t sequenceNumber; // Wide sequence number.
|
|
57
|
-
int16_t delta{ 0 }; // Delta.
|
|
61
|
+
int16_t delta{ 0 }; // Delta in DeltaTickUs units.
|
|
58
62
|
bool received{ false }; // Packet received or not.
|
|
59
|
-
int64_t
|
|
63
|
+
int64_t receivedAtUs{ 0 }; // Received time (us) in remote timestamp reference.
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
public:
|
|
@@ -100,8 +104,8 @@ namespace RTC
|
|
|
100
104
|
virtual void Dump(int indentation = 0) const = 0;
|
|
101
105
|
virtual uint16_t GetCount() const = 0;
|
|
102
106
|
virtual uint16_t GetReceivedStatusCount() const = 0;
|
|
103
|
-
virtual void
|
|
104
|
-
std::vector<struct
|
|
107
|
+
virtual void FillStatuses(
|
|
108
|
+
std::vector<struct PacketStatus>& packetStatuses, uint16_t& currentSequenceNumber) const = 0;
|
|
105
109
|
virtual size_t Serialize(uint8_t* buffer) = 0;
|
|
106
110
|
};
|
|
107
111
|
|
|
@@ -127,14 +131,14 @@ namespace RTC
|
|
|
127
131
|
return this->count;
|
|
128
132
|
}
|
|
129
133
|
uint16_t GetReceivedStatusCount() const override;
|
|
130
|
-
void
|
|
131
|
-
std::vector<struct
|
|
134
|
+
void FillStatuses(
|
|
135
|
+
std::vector<struct PacketStatus>& packetStatuses,
|
|
132
136
|
uint16_t& currentSequenceNumber) const override;
|
|
133
137
|
size_t Serialize(uint8_t* buffer) override;
|
|
134
138
|
|
|
135
139
|
private:
|
|
136
140
|
Status status{ Status::None };
|
|
137
|
-
uint16_t count{
|
|
141
|
+
uint16_t count{ 0 };
|
|
138
142
|
};
|
|
139
143
|
|
|
140
144
|
private:
|
|
@@ -155,8 +159,8 @@ namespace RTC
|
|
|
155
159
|
return this->statuses.size();
|
|
156
160
|
}
|
|
157
161
|
uint16_t GetReceivedStatusCount() const override;
|
|
158
|
-
void
|
|
159
|
-
std::vector<struct
|
|
162
|
+
void FillStatuses(
|
|
163
|
+
std::vector<struct PacketStatus>& packetStatuses,
|
|
160
164
|
uint16_t& currentSequenceNumber) const override;
|
|
161
165
|
size_t Serialize(uint8_t* buffer) override;
|
|
162
166
|
|
|
@@ -182,8 +186,8 @@ namespace RTC
|
|
|
182
186
|
return this->statuses.size();
|
|
183
187
|
}
|
|
184
188
|
uint16_t GetReceivedStatusCount() const override;
|
|
185
|
-
void
|
|
186
|
-
std::vector<struct
|
|
189
|
+
void FillStatuses(
|
|
190
|
+
std::vector<struct PacketStatus>& packetStatuses,
|
|
187
191
|
uint16_t& currentSequenceNumber) const override;
|
|
188
192
|
size_t Serialize(uint8_t* buffer) override;
|
|
189
193
|
|
|
@@ -200,6 +204,17 @@ namespace RTC
|
|
|
200
204
|
public:
|
|
201
205
|
static FeedbackRtpTransportPacket* Parse(const uint8_t* data, size_t len);
|
|
202
206
|
|
|
207
|
+
private:
|
|
208
|
+
/**
|
|
209
|
+
* Turn a number of whole base time ticks elapsed into the reference time
|
|
210
|
+
* that stands for it.
|
|
211
|
+
*
|
|
212
|
+
* @remarks
|
|
213
|
+
* - The reference time is a 24 bits signed integer, so it's kept sign
|
|
214
|
+
* extended, which is how parsing it back gives it.
|
|
215
|
+
*/
|
|
216
|
+
static int32_t TicksToReferenceTime(int64_t baseTimeTicks);
|
|
217
|
+
|
|
203
218
|
private:
|
|
204
219
|
static const ankerl::unordered_dense::map<Status, std::string> Status2String;
|
|
205
220
|
|
|
@@ -216,8 +231,8 @@ namespace RTC
|
|
|
216
231
|
{
|
|
217
232
|
return this->baseSet;
|
|
218
233
|
}
|
|
219
|
-
void SetBase(uint16_t sequenceNumber,
|
|
220
|
-
AddPacketResult AddPacket(uint16_t sequenceNumber,
|
|
234
|
+
void SetBase(uint16_t sequenceNumber, int64_t timestampUs);
|
|
235
|
+
AddPacketResult AddPacket(uint16_t sequenceNumber, int64_t timestampUs, size_t maxRtcpPacketLen);
|
|
221
236
|
// Just for locally generated packets.
|
|
222
237
|
void Finish();
|
|
223
238
|
bool IsFull() const
|
|
@@ -247,27 +262,27 @@ namespace RTC
|
|
|
247
262
|
{
|
|
248
263
|
return this->referenceTime;
|
|
249
264
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
int64_t
|
|
265
|
+
/**
|
|
266
|
+
* @remarks
|
|
267
|
+
* - Only used for testing purposes.
|
|
268
|
+
*/
|
|
269
|
+
void SetReferenceTimeUs(int64_t referenceTimeUs);
|
|
270
|
+
int64_t GetReferenceTimestampUs() const // Reference time in us.
|
|
256
271
|
{
|
|
257
|
-
return
|
|
272
|
+
return TimeWrapPeriodUs + (static_cast<int64_t>(this->referenceTime) * BaseTimeTickUs);
|
|
258
273
|
}
|
|
259
|
-
int64_t
|
|
274
|
+
int64_t GetBaseDeltaUs(const int64_t previousTimestampUs) const
|
|
260
275
|
{
|
|
261
|
-
int64_t delta =
|
|
276
|
+
int64_t delta = GetReferenceTimestampUs() - previousTimestampUs;
|
|
262
277
|
|
|
263
278
|
// Compensate for wrap around.
|
|
264
|
-
if (std::abs(delta -
|
|
279
|
+
if (std::abs(delta - TimeWrapPeriodUs) < std::abs(delta))
|
|
265
280
|
{
|
|
266
|
-
delta -=
|
|
281
|
+
delta -= TimeWrapPeriodUs;
|
|
267
282
|
}
|
|
268
|
-
else if (std::abs(delta +
|
|
283
|
+
else if (std::abs(delta + TimeWrapPeriodUs) < std::abs(delta))
|
|
269
284
|
{
|
|
270
|
-
delta +=
|
|
285
|
+
delta += TimeWrapPeriodUs;
|
|
271
286
|
}
|
|
272
287
|
|
|
273
288
|
return delta;
|
|
@@ -284,11 +299,11 @@ namespace RTC
|
|
|
284
299
|
{
|
|
285
300
|
return this->latestSequenceNumber;
|
|
286
301
|
}
|
|
287
|
-
|
|
302
|
+
int64_t GetLatestTimestampUs() const // Just for locally generated packets.
|
|
288
303
|
{
|
|
289
|
-
return this->
|
|
304
|
+
return this->latestTimestampUs;
|
|
290
305
|
}
|
|
291
|
-
std::vector<struct
|
|
306
|
+
std::vector<struct PacketStatus> GetPacketStatuses() const;
|
|
292
307
|
uint8_t GetPacketFractionLost() const;
|
|
293
308
|
|
|
294
309
|
/* Pure virtual methods inherited from Packet. */
|
|
@@ -324,20 +339,20 @@ namespace RTC
|
|
|
324
339
|
private:
|
|
325
340
|
// Whether baseSequenceNumber has been set.
|
|
326
341
|
bool baseSet{ false };
|
|
327
|
-
uint16_t baseSequenceNumber{
|
|
342
|
+
uint16_t baseSequenceNumber{ 0 };
|
|
328
343
|
// 24 bits signed integer.
|
|
329
344
|
int32_t referenceTime{ 0 };
|
|
330
345
|
// Just for locally generated packets.
|
|
331
|
-
uint16_t latestSequenceNumber{
|
|
346
|
+
uint16_t latestSequenceNumber{ 0 };
|
|
332
347
|
// Just for locally generated packets.
|
|
333
|
-
|
|
334
|
-
uint16_t packetStatusCount{
|
|
335
|
-
uint8_t feedbackPacketCount{
|
|
348
|
+
int64_t latestTimestampUs{ 0 };
|
|
349
|
+
uint16_t packetStatusCount{ 0 };
|
|
350
|
+
uint8_t feedbackPacketCount{ 0 };
|
|
336
351
|
std::vector<Chunk*> chunks;
|
|
337
352
|
std::vector<int16_t> deltas;
|
|
338
353
|
// Just for locally generated packets.
|
|
339
354
|
Context context;
|
|
340
|
-
size_t deltasAndChunksSize{
|
|
355
|
+
size_t deltasAndChunksSize{ 0 };
|
|
341
356
|
size_t size{ 0 };
|
|
342
357
|
bool isCorrect{ true };
|
|
343
358
|
};
|
|
@@ -20,8 +20,8 @@ namespace RTC
|
|
|
20
20
|
// capture system but an estimation that moves. Refreshing it for audio less often
|
|
21
21
|
// than for video would make receivers combine measurements taken at different
|
|
22
22
|
// instants, and that difference is lip sync error.
|
|
23
|
-
constexpr
|
|
24
|
-
constexpr
|
|
23
|
+
constexpr int64_t MaxAudioIntervalMs{ 1000 };
|
|
24
|
+
constexpr int64_t MaxVideoIntervalMs{ 1000 };
|
|
25
25
|
|
|
26
26
|
enum class Type : uint8_t
|
|
27
27
|
{
|
|
@@ -118,7 +118,7 @@ namespace RTC
|
|
|
118
118
|
}
|
|
119
119
|
virtual size_t GetCount() const
|
|
120
120
|
{
|
|
121
|
-
return
|
|
121
|
+
return 0;
|
|
122
122
|
}
|
|
123
123
|
virtual size_t GetSize() const = 0;
|
|
124
124
|
|
|
@@ -113,7 +113,7 @@ namespace RTC
|
|
|
113
113
|
|
|
114
114
|
private:
|
|
115
115
|
Header* header{ nullptr };
|
|
116
|
-
uint8_t raw[HeaderSize]{
|
|
116
|
+
uint8_t raw[HeaderSize]{ 0 };
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
class ReceiverReportPacket : public Packet
|
|
@@ -193,7 +193,7 @@ namespace RTC
|
|
|
193
193
|
// A serialized packet can contain a maximum of 31 reports.
|
|
194
194
|
// If number of reports exceeds 31 then the required number of packets
|
|
195
195
|
// will be serialized which will take the size calculated below.
|
|
196
|
-
size_t size = (Packet::CommonHeaderSize +
|
|
196
|
+
size_t size = (Packet::CommonHeaderSize + 4 /* this->ssrc */) *
|
|
197
197
|
((this->GetCount() / maxReportsPerPacket) + 1);
|
|
198
198
|
size += ReceiverReport::HeaderSize * this->GetCount();
|
|
199
199
|
|
|
@@ -202,7 +202,7 @@ namespace RTC
|
|
|
202
202
|
|
|
203
203
|
private:
|
|
204
204
|
// SSRC of packet sender.
|
|
205
|
-
uint32_t ssrc{
|
|
205
|
+
uint32_t ssrc{ 0 };
|
|
206
206
|
std::vector<ReceiverReport*> reports;
|
|
207
207
|
};
|
|
208
208
|
} // namespace RTCP
|
|
@@ -122,7 +122,7 @@ namespace RTC
|
|
|
122
122
|
size_t Serialize(uint8_t* buffer);
|
|
123
123
|
size_t GetSize() const
|
|
124
124
|
{
|
|
125
|
-
size_t size =
|
|
125
|
+
size_t size = 4 /*ssrc*/;
|
|
126
126
|
|
|
127
127
|
for (auto* item : this->items)
|
|
128
128
|
{
|
|
@@ -158,7 +158,7 @@ namespace RTC
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
private:
|
|
161
|
-
uint32_t ssrc{
|
|
161
|
+
uint32_t ssrc{ 0 };
|
|
162
162
|
std::vector<SdesItem*> items;
|
|
163
163
|
};
|
|
164
164
|
|
|
@@ -143,7 +143,7 @@ namespace RTC
|
|
|
143
143
|
}
|
|
144
144
|
size_t GetSize() const override
|
|
145
145
|
{
|
|
146
|
-
size_t size = Packet::CommonHeaderSize +
|
|
146
|
+
size_t size = Packet::CommonHeaderSize + 4 /*ssrc*/;
|
|
147
147
|
|
|
148
148
|
for (auto* report : this->reports)
|
|
149
149
|
{
|
|
@@ -154,7 +154,7 @@ namespace RTC
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
private:
|
|
157
|
-
uint32_t ssrc{
|
|
157
|
+
uint32_t ssrc{ 0 };
|
|
158
158
|
std::vector<ExtendedReportBlock*> reports;
|
|
159
159
|
};
|
|
160
160
|
} // namespace RTCP
|
|
@@ -29,7 +29,7 @@ namespace RTC
|
|
|
29
29
|
|
|
30
30
|
class PictureIdList
|
|
31
31
|
{
|
|
32
|
-
static constexpr uint16_t MaxCurrentLayerPictureIdNum{
|
|
32
|
+
static constexpr uint16_t MaxCurrentLayerPictureIdNum{ 1000 };
|
|
33
33
|
|
|
34
34
|
public:
|
|
35
35
|
explicit PictureIdList() = default;
|
|
@@ -93,8 +93,8 @@ namespace RTC
|
|
|
93
93
|
public:
|
|
94
94
|
struct Params
|
|
95
95
|
{
|
|
96
|
-
uint8_t spatialLayers{
|
|
97
|
-
uint8_t temporalLayers{
|
|
96
|
+
uint8_t spatialLayers{ 1 };
|
|
97
|
+
uint8_t temporalLayers{ 1 };
|
|
98
98
|
bool ksvc{ false };
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -158,11 +158,11 @@ namespace RTC
|
|
|
158
158
|
void Restore(RTP::Packet* packet) override;
|
|
159
159
|
uint8_t GetSpatialLayer() const override
|
|
160
160
|
{
|
|
161
|
-
return
|
|
161
|
+
return 0;
|
|
162
162
|
}
|
|
163
163
|
uint8_t GetTemporalLayer() const override
|
|
164
164
|
{
|
|
165
|
-
return this->payloadDescriptor->hasTlIndex ? this->payloadDescriptor->tlIndex :
|
|
165
|
+
return this->payloadDescriptor->hasTlIndex ? this->payloadDescriptor->tlIndex : 0;
|
|
166
166
|
}
|
|
167
167
|
bool IsKeyFrame() const override
|
|
168
168
|
{
|
|
@@ -141,11 +141,11 @@ namespace RTC
|
|
|
141
141
|
}
|
|
142
142
|
uint8_t GetSpatialLayer() const override
|
|
143
143
|
{
|
|
144
|
-
return this->payloadDescriptor->hasSlIndex ? this->payloadDescriptor->slIndex :
|
|
144
|
+
return this->payloadDescriptor->hasSlIndex ? this->payloadDescriptor->slIndex : 0;
|
|
145
145
|
}
|
|
146
146
|
uint8_t GetTemporalLayer() const override
|
|
147
147
|
{
|
|
148
|
-
return this->payloadDescriptor->hasTlIndex ? this->payloadDescriptor->tlIndex :
|
|
148
|
+
return this->payloadDescriptor->hasTlIndex ? this->payloadDescriptor->tlIndex : 0;
|
|
149
149
|
}
|
|
150
150
|
bool IsKeyFrame() const override
|
|
151
151
|
{
|
|
@@ -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
|