mediasoup 3.27.1 → 3.29.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 +26 -0
- package/node/lib/Consumer.d.ts.map +1 -1
- package/node/lib/Consumer.js +4 -51
- package/node/lib/PipeTransportTypes.d.ts +6 -1
- package/node/lib/PipeTransportTypes.d.ts.map +1 -1
- package/node/lib/PlainTransportTypes.d.ts +6 -1
- package/node/lib/PlainTransportTypes.d.ts.map +1 -1
- package/node/lib/Producer.d.ts.map +1 -1
- package/node/lib/Producer.js +4 -8
- package/node/lib/ProducerTypes.d.ts +4 -2
- package/node/lib/ProducerTypes.d.ts.map +1 -1
- package/node/lib/Router.d.ts +4 -4
- package/node/lib/Router.d.ts.map +1 -1
- package/node/lib/Router.js +14 -7
- package/node/lib/RouterTypes.d.ts +7 -1
- package/node/lib/RouterTypes.d.ts.map +1 -1
- package/node/lib/Transport.d.ts +2 -1
- package/node/lib/Transport.d.ts.map +1 -1
- package/node/lib/Transport.js +24 -16
- package/node/lib/TransportTypes.d.ts +12 -2
- package/node/lib/TransportTypes.d.ts.map +1 -1
- package/node/lib/WebRtcTransportTypes.d.ts +6 -1
- package/node/lib/WebRtcTransportTypes.d.ts.map +1 -1
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-uri.d.ts +3 -4
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-uri.d.ts.map +1 -1
- package/node/lib/fbs/rtp-parameters/rtp-header-extension-uri.js +3 -4
- package/node/lib/fbs/transport/options.d.ts +6 -2
- package/node/lib/fbs/transport/options.d.ts.map +1 -1
- package/node/lib/fbs/transport/options.js +19 -7
- package/node/lib/fbs/transport/sctp-zero-checksum.d.ts +6 -0
- package/node/lib/fbs/transport/sctp-zero-checksum.d.ts.map +1 -0
- package/node/lib/fbs/transport/sctp-zero-checksum.js +11 -0
- package/node/lib/fbs/transport/stats.d.ts +2 -8
- package/node/lib/fbs/transport/stats.d.ts.map +1 -1
- package/node/lib/fbs/transport/stats.js +5 -29
- package/node/lib/fbs/transport.d.ts +1 -0
- package/node/lib/fbs/transport.d.ts.map +1 -1
- package/node/lib/fbs/transport.js +4 -2
- package/node/lib/ortc.d.ts +0 -2
- package/node/lib/ortc.d.ts.map +1 -1
- package/node/lib/ortc.js +11 -21
- package/node/lib/rtpMappingFbsUtils.d.ts +6 -0
- package/node/lib/rtpMappingFbsUtils.d.ts.map +1 -0
- package/node/lib/rtpMappingFbsUtils.js +65 -0
- package/node/lib/rtpParametersFbsUtils.d.ts.map +1 -1
- package/node/lib/rtpParametersFbsUtils.js +0 -6
- package/node/lib/rtpParametersTypes.d.ts +1 -1
- package/node/lib/rtpParametersTypes.d.ts.map +1 -1
- package/node/lib/rtpStreamFbsUtils.d.ts +4 -0
- package/node/lib/rtpStreamFbsUtils.d.ts.map +1 -0
- package/node/lib/rtpStreamFbsUtils.js +51 -0
- package/node/lib/supportedRtpCapabilities.d.ts.map +1 -1
- package/node/lib/supportedRtpCapabilities.js +6 -13
- package/node/lib/test/test-Consumer.js +1 -13
- package/node/lib/test/test-DataConsumer.js +9 -0
- package/node/lib/test/test-DataProducer.js +38 -0
- package/node/lib/test/test-PipeTransport.js +27 -29
- package/node/lib/test/test-Producer.js +97 -0
- package/node/lib/test/test-ortc.js +34 -14
- package/npm-scripts.mjs +35 -44
- package/package.json +14 -10
- package/worker/fbs/rtpParameters.fbs +0 -1
- package/worker/fbs/transport.fbs +9 -2
- package/worker/fuzzer/src/FuzzerUtils.cpp +5 -3
- package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +16 -2
- package/worker/fuzzer/src/RTC/RTP/FuzzerRetransmissionBuffer.cpp +14 -1
- package/worker/fuzzer/src/RTC/RTP/FuzzerRtpStreamSend.cpp +17 -4
- package/worker/include/DepLibUV.hpp +13 -0
- package/worker/include/RTC/BWE/AimdRateControl.hpp +9 -9
- package/worker/include/RTC/BWE/AlrDetector.hpp +97 -0
- package/worker/include/RTC/BWE/BitrateProber.hpp +217 -0
- package/worker/include/RTC/BWE/{Utils.hpp → BitrateUtils.hpp} +3 -3
- package/worker/include/RTC/BWE/BweTypes.hpp +207 -2
- package/worker/include/RTC/BWE/DelayBasedBwe.hpp +3 -3
- package/worker/include/RTC/BWE/FeedbackAdapter.hpp +2 -16
- package/worker/include/RTC/BWE/InterArrival.hpp +117 -0
- package/worker/include/RTC/BWE/IntervalBudget.hpp +81 -0
- package/worker/include/RTC/BWE/LossBasedController.hpp +109 -4
- package/worker/include/RTC/BWE/OveruseDetector.hpp +72 -0
- package/worker/include/RTC/BWE/OveruseEstimator.hpp +115 -0
- package/worker/include/RTC/BWE/ProbeBitrateEstimator.hpp +84 -0
- package/worker/include/RTC/BWE/ProbeController.hpp +379 -0
- package/worker/include/RTC/BWE/ProbePacketGenerator.hpp +126 -0
- package/worker/include/RTC/BWE/ProbingScheduler.hpp +183 -0
- package/worker/include/RTC/BWE/ReceiverTransportCongestionController.hpp +148 -0
- package/worker/include/RTC/BWE/RembGenerator.hpp +97 -0
- package/worker/include/RTC/BWE/RemoteBitrateEstimatorAbsSendTime.hpp +237 -0
- package/worker/include/RTC/BWE/RobustThroughputEstimator.hpp +26 -0
- package/worker/include/RTC/BWE/SendPacketHistory.hpp +161 -25
- package/worker/include/RTC/BWE/SenderTransportCongestionController.hpp +343 -0
- package/worker/include/RTC/BWE/TargetRateController.hpp +4 -1
- package/worker/include/RTC/BWE/TransportWideCcFeedbackGenerator.hpp +147 -0
- package/worker/include/RTC/BWE/TrendlineEstimator.hpp +18 -3
- package/worker/include/RTC/Consts.hpp +70 -0
- package/worker/include/RTC/Consumer.hpp +8 -1
- package/worker/include/RTC/DataConsumer.hpp +3 -5
- package/worker/include/RTC/DirectTransport.hpp +4 -5
- package/worker/include/RTC/PipeTransport.hpp +4 -5
- package/worker/include/RTC/PlainTransport.hpp +4 -5
- package/worker/include/RTC/RTCP/FeedbackPsRemb.hpp +6 -7
- package/worker/include/RTC/RTCP/FeedbackRtpTransport.hpp +3 -1
- package/worker/include/RTC/RTP/Codecs/Tools.hpp +1 -1
- package/worker/include/RTC/RTP/HeaderExtensionIds.hpp +0 -1
- package/worker/include/RTC/RTP/Packet.hpp +16 -4
- package/worker/include/RTC/RTP/ProbationGenerator.hpp +0 -8
- package/worker/include/RTC/RTP/RetransmissionBuffer.hpp +36 -10
- package/worker/include/RTC/RTP/RtpStream.hpp +33 -9
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +23 -4
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +126 -11
- package/worker/include/RTC/RTP/RtxStream.hpp +10 -4
- package/worker/include/RTC/RateCalculator.hpp +103 -24
- package/worker/include/RTC/RemoteCaptureTimeEstimator.hpp +33 -3
- package/worker/include/RTC/{RtcLogger.hpp → RtcLogger/RtpPacket.hpp} +5 -3
- package/worker/include/RTC/RtcLogger/SendBurst.hpp +88 -0
- package/worker/include/RTC/RtpDictionaries.hpp +3 -4
- package/worker/include/RTC/SCTP/association/Association.hpp +1 -1
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +12 -3
- package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +0 -1
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +4 -4
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +1 -1
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +1 -1
- package/worker/include/RTC/SctpDictionaries.hpp +2 -2
- package/worker/include/RTC/TcpConnection.hpp +2 -1
- package/worker/include/RTC/Transport.hpp +23 -8
- package/worker/include/RTC/TransportCongestionControlClient.hpp +0 -5
- package/worker/include/RTC/TransportCongestionControlServer.hpp +0 -5
- package/worker/include/RTC/TransportTuple.hpp +61 -6
- package/worker/include/RTC/WebRtcTransport.hpp +4 -5
- package/worker/include/Shared.hpp +5 -0
- package/worker/include/SharedInterface.hpp +10 -0
- package/worker/include/Utils.hpp +81 -5
- package/worker/include/common.hpp +12 -4
- package/worker/include/handles/SendCallbacks.hpp +34 -0
- package/worker/include/handles/TcpConnectionHandle.hpp +4 -12
- package/worker/include/handles/UdpSocketHandle.hpp +4 -8
- package/worker/meson.build +45 -3
- package/worker/meson_options.txt +1 -0
- package/worker/mocks/include/MockShared.hpp +16 -2
- package/worker/mocks/include/handles/MockBackoffTimerHandle.hpp +1 -1
- package/worker/scripts/package-lock.json +6 -6
- package/worker/src/RTC/BWE/AimdRateControl.cpp +26 -27
- package/worker/src/RTC/BWE/AlrDetector.cpp +80 -0
- package/worker/src/RTC/BWE/BitrateProber.cpp +256 -0
- package/worker/src/RTC/BWE/{Utils.cpp → BitrateUtils.cpp} +4 -4
- package/worker/src/RTC/BWE/DelayBasedBwe.cpp +18 -22
- package/worker/src/RTC/BWE/FeedbackAdapter.cpp +21 -38
- package/worker/src/RTC/BWE/InterArrival.cpp +216 -0
- package/worker/src/RTC/BWE/IntervalBudget.cpp +93 -0
- package/worker/src/RTC/BWE/LossBasedController.cpp +189 -41
- package/worker/src/RTC/BWE/OveruseDetector.cpp +128 -0
- package/worker/src/RTC/BWE/OveruseEstimator.cpp +166 -0
- package/worker/src/RTC/BWE/ProbeBitrateEstimator.cpp +222 -0
- package/worker/src/RTC/BWE/ProbeController.cpp +645 -0
- package/worker/src/RTC/BWE/ProbePacketGenerator.cpp +135 -0
- package/worker/src/RTC/BWE/ProbingScheduler.cpp +191 -0
- package/worker/src/RTC/BWE/ReceiverTransportCongestionController.cpp +207 -0
- package/worker/src/RTC/BWE/RembGenerator.cpp +169 -0
- package/worker/src/RTC/BWE/RemoteBitrateEstimatorAbsSendTime.cpp +497 -0
- package/worker/src/RTC/BWE/RobustThroughputEstimator.cpp +47 -0
- package/worker/src/RTC/BWE/SendPacketHistory.cpp +173 -50
- package/worker/src/RTC/BWE/SenderTransportCongestionController.cpp +599 -0
- package/worker/src/RTC/BWE/TargetRateController.cpp +12 -14
- package/worker/src/RTC/BWE/TransportWideCcFeedbackGenerator.cpp +376 -0
- package/worker/src/RTC/BWE/TrendlineEstimator.cpp +24 -5
- package/worker/src/RTC/Consumer.cpp +10 -7
- package/worker/src/RTC/DataConsumer.cpp +10 -12
- package/worker/src/RTC/DirectTransport.cpp +14 -8
- package/worker/src/RTC/DtlsTransport.cpp +8 -8
- package/worker/src/RTC/ICE/IceCandidate.cpp +4 -4
- package/worker/src/RTC/ICE/IceServer.cpp +1 -1
- package/worker/src/RTC/PipeTransport.cpp +13 -8
- package/worker/src/RTC/PlainTransport.cpp +13 -8
- package/worker/src/RTC/Producer.cpp +14 -31
- package/worker/src/RTC/RTCP/Bye.cpp +1 -1
- package/worker/src/RTC/RTCP/FeedbackPsRemb.cpp +18 -0
- package/worker/src/RTC/RTCP/FeedbackPsRpsi.cpp +2 -2
- package/worker/src/RTC/RTCP/FeedbackPsVbcm.cpp +2 -1
- package/worker/src/RTC/RTCP/FeedbackRtpTransport.cpp +2 -2
- package/worker/src/RTC/RTCP/Sdes.cpp +1 -1
- package/worker/src/RTC/RTP/Codecs/DependencyDescriptor.cpp +2 -1
- package/worker/src/RTC/RTP/Packet.cpp +26 -11
- package/worker/src/RTC/RTP/ProbationGenerator.cpp +5 -6
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +21 -8
- package/worker/src/RTC/RTP/RtpStream.cpp +1 -4
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +109 -102
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +442 -258
- package/worker/src/RTC/RTP/RtxStream.cpp +32 -22
- package/worker/src/RTC/RateCalculator.cpp +133 -28
- package/worker/src/RTC/RemoteCaptureTimeEstimator.cpp +56 -1
- package/worker/src/RTC/{RtcLogger.cpp → RtcLogger/RtpPacket.cpp} +2 -2
- package/worker/src/RTC/RtcLogger/SendBurst.cpp +124 -0
- package/worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp +2 -12
- package/worker/src/RTC/RtpDictionaries/RtpParameters.cpp +1 -1
- package/worker/src/RTC/SCTP/association/Association.cpp +4 -3
- package/worker/src/RTC/SCTP/association/StateCookie.cpp +26 -6
- package/worker/src/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.cpp +4 -3
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +3 -3
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +4 -2
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +4 -4
- package/worker/src/RTC/SCTP/tx/RetransmissionQueue.cpp +4 -2
- package/worker/src/RTC/SCTP/tx/RetransmissionTimeout.cpp +4 -4
- package/worker/src/RTC/SctpDictionaries/SctpStreamParameters.cpp +6 -10
- package/worker/src/RTC/SimulcastProducerStreamManager.cpp +2 -2
- package/worker/src/RTC/SrtpSession.cpp +2 -2
- package/worker/src/RTC/SvcProducerStreamManager.cpp +2 -2
- package/worker/src/RTC/TcpConnection.cpp +2 -2
- package/worker/src/RTC/Transport.cpp +160 -113
- package/worker/src/RTC/TransportCongestionControlClient.cpp +0 -66
- package/worker/src/RTC/TransportCongestionControlServer.cpp +0 -55
- package/worker/src/RTC/TransportTuple.cpp +4 -4
- package/worker/src/RTC/WebRtcServer.cpp +4 -3
- package/worker/src/RTC/WebRtcTransport.cpp +20 -13
- package/worker/src/Utils/BitStream.cpp +24 -0
- package/worker/src/Utils/Crypto.cpp +114 -98
- package/worker/src/handles/BackoffTimerHandle.cpp +1 -1
- package/worker/src/handles/TcpConnectionHandle.cpp +13 -23
- package/worker/src/handles/UdpSocketHandle.cpp +14 -21
- package/worker/subprojects/catch2.wrap +6 -6
- package/worker/subprojects/openssl.wrap +11 -12
- package/worker/subprojects/packagefiles/ankerl-unordered-dense/meson.build +1 -1
- package/worker/subprojects/unordered-dense.wrap +4 -4
- package/worker/test/include/RTC/BWE/helpers/LinkSimulator.hpp +68 -14
- package/worker/test/include/RTC/BWE/helpers/RemoteBitrateEstimatorAbsSendTimeTestHelper.hpp +125 -0
- package/worker/test/src/RTC/BWE/TestAlrDetector.cpp +110 -0
- package/worker/test/src/RTC/BWE/TestBitrateProber.cpp +418 -0
- package/worker/test/src/RTC/BWE/TestBitrateUtils.cpp +61 -0
- package/worker/test/src/RTC/BWE/TestDelayBasedBwe.cpp +9 -9
- package/worker/test/src/RTC/BWE/TestFeedbackAdapter.cpp +79 -60
- package/worker/test/src/RTC/BWE/TestInterArrival.cpp +643 -0
- package/worker/test/src/RTC/BWE/TestInterArrivalDelta.cpp +8 -8
- package/worker/test/src/RTC/BWE/TestIntervalBudget.cpp +130 -0
- package/worker/test/src/RTC/BWE/TestOveruseDetector.cpp +519 -0
- package/worker/test/src/RTC/BWE/TestProbeBitrateEstimator.cpp +266 -0
- package/worker/test/src/RTC/BWE/TestProbeController.cpp +1685 -0
- package/worker/test/src/RTC/BWE/TestProbePacketGenerator.cpp +250 -0
- package/worker/test/src/RTC/BWE/TestProbingScheduler.cpp +236 -0
- package/worker/test/src/RTC/BWE/TestReceiverTransportCongestionController.cpp +346 -0
- package/worker/test/src/RTC/BWE/TestRembGenerator.cpp +285 -0
- package/worker/test/src/RTC/BWE/TestRemoteBitrateEstimatorAbsSendTime.cpp +414 -0
- package/worker/test/src/RTC/BWE/TestSendPacketHistory.cpp +296 -77
- package/worker/test/src/RTC/BWE/TestSenderTransportCongestionController.cpp +510 -0
- package/worker/test/src/RTC/BWE/TestTransportWideCcFeedbackGenerator.cpp +580 -0
- package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +6 -6
- package/worker/test/src/RTC/BWE/helpers/LinkSimulator.cpp +133 -29
- package/worker/test/src/RTC/BWE/helpers/RemoteBitrateEstimatorAbsSendTimeTestHelper.cpp +624 -0
- package/worker/test/src/RTC/RTCP/TestBye.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsAfb.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsFir.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsLei.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsPli.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp +20 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsRpsi.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsSli.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsTst.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackPsVbcm.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpNack.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestFeedbackRtpTransport.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestReceiverReport.cpp +1 -1
- package/worker/test/src/RTC/RTCP/TestSenderReport.cpp +1 -1
- package/worker/test/src/RTC/RTP/TestPacket.cpp +58 -4
- package/worker/test/src/RTC/RTP/TestProbationGenerator.cpp +3 -2
- package/worker/test/src/RTC/RTP/TestRetransmissionBuffer.cpp +60 -28
- package/worker/test/src/RTC/RTP/TestRtpStreamRecv.cpp +50 -0
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +804 -23
- package/worker/test/src/RTC/RTP/TestSharedPacket.cpp +1 -1
- package/worker/test/src/RTC/SCTP/association/TestAssociation.cpp +42 -0
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +54 -5
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +80 -15
- package/worker/test/src/RTC/SCTP/association/TestStreamResetHandler.cpp +410 -3
- package/worker/test/src/RTC/SCTP/association/TestTransmissionControlBlock.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +37 -5
- package/worker/test/src/RTC/SCTP/rx/TestDataTracker.cpp +5 -4
- package/worker/test/src/RTC/SCTP/rx/TestInterleavedReassemblyStreams.cpp +1 -1
- package/worker/test/src/RTC/SCTP/rx/TestReassemblyQueue.cpp +1 -1
- package/worker/test/src/RTC/SCTP/rx/TestTraditionalReassemblyStreams.cpp +1 -1
- package/worker/test/src/RTC/SCTP/tx/TestOutstandingData.cpp +1 -1
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionQueue.cpp +11 -10
- package/worker/test/src/RTC/SCTP/tx/TestRetransmissionTimeout.cpp +1 -1
- package/worker/test/src/RTC/TestNackGenerator.cpp +1 -1
- package/worker/test/src/RTC/TestPortManager.cpp +2 -2
- package/worker/test/src/RTC/TestRateCalculator.cpp +323 -61
- package/worker/test/src/RTC/TestRemoteCaptureTimeEstimator.cpp +103 -9
- package/worker/test/src/RTC/TestRemoteClockOffsetEstimator.cpp +13 -13
- package/worker/test/src/RTC/TestRtpEncodingParameters.cpp +1 -1
- package/worker/test/src/RTC/TestSimpleProducerStreamManager.cpp +34 -16
- package/worker/test/src/RTC/TestSimulcastProducerStreamManager.cpp +31 -13
- package/worker/test/src/RTC/TestSubchannelsCodec.cpp +2 -2
- package/worker/test/src/RTC/TestSvcProducerStreamManager.cpp +37 -19
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +11 -11
- package/worker/test/src/RTC/TestTransportTuple.cpp +3 -2
- package/worker/test/src/Utils/TestCrypto.cpp +71 -2
- package/worker/test/src/Utils/TestTime.cpp +120 -21
- package/worker/test/src/RTC/BWE/TestUtils.cpp +0 -61
|
@@ -536,6 +536,8 @@ test('producer.dump() succeeds', async () => {
|
|
|
536
536
|
expect(dump1.rtpParameters.encodings[0]).toEqual(expect.objectContaining({
|
|
537
537
|
codecPayloadType: 0,
|
|
538
538
|
}));
|
|
539
|
+
// No RTP has been received yet, so there are no RTP streams.
|
|
540
|
+
expect(dump1.rtpStreams).toEqual([]);
|
|
539
541
|
expect(dump1.type).toBe('simple');
|
|
540
542
|
const videoProducer = await ctx.webRtcTransport2.produce(ctx.videoProducerOptions);
|
|
541
543
|
const dump2 = await videoProducer.dump();
|
|
@@ -592,8 +594,103 @@ test('producer.dump() succeeds', async () => {
|
|
|
592
594
|
{ codecPayloadType: 112, ssrc: 22222226, rtx: { ssrc: 22222227 } },
|
|
593
595
|
{ codecPayloadType: 112, ssrc: 22222228, rtx: { ssrc: 22222229 } },
|
|
594
596
|
]);
|
|
597
|
+
// These encodings have no rid, so it must be undefined in rtpMapping.
|
|
598
|
+
expect(dump2.rtpMapping).toMatchObject({
|
|
599
|
+
encodings: [
|
|
600
|
+
{ rid: undefined, ssrc: 22222222 },
|
|
601
|
+
{ rid: undefined, ssrc: 22222224 },
|
|
602
|
+
{ rid: undefined, ssrc: 22222226 },
|
|
603
|
+
{ rid: undefined, ssrc: 22222228 },
|
|
604
|
+
],
|
|
605
|
+
});
|
|
606
|
+
expect(dump2.rtpStreams).toEqual([]);
|
|
595
607
|
expect(dump2.type).toBe('simulcast');
|
|
596
608
|
}, 2000);
|
|
609
|
+
test('producer.dump() exposes rid in rtpMapping.encodings', async () => {
|
|
610
|
+
const videoProducer = await ctx.webRtcTransport1.produce({
|
|
611
|
+
kind: 'video',
|
|
612
|
+
rtpParameters: {
|
|
613
|
+
mid: 'VIDEO',
|
|
614
|
+
codecs: [
|
|
615
|
+
{
|
|
616
|
+
mimeType: 'video/VP8',
|
|
617
|
+
payloadType: 96,
|
|
618
|
+
clockRate: 90000,
|
|
619
|
+
},
|
|
620
|
+
],
|
|
621
|
+
headerExtensions: [
|
|
622
|
+
{
|
|
623
|
+
uri: 'urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id',
|
|
624
|
+
id: 11,
|
|
625
|
+
},
|
|
626
|
+
],
|
|
627
|
+
encodings: [{ rid: 'r0' }, { rid: 'r1' }, { rid: 'r2' }],
|
|
628
|
+
rtcp: { cname: 'video-rid' },
|
|
629
|
+
},
|
|
630
|
+
});
|
|
631
|
+
const dump = await videoProducer.dump();
|
|
632
|
+
expect(dump.type).toBe('simulcast');
|
|
633
|
+
expect(dump.rtpMapping).toMatchObject({
|
|
634
|
+
encodings: [
|
|
635
|
+
{ rid: 'r0', ssrc: undefined },
|
|
636
|
+
{ rid: 'r1', ssrc: undefined },
|
|
637
|
+
{ rid: 'r2', ssrc: undefined },
|
|
638
|
+
],
|
|
639
|
+
});
|
|
640
|
+
}, 2000);
|
|
641
|
+
test('producer.dump() exposes rtpStreams once RTP is received', async () => {
|
|
642
|
+
// RTP packet without extensions or payload.
|
|
643
|
+
// payloadType: 1, seqNumber: 8, timestamp: 4, ssrc: 5.
|
|
644
|
+
// prettier-ignore
|
|
645
|
+
const rtpPacket = Buffer.from([
|
|
646
|
+
0x80, 0x01, 0x00, 0x08,
|
|
647
|
+
0x00, 0x00, 0x00, 0x04,
|
|
648
|
+
0x00, 0x00, 0x00, 0x05,
|
|
649
|
+
]);
|
|
650
|
+
// A DirectTransport is needed since it's the only one that allows injecting
|
|
651
|
+
// RTP packets via producer.send().
|
|
652
|
+
const directTransport = await ctx.router.createDirectTransport();
|
|
653
|
+
const audioProducer = await directTransport.produce({
|
|
654
|
+
kind: 'audio',
|
|
655
|
+
rtpParameters: {
|
|
656
|
+
mid: 'AUDIO',
|
|
657
|
+
codecs: [
|
|
658
|
+
{
|
|
659
|
+
mimeType: 'audio/opus',
|
|
660
|
+
payloadType: 1,
|
|
661
|
+
clockRate: 48000,
|
|
662
|
+
channels: 2,
|
|
663
|
+
},
|
|
664
|
+
],
|
|
665
|
+
encodings: [{ ssrc: 5 }],
|
|
666
|
+
rtcp: { cname: 'audio-rtp' },
|
|
667
|
+
},
|
|
668
|
+
});
|
|
669
|
+
// No RTP has been received yet, so there are no RTP streams.
|
|
670
|
+
await expect(audioProducer.dump()).resolves.toMatchObject({
|
|
671
|
+
rtpStreams: [],
|
|
672
|
+
});
|
|
673
|
+
// The worker emits a first 'score' event as soon as it creates the
|
|
674
|
+
// RtpStreamRecv, which happens upon reception of the first RTP packet.
|
|
675
|
+
const onScore = (0, enhancedEvents_1.enhancedOnce)(audioProducer, 'score');
|
|
676
|
+
audioProducer.send(rtpPacket);
|
|
677
|
+
await onScore;
|
|
678
|
+
const dump = await audioProducer.dump();
|
|
679
|
+
expect(dump.rtpStreams.length).toBe(1);
|
|
680
|
+
expect(typeof dump.rtpStreams[0].score).toBe('number');
|
|
681
|
+
expect(dump.rtpStreams[0].rtxStream).toBeUndefined();
|
|
682
|
+
expect(dump.rtpStreams[0].params).toMatchObject({
|
|
683
|
+
encodingIdx: 0,
|
|
684
|
+
ssrc: 5,
|
|
685
|
+
payloadType: 1,
|
|
686
|
+
mimeType: 'audio/opus',
|
|
687
|
+
clockRate: 48000,
|
|
688
|
+
cname: 'audio-rtp',
|
|
689
|
+
rid: undefined,
|
|
690
|
+
rtxSsrc: undefined,
|
|
691
|
+
rtxPayloadType: undefined,
|
|
692
|
+
});
|
|
693
|
+
}, 2000);
|
|
597
694
|
test('producer.getStats() succeeds', async () => {
|
|
598
695
|
const audioProducer = await ctx.webRtcTransport1.produce(ctx.audioProducerOptions);
|
|
599
696
|
const videoProducer = await ctx.webRtcTransport2.produce(ctx.videoProducerOptions);
|
|
@@ -174,7 +174,7 @@ test('generateRouterRtpCapabilities() with too many codecs throws', () => {
|
|
|
174
174
|
channels: 2,
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
expect(() => ortc.generateRouterRtpCapabilities(mediaCodecs)).toThrow(
|
|
177
|
+
expect(() => ortc.generateRouterRtpCapabilities(mediaCodecs)).toThrow();
|
|
178
178
|
});
|
|
179
179
|
test('getProducerRtpParametersMapping(), getConsumableRtpParameters(), getConsumerRtpParameters() and getPipeConsumerRtpParameters() succeed', () => {
|
|
180
180
|
const mediaCodecs = [
|
|
@@ -377,13 +377,6 @@ test('getProducerRtpParametersMapping(), getConsumableRtpParameters(), getConsum
|
|
|
377
377
|
preferredEncrypt: false,
|
|
378
378
|
direction: 'sendrecv',
|
|
379
379
|
},
|
|
380
|
-
{
|
|
381
|
-
kind: 'video',
|
|
382
|
-
uri: 'urn:ietf:params:rtp-hdrext:toffset',
|
|
383
|
-
preferredId: 9,
|
|
384
|
-
preferredEncrypt: false,
|
|
385
|
-
direction: 'sendrecv',
|
|
386
|
-
},
|
|
387
380
|
],
|
|
388
381
|
};
|
|
389
382
|
const consumerRtpParameters = ortc.getConsumerRtpParameters({
|
|
@@ -436,12 +429,6 @@ test('getProducerRtpParametersMapping(), getConsumableRtpParameters(), getConsum
|
|
|
436
429
|
encrypt: false,
|
|
437
430
|
parameters: {},
|
|
438
431
|
},
|
|
439
|
-
{
|
|
440
|
-
uri: 'urn:ietf:params:rtp-hdrext:toffset',
|
|
441
|
-
id: 9,
|
|
442
|
-
encrypt: false,
|
|
443
|
-
parameters: {},
|
|
444
|
-
},
|
|
445
432
|
]);
|
|
446
433
|
expect(consumerRtpParameters.rtcp).toEqual({
|
|
447
434
|
cname: rtpParameters.rtcp?.cname,
|
|
@@ -523,3 +510,36 @@ test('getProducerRtpParametersMapping() with incompatible params throws Unsuppor
|
|
|
523
510
|
};
|
|
524
511
|
expect(() => ortc.getProducerRtpParametersMapping(rtpParameters, routerRtpCapabilities)).toThrow(errors_1.UnsupportedError);
|
|
525
512
|
});
|
|
513
|
+
test('getProducerRtpParametersMapping() with RTX apt pointing to a non media codec throws', () => {
|
|
514
|
+
const mediaCodecs = [
|
|
515
|
+
{
|
|
516
|
+
kind: 'video',
|
|
517
|
+
mimeType: 'video/VP8',
|
|
518
|
+
clockRate: 90000,
|
|
519
|
+
},
|
|
520
|
+
];
|
|
521
|
+
const routerRtpCapabilities = ortc.generateRouterRtpCapabilities(mediaCodecs);
|
|
522
|
+
// The apt parameter of the RTX codec is its own payload type, which is not a
|
|
523
|
+
// media codec.
|
|
524
|
+
const rtpParameters = {
|
|
525
|
+
codecs: [
|
|
526
|
+
{
|
|
527
|
+
mimeType: 'video/VP8',
|
|
528
|
+
payloadType: 111,
|
|
529
|
+
clockRate: 90000,
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
mimeType: 'video/rtx',
|
|
533
|
+
payloadType: 112,
|
|
534
|
+
clockRate: 90000,
|
|
535
|
+
parameters: { apt: 112 },
|
|
536
|
+
},
|
|
537
|
+
],
|
|
538
|
+
headerExtensions: [],
|
|
539
|
+
encodings: [{ ssrc: 11111111 }],
|
|
540
|
+
rtcp: {
|
|
541
|
+
cname: 'qwerty1234',
|
|
542
|
+
},
|
|
543
|
+
};
|
|
544
|
+
expect(() => ortc.getProducerRtpParametersMapping(rtpParameters, routerRtpCapabilities)).toThrow(TypeError);
|
|
545
|
+
});
|
package/npm-scripts.mjs
CHANGED
|
@@ -566,18 +566,6 @@ function publishDryRun() {
|
|
|
566
566
|
async function checkRelease() {
|
|
567
567
|
logInfo('checkRelease()');
|
|
568
568
|
|
|
569
|
-
// Verify that CHANGELOG.md has an entry for the new version (and grab its
|
|
570
|
-
// changes, used as the GitHub release body) before the slow build steps.
|
|
571
|
-
let versionChanges;
|
|
572
|
-
|
|
573
|
-
try {
|
|
574
|
-
versionChanges = await getVersionChanges();
|
|
575
|
-
} catch (error) {
|
|
576
|
-
logError(`checkRelease() | ${error.message}`);
|
|
577
|
-
|
|
578
|
-
exitWithError();
|
|
579
|
-
}
|
|
580
|
-
|
|
581
569
|
installNodeDeps();
|
|
582
570
|
await flatcNode({ force: true });
|
|
583
571
|
buildTypescript({ force: true });
|
|
@@ -589,8 +577,6 @@ async function checkRelease() {
|
|
|
589
577
|
// Validate packaging (the `files` list in package.json) before the
|
|
590
578
|
// irreversible release steps (git push, GitHub release, npm publish).
|
|
591
579
|
publishDryRun();
|
|
592
|
-
|
|
593
|
-
return { versionChanges };
|
|
594
580
|
}
|
|
595
581
|
|
|
596
582
|
async function release({ args = '' } = {}) {
|
|
@@ -622,8 +608,17 @@ async function release({ args = '' } = {}) {
|
|
|
622
608
|
// Clean working tree required before bumping the version.
|
|
623
609
|
checkGitClean();
|
|
624
610
|
|
|
625
|
-
//
|
|
626
|
-
//
|
|
611
|
+
// CHANGELOG.md must have unreleased changes in its "### NEXT" section.
|
|
612
|
+
// Checked before the slow build steps.
|
|
613
|
+
try {
|
|
614
|
+
await checkChangelog();
|
|
615
|
+
} catch (error) {
|
|
616
|
+
logError(`release() | ${error.message}`);
|
|
617
|
+
|
|
618
|
+
exitWithError();
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// Lint, test, build and publish dry-run.
|
|
627
622
|
await checkRelease();
|
|
628
623
|
|
|
629
624
|
// Bump the version in package.json + package-lock.json and in CHANGELOG.md.
|
|
@@ -834,46 +829,42 @@ function checkGitClean() {
|
|
|
834
829
|
}
|
|
835
830
|
}
|
|
836
831
|
|
|
837
|
-
|
|
838
|
-
|
|
832
|
+
/**
|
|
833
|
+
* Verifies that the first section of CHANGELOG.md is "### NEXT" and that it is
|
|
834
|
+
* not empty.
|
|
835
|
+
*/
|
|
836
|
+
async function checkChangelog() {
|
|
837
|
+
logInfo('checkChangelog()');
|
|
839
838
|
|
|
840
839
|
// NOTE: Load dep on demand since it's a devDependency.
|
|
841
840
|
const marked = await import('marked');
|
|
842
841
|
|
|
843
842
|
const changelog = fs.readFileSync('./CHANGELOG.md', { encoding: 'utf-8' });
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
if (entry.type === 'heading' && entry.text === pkg.version) {
|
|
850
|
-
// Collect every token after the matching heading until the next heading.
|
|
851
|
-
// NOTE: We cannot just use `entries[idx + 1].raw` because `marked`
|
|
852
|
-
// inserts a `space` token between the heading and its content.
|
|
853
|
-
let changes = '';
|
|
854
|
-
|
|
855
|
-
for (let next = idx + 1; next < entries.length; ++next) {
|
|
856
|
-
if (entries[next].type === 'heading') {
|
|
857
|
-
break;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
changes += entries[next].raw;
|
|
861
|
-
}
|
|
843
|
+
const tokens = marked.lexer(changelog);
|
|
844
|
+
const idx = tokens.findIndex(
|
|
845
|
+
token => token.type === 'heading' && token.depth === 3
|
|
846
|
+
);
|
|
862
847
|
|
|
863
|
-
|
|
848
|
+
if (idx === -1 || tokens[idx].text !== 'NEXT') {
|
|
849
|
+
throw new Error("first section in CHANGELOG.md is not '### NEXT'");
|
|
850
|
+
}
|
|
864
851
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
852
|
+
// Collect every token after the "### NEXT" heading until the next heading.
|
|
853
|
+
// NOTE: We cannot just use `tokens[idx + 1].raw` because `marked` inserts a
|
|
854
|
+
// `space` token between the heading and its content.
|
|
855
|
+
let changes = '';
|
|
868
856
|
|
|
857
|
+
for (let next = idx + 1; next < tokens.length; ++next) {
|
|
858
|
+
if (tokens[next].type === 'heading') {
|
|
869
859
|
break;
|
|
870
860
|
}
|
|
861
|
+
|
|
862
|
+
changes += tokens[next].raw;
|
|
871
863
|
}
|
|
872
864
|
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
);
|
|
865
|
+
if (!changes.trim()) {
|
|
866
|
+
throw new Error("'### NEXT' section in CHANGELOG.md is empty");
|
|
867
|
+
}
|
|
877
868
|
}
|
|
878
869
|
|
|
879
870
|
async function updateChangelog(version) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mediasoup",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.29.0",
|
|
4
4
|
"description": "Cutting Edge WebRTC Video Conferencing",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
|
|
@@ -121,22 +121,26 @@
|
|
|
121
121
|
"@types/debug": "^4.1.13",
|
|
122
122
|
"@types/ini": "^4.1.1",
|
|
123
123
|
"@types/jest": "^30.0.0",
|
|
124
|
-
"@types/node": "^26.
|
|
125
|
-
"eslint": "^10.
|
|
124
|
+
"@types/node": "^26.6.4",
|
|
125
|
+
"eslint": "^10.12.0",
|
|
126
126
|
"eslint-config-prettier": "^10.1.8",
|
|
127
127
|
"eslint-plugin-jest": "^29.16.6",
|
|
128
128
|
"eslint-plugin-prettier": "^5.5.6",
|
|
129
|
-
"globals": "^17.
|
|
129
|
+
"globals": "^17.13.0",
|
|
130
130
|
"ini": "^7.0.0",
|
|
131
|
-
"jest": "^30.5.
|
|
132
|
-
"knip": "^6.
|
|
133
|
-
"marked": "^18.0
|
|
131
|
+
"jest": "^30.5.2",
|
|
132
|
+
"knip": "^6.40.0",
|
|
133
|
+
"marked": "^18.1.0",
|
|
134
134
|
"open-cli": "^9.0.0",
|
|
135
135
|
"pick-port": "^2.2.1",
|
|
136
|
-
"prettier": "^3.9.
|
|
137
|
-
"ts-jest": "^29.4.
|
|
136
|
+
"prettier": "^3.9.9",
|
|
137
|
+
"ts-jest": "^29.4.14",
|
|
138
138
|
"typescript": "^6.0.3",
|
|
139
|
-
"typescript-eslint": "^8.
|
|
139
|
+
"typescript-eslint": "^8.71.1",
|
|
140
140
|
"werift-sctp": "^0.0.11"
|
|
141
|
+
},
|
|
142
|
+
"allowScripts": {
|
|
143
|
+
"@parcel/watcher@2.6.0": true,
|
|
144
|
+
"unrs-resolver@1.12.2": true
|
|
141
145
|
}
|
|
142
146
|
}
|
package/worker/fbs/transport.fbs
CHANGED
|
@@ -121,6 +121,14 @@ table RecvRtpHeaderExtensions {
|
|
|
121
121
|
transport_wide_cc01: uint8 = null;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
// Values match the SCTP Zero Checksum Alternate Error Detection Method
|
|
125
|
+
// Identifiers (EDMID).
|
|
126
|
+
enum SctpZeroChecksum: uint32 {
|
|
127
|
+
NONE = 0,
|
|
128
|
+
SCTP_OVER_DTLS = 1,
|
|
129
|
+
TRUSTED_NETWORK = 4294967294
|
|
130
|
+
}
|
|
131
|
+
|
|
124
132
|
table Options {
|
|
125
133
|
direct: bool = false;
|
|
126
134
|
initial_available_outgoing_bitrate: uint64 = null;
|
|
@@ -131,6 +139,7 @@ table Options {
|
|
|
131
139
|
sctp_per_stream_send_queue_limit: uint32;
|
|
132
140
|
sctp_max_receiver_window_buffer_size: uint32;
|
|
133
141
|
sctp_default_stream_buffered_amount_low_threshold: uint32;
|
|
142
|
+
sctp_zero_checksum: SctpZeroChecksum = NONE;
|
|
134
143
|
is_data_channel: bool = false;
|
|
135
144
|
}
|
|
136
145
|
|
|
@@ -182,8 +191,6 @@ table Stats {
|
|
|
182
191
|
max_incoming_bitrate: uint64 = null;
|
|
183
192
|
max_outgoing_bitrate: uint64 = null;
|
|
184
193
|
min_outgoing_bitrate: uint64 = null;
|
|
185
|
-
rtp_packet_loss_received: float64 = null;
|
|
186
|
-
rtp_packet_loss_sent: float64 = null;
|
|
187
194
|
}
|
|
188
195
|
|
|
189
196
|
table SetMaxIncomingBitrateRequest {
|
|
@@ -92,10 +92,12 @@ void FuzzerUtils::Fuzz(const uint8_t* data, size_t len)
|
|
|
92
92
|
|
|
93
93
|
/* Time class. */
|
|
94
94
|
|
|
95
|
-
auto ntp = Utils::Time::
|
|
95
|
+
auto ntp = Utils::Time::TimeUsToNtp(static_cast<int64_t>(len));
|
|
96
96
|
|
|
97
|
-
Utils::Time::
|
|
97
|
+
Utils::Time::NtpToTimeUs(ntp);
|
|
98
|
+
Utils::Time::CompactNtpIntervalToTimeUs(static_cast<uint32_t>(len));
|
|
99
|
+
Utils::Time::CompactNtpRttToTimeUs(static_cast<uint32_t>(len));
|
|
98
100
|
Utils::Time::TimeUsToAbsSendTime(static_cast<int64_t>(len));
|
|
99
101
|
Utils::Time::Q32x32ToTimeUs(static_cast<int64_t>(len));
|
|
100
|
-
Utils::Time::
|
|
102
|
+
Utils::Time::TimeUsToQ32x32(static_cast<int64_t>(len));
|
|
101
103
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#include "RTC/RTP/HeaderExtensionIds.hpp"
|
|
3
3
|
#include "RTC/RTP/Packet.hpp"
|
|
4
4
|
#include "RTC/RtpDictionaries.hpp"
|
|
5
|
+
#include "Utils.hpp"
|
|
5
6
|
#include <string>
|
|
6
7
|
#include <vector>
|
|
7
8
|
|
|
@@ -35,6 +36,8 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len)
|
|
|
35
36
|
bool flip;
|
|
36
37
|
uint16_t rotation;
|
|
37
38
|
uint32_t absSendTime;
|
|
39
|
+
uint64_t absCaptureTimestamp;
|
|
40
|
+
int64_t estimatedCaptureClockOffset;
|
|
38
41
|
uint16_t playoutDelayMinDelay;
|
|
39
42
|
uint16_t playoutDelayMaxDelay;
|
|
40
43
|
uint16_t wideSeqNumber;
|
|
@@ -76,6 +79,7 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len)
|
|
|
76
79
|
headerExtensionIds.ssrcAudioLevel = 1;
|
|
77
80
|
headerExtensionIds.videoOrientation = 2;
|
|
78
81
|
headerExtensionIds.playoutDelay = 8;
|
|
82
|
+
headerExtensionIds.absCaptureTime = 9;
|
|
79
83
|
|
|
80
84
|
packet->AssignExtensionIds(headerExtensionIds);
|
|
81
85
|
|
|
@@ -91,7 +95,7 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len)
|
|
|
91
95
|
packet->HasExtension(3);
|
|
92
96
|
packet->GetExtensionValue(3, extenLen);
|
|
93
97
|
packet->ReadAbsSendTime(absSendTime);
|
|
94
|
-
packet->UpdateAbsSendTime(12345678);
|
|
98
|
+
packet->UpdateAbsSendTime(Utils::Time::TimeUsToAbsSendTime(12345678));
|
|
95
99
|
|
|
96
100
|
packet->HasExtension(4);
|
|
97
101
|
packet->GetExtensionValue(4, extenLen);
|
|
@@ -110,6 +114,11 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len)
|
|
|
110
114
|
packet->GetExtensionValue(8, extenLen);
|
|
111
115
|
packet->ReadPlayoutDelay(playoutDelayMinDelay, playoutDelayMaxDelay);
|
|
112
116
|
|
|
117
|
+
packet->HasExtension(9);
|
|
118
|
+
packet->GetExtensionValue(9, extenLen);
|
|
119
|
+
packet->ReadAbsCaptureTime(absCaptureTimestamp, estimatedCaptureClockOffset);
|
|
120
|
+
packet->UpdateAbsCaptureTime(12345678);
|
|
121
|
+
|
|
113
122
|
packet->HasExtension(6);
|
|
114
123
|
packet->HasExtension(7);
|
|
115
124
|
packet->HasExtension(8);
|
|
@@ -189,7 +198,7 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len)
|
|
|
189
198
|
packet->HasExtension(13);
|
|
190
199
|
packet->GetExtensionValue(13, extenLen);
|
|
191
200
|
packet->ReadAbsSendTime(absSendTime);
|
|
192
|
-
packet->UpdateAbsSendTime(12345678);
|
|
201
|
+
packet->UpdateAbsSendTime(Utils::Time::TimeUsToAbsSendTime(12345678));
|
|
193
202
|
|
|
194
203
|
packet->HasExtension(14);
|
|
195
204
|
packet->GetExtensionValue(14, extenLen);
|
|
@@ -208,6 +217,11 @@ void FuzzerRtcRtcPacket::Fuzz(const uint8_t* data, size_t len)
|
|
|
208
217
|
packet->GetExtensionValue(15, extenLen);
|
|
209
218
|
packet->ReadPlayoutDelay(playoutDelayMinDelay, playoutDelayMaxDelay);
|
|
210
219
|
|
|
220
|
+
packet->HasExtension(16);
|
|
221
|
+
packet->GetExtensionValue(16, extenLen);
|
|
222
|
+
packet->ReadAbsCaptureTime(absCaptureTimestamp, estimatedCaptureClockOffset);
|
|
223
|
+
packet->UpdateAbsCaptureTime(12345678);
|
|
224
|
+
|
|
211
225
|
packet->HasPayload();
|
|
212
226
|
packet->GetPayload();
|
|
213
227
|
packet->GetPayloadLength();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#include "RTC/RTP/FuzzerRetransmissionBuffer.hpp"
|
|
2
|
+
#include "DepLibUV.hpp"
|
|
2
3
|
#include "RTC/RTP/Packet.hpp"
|
|
3
4
|
#include "RTC/RTP/RetransmissionBuffer.hpp"
|
|
4
5
|
#include "RTC/RTP/SharedPacket.hpp"
|
|
@@ -26,6 +27,7 @@ void FuzzerRtcRtpRetransmissionBuffer::Fuzz(const uint8_t* data, size_t len)
|
|
|
26
27
|
// Create base RtpPacket instance.
|
|
27
28
|
auto* packet = RTC::RTP::Packet::Parse(buffer, 12);
|
|
28
29
|
size_t offset{ 0 };
|
|
30
|
+
int64_t nowMs = DepLibUV::GetTimeMs();
|
|
29
31
|
|
|
30
32
|
while (len >= 4)
|
|
31
33
|
{
|
|
@@ -35,7 +37,18 @@ void FuzzerRtcRtpRetransmissionBuffer::Fuzz(const uint8_t* data, size_t len)
|
|
|
35
37
|
packet->SetSequenceNumber(Utils::Byte::Get2Bytes(data, offset));
|
|
36
38
|
packet->SetTimestamp(Utils::Byte::Get4Bytes(data, offset));
|
|
37
39
|
|
|
38
|
-
retransmissionBuffer.Insert(packet, sharedPacket);
|
|
40
|
+
retransmissionBuffer.Insert(packet, sharedPacket, nowMs);
|
|
41
|
+
|
|
42
|
+
// Let some 'random' time pass and check whether the packet is too old.
|
|
43
|
+
nowMs += static_cast<int64_t>(Utils::Crypto::GetRandomUInt<uint64_t>(0, 1000));
|
|
44
|
+
|
|
45
|
+
const RTC::RTP::RetransmissionBuffer::Item* const item =
|
|
46
|
+
retransmissionBuffer.Get(packet->GetSequenceNumber());
|
|
47
|
+
|
|
48
|
+
if (item)
|
|
49
|
+
{
|
|
50
|
+
retransmissionBuffer.IsTooOld(item, nowMs);
|
|
51
|
+
}
|
|
39
52
|
|
|
40
53
|
len -= 4;
|
|
41
54
|
offset += 4;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#include "RTC/RTP/FuzzerRtpStreamSend.hpp"
|
|
2
|
+
#include "RTC/RTCP/ReceiverReport.hpp"
|
|
2
3
|
#include "RTC/RTP/SharedPacket.hpp"
|
|
3
4
|
#include "Utils.hpp"
|
|
4
5
|
#include "mocks/include/MockShared.hpp"
|
|
@@ -45,18 +46,30 @@ void FuzzerRtcRtpStreamSend::Fuzz(const uint8_t* data, size_t len)
|
|
|
45
46
|
std::addressof(testRtpStreamListener), std::addressof(shared), params, mid);
|
|
46
47
|
size_t offset{ 0u };
|
|
47
48
|
|
|
48
|
-
while (len >=
|
|
49
|
+
while (len >= 12)
|
|
49
50
|
{
|
|
50
51
|
const RTC::RTP::SharedPacket sharedPacket;
|
|
51
52
|
|
|
52
53
|
// Set 'random' sequence number and timestamp.
|
|
53
54
|
packet->SetSequenceNumber(Utils::Byte::Get2Bytes(data, offset));
|
|
54
|
-
packet->SetTimestamp(Utils::Byte::Get4Bytes(data, offset));
|
|
55
|
+
packet->SetTimestamp(Utils::Byte::Get4Bytes(data, offset + 2));
|
|
55
56
|
|
|
56
57
|
stream->ReceivePacket(packet, sharedPacket);
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
// Feed a 'random' Receiver Report, which is what the loss of the stream is
|
|
60
|
+
// worked out from.
|
|
61
|
+
RTC::RTCP::ReceiverReport report;
|
|
62
|
+
|
|
63
|
+
report.SetSsrc(params.ssrc);
|
|
64
|
+
report.SetLastSeq(Utils::Byte::Get4Bytes(data, offset + 6));
|
|
65
|
+
// NOTE: Signed on purpose, since a duplicate makes a remote endpoint report
|
|
66
|
+
// fewer packets lost than it reported before.
|
|
67
|
+
report.SetTotalLost(static_cast<int16_t>(Utils::Byte::Get2Bytes(data, offset + 10)));
|
|
68
|
+
|
|
69
|
+
stream->ReceiveRtcpReceiverReport(std::addressof(report), shared.GetTimeUs());
|
|
70
|
+
|
|
71
|
+
len -= 12;
|
|
72
|
+
offset += 12;
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
delete stream;
|
|
@@ -36,6 +36,19 @@ public:
|
|
|
36
36
|
return static_cast<int64_t>(uv_hrtime() / 1000);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Time at which the current iteration of the event loop began (ms).
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* - It is taken once per iteration and cached, so every caller within the same one
|
|
44
|
+
* gets the very same value no matter how long the iteration takes. That is what
|
|
45
|
+
* tells two iterations apart, which the clocks above cannot do.
|
|
46
|
+
*/
|
|
47
|
+
static uint64_t GetLoopTimeMs()
|
|
48
|
+
{
|
|
49
|
+
return uv_now(DepLibUV::GetLoop());
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
/**
|
|
40
53
|
* Offset between our own monotonic clock and the NTP epoch (us).
|
|
41
54
|
*
|
|
@@ -90,11 +90,11 @@ namespace RTC
|
|
|
90
90
|
* Feed what the delay based detector says about the network.
|
|
91
91
|
*
|
|
92
92
|
* @param input - State of the network plus the acknowledged bitrate.
|
|
93
|
-
* @param
|
|
93
|
+
* @param nowUs - Current time.
|
|
94
94
|
*
|
|
95
95
|
* @returns The new target bitrate (bps).
|
|
96
96
|
*/
|
|
97
|
-
int64_t Update(const Types::RateControlInput& input, int64_t
|
|
97
|
+
int64_t Update(const Types::RateControlInput& input, int64_t nowUs);
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Set the target bitrate from outside the rate control, for instance out of
|
|
@@ -102,7 +102,7 @@ namespace RTC
|
|
|
102
102
|
*
|
|
103
103
|
* @param bitrate - New target bitrate (bps).
|
|
104
104
|
*/
|
|
105
|
-
void SetEstimate(int64_t bitrate, int64_t
|
|
105
|
+
void SetEstimate(int64_t bitrate, int64_t nowUs);
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* @param startBitrate - Bitrate to start from (bps).
|
|
@@ -126,13 +126,13 @@ namespace RTC
|
|
|
126
126
|
* below the current target. It's what keeps a single overuse from
|
|
127
127
|
* collapsing the bitrate in a few milliseconds.
|
|
128
128
|
*/
|
|
129
|
-
bool IsTimeToReduceFurther(int64_t
|
|
129
|
+
bool IsTimeToReduceFurther(int64_t nowUs, int64_t estimatedThroughput) const;
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* As above, to be used when overusing before any throughput has been
|
|
133
133
|
* measured.
|
|
134
134
|
*/
|
|
135
|
-
bool IsInitialTimeToReduceFurther(int64_t
|
|
135
|
+
bool IsInitialTimeToReduceFurther(int64_t nowUs) const;
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Rate at which the bitrate is increased once it's close to the capacity of
|
|
@@ -147,9 +147,9 @@ namespace RTC
|
|
|
147
147
|
int64_t GetFeedbackIntervalUs() const;
|
|
148
148
|
|
|
149
149
|
private:
|
|
150
|
-
void ChangeBitrate(const Types::RateControlInput& input, int64_t
|
|
150
|
+
void ChangeBitrate(const Types::RateControlInput& input, int64_t nowUs);
|
|
151
151
|
|
|
152
|
-
void ChangeState(const Types::RateControlInput& input, int64_t
|
|
152
|
+
void ChangeState(const Types::RateControlInput& input, int64_t nowUs);
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* Apply the configured bounds to a candidate bitrate.
|
|
@@ -161,13 +161,13 @@ namespace RTC
|
|
|
161
161
|
* fast to discover it.
|
|
162
162
|
*/
|
|
163
163
|
int64_t MultiplicativeRateIncrease(
|
|
164
|
-
int64_t
|
|
164
|
+
int64_t nowUs, std::optional<int64_t> lastTimeUs, int64_t currentBitrate) const;
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
167
|
* Increase used once the capacity of the link has been estimated, which
|
|
168
168
|
* approaches it in small steps.
|
|
169
169
|
*/
|
|
170
|
-
int64_t AdditiveRateIncrease(int64_t
|
|
170
|
+
int64_t AdditiveRateIncrease(int64_t nowUs, int64_t lastTimeUs) const;
|
|
171
171
|
|
|
172
172
|
private:
|
|
173
173
|
const AimdRateControlOptions options;
|