mediasoup 3.27.0 → 3.28.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 +19 -0
- package/node/lib/Consumer.d.ts.map +1 -1
- package/node/lib/Consumer.js +4 -51
- 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.map +1 -1
- package/node/lib/Router.js +4 -0
- package/node/lib/Transport.d.ts.map +1 -1
- package/node/lib/Transport.js +7 -10
- 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/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/package.json +10 -10
- package/worker/fbs/FBS/meson.build +25 -0
- package/worker/fbs/meson.build +15 -18
- package/worker/fbs/rtpParameters.fbs +0 -1
- package/worker/fuzzer/src/FuzzerUtils.cpp +5 -3
- package/worker/fuzzer/src/RTC/RTP/FuzzerPacket.cpp +16 -2
- package/worker/include/DepLibUV.hpp +13 -0
- package/worker/include/RTC/BWE/AlrDetector.hpp +97 -0
- package/worker/include/RTC/BWE/BitrateProber.hpp +217 -0
- package/worker/include/RTC/BWE/BitrateUtils.hpp +39 -0
- package/worker/include/RTC/BWE/BweTypes.hpp +171 -3
- package/worker/include/RTC/BWE/FeedbackAdapter.hpp +0 -14
- 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 +625 -0
- package/worker/include/RTC/BWE/OveruseDetector.hpp +71 -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 +130 -0
- package/worker/include/RTC/BWE/ProbingScheduler.hpp +187 -0
- package/worker/include/RTC/BWE/RembGenerator.hpp +96 -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/TargetRateController.hpp +306 -0
- package/worker/include/RTC/BWE/TransportWideCcFeedbackGenerator.hpp +146 -0
- package/worker/include/RTC/BWE/TrendlineEstimator.hpp +73 -16
- package/worker/include/RTC/Consts.hpp +70 -0
- 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/RtpStream.hpp +12 -9
- package/worker/include/RTC/RTP/RtpStreamRecv.hpp +22 -4
- package/worker/include/RTC/RTP/RtpStreamSend.hpp +4 -2
- 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/association/StreamResetHandler.hpp +36 -0
- package/worker/include/RTC/SCTP/public/AssociationMetrics.hpp +0 -1
- package/worker/include/RTC/SCTP/public/SctpTypes.hpp +9 -9
- package/worker/include/RTC/SCTP/rx/DataTracker.hpp +1 -1
- package/worker/include/RTC/SCTP/rx/ReassemblyQueue.hpp +11 -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/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 +72 -3
- 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 -1
- 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 +4 -5
- package/worker/src/RTC/BWE/AlrDetector.cpp +80 -0
- package/worker/src/RTC/BWE/BitrateProber.cpp +256 -0
- package/worker/src/RTC/BWE/BitrateUtils.cpp +54 -0
- package/worker/src/RTC/BWE/DelayBasedBwe.cpp +2 -2
- package/worker/src/RTC/BWE/FeedbackAdapter.cpp +20 -37
- 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 +1194 -0
- 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 +140 -0
- package/worker/src/RTC/BWE/ProbingScheduler.cpp +196 -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/TargetRateController.cpp +433 -0
- package/worker/src/RTC/BWE/TransportWideCcFeedbackGenerator.cpp +377 -0
- package/worker/src/RTC/BWE/TrendlineEstimator.cpp +102 -5
- package/worker/src/RTC/Consumer.cpp +7 -5
- package/worker/src/RTC/DataConsumer.cpp +8 -10
- 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/RtpStream.cpp +1 -1
- package/worker/src/RTC/RTP/RtpStreamRecv.cpp +69 -48
- package/worker/src/RTC/RTP/RtpStreamSend.cpp +31 -31
- package/worker/src/RTC/RTP/RtxStream.cpp +22 -7
- 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 +16 -2
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +106 -1
- package/worker/src/RTC/SCTP/public/AssociationMetrics.cpp +1 -1
- package/worker/src/RTC/SCTP/rx/InterleavedReassemblyStreams.cpp +3 -3
- package/worker/src/RTC/SCTP/rx/ReassemblyQueue.cpp +2 -1
- package/worker/src/RTC/SCTP/rx/TraditionalReassemblyStreams.cpp +4 -4
- 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 +112 -75
- 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/handles/BackoffTimerHandle.cpp +1 -1
- package/worker/src/handles/TcpConnectionHandle.cpp +13 -23
- package/worker/src/handles/UdpSocketHandle.cpp +14 -21
- package/worker/tasks.py +43 -18
- 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 +4 -4
- package/worker/test/src/RTC/BWE/TestFeedbackAdapter.cpp +53 -37
- package/worker/test/src/RTC/BWE/TestInterArrival.cpp +643 -0
- package/worker/test/src/RTC/BWE/TestIntervalBudget.cpp +130 -0
- package/worker/test/src/RTC/BWE/TestLossBasedController.cpp +1199 -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 +1682 -0
- package/worker/test/src/RTC/BWE/TestProbePacketGenerator.cpp +265 -0
- package/worker/test/src/RTC/BWE/TestProbingScheduler.cpp +260 -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/TestTargetRateController.cpp +337 -0
- package/worker/test/src/RTC/BWE/TestTransportWideCcFeedbackGenerator.cpp +578 -0
- package/worker/test/src/RTC/BWE/TestTrendlineEstimator.cpp +45 -0
- package/worker/test/src/RTC/BWE/helpers/LinkSimulator.cpp +133 -29
- package/worker/test/src/RTC/BWE/helpers/RemoteBitrateEstimatorAbsSendTimeTestHelper.cpp +625 -0
- package/worker/test/src/RTC/RTCP/TestFeedbackPsRemb.cpp +19 -0
- 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/TestRtpStreamRecv.cpp +50 -0
- package/worker/test/src/RTC/RTP/TestRtpStreamSend.cpp +59 -0
- package/worker/test/src/RTC/SCTP/association/TestStreamResetHandler.cpp +111 -0
- package/worker/test/src/RTC/TestRateCalculator.cpp +322 -60
- package/worker/test/src/RTC/TestRemoteCaptureTimeEstimator.cpp +95 -7
- package/worker/test/src/RTC/TestSimpleProducerStreamManager.cpp +34 -16
- package/worker/test/src/RTC/TestSimulcastProducerStreamManager.cpp +31 -13
- package/worker/test/src/RTC/TestSvcProducerStreamManager.cpp +37 -19
- package/worker/test/src/RTC/TestTransportCongestionControlServer.cpp +10 -10
- package/worker/test/src/Utils/TestTime.cpp +120 -21
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include "Channel/ChannelRequest.hpp"
|
|
7
7
|
#include "Channel/ChannelSocket.hpp"
|
|
8
8
|
#include "FBS/transport.h"
|
|
9
|
+
#include "handles/SendCallbacks.hpp"
|
|
9
10
|
#include "handles/TimerHandleInterface.hpp"
|
|
10
11
|
#include "RTC/Consumer.hpp"
|
|
11
12
|
#include "RTC/DataConsumer.hpp"
|
|
@@ -28,6 +29,9 @@
|
|
|
28
29
|
#include "RTC/TransportCongestionControlServer.hpp"
|
|
29
30
|
#endif
|
|
30
31
|
#include "SharedInterface.hpp"
|
|
32
|
+
#ifdef MS_RTC_LOGGER_SEND_BURST
|
|
33
|
+
#include "RTC/RtcLogger/SendBurst.hpp"
|
|
34
|
+
#endif
|
|
31
35
|
#include <ankerl/unordered_dense.h>
|
|
32
36
|
#include <string>
|
|
33
37
|
#include <vector>
|
|
@@ -47,10 +51,6 @@ namespace RTC
|
|
|
47
51
|
public Channel::ChannelSocket::NotificationHandler,
|
|
48
52
|
public TimerHandleInterface::Listener
|
|
49
53
|
{
|
|
50
|
-
protected:
|
|
51
|
-
using onSendCallback = const std::function<void(bool sent)>;
|
|
52
|
-
using onQueuedCallback = const std::function<void(bool queued, bool sctpSendBufferFull)>;
|
|
53
|
-
|
|
54
54
|
public:
|
|
55
55
|
class Listener
|
|
56
56
|
{
|
|
@@ -202,7 +202,9 @@ namespace RTC
|
|
|
202
202
|
virtual void ReceiveRtcpPacket(RTC::RTCP::Packet* packet, int64_t receivedAtUs) final;
|
|
203
203
|
virtual void ReceiveSctpData(const uint8_t* data, size_t len, int64_t receivedAtUs) final;
|
|
204
204
|
virtual void SendSctpMessage(
|
|
205
|
-
RTC::DataConsumer* dataConsumer,
|
|
205
|
+
RTC::DataConsumer* dataConsumer,
|
|
206
|
+
RTC::SCTP::Message message,
|
|
207
|
+
onMessageQueuedCallback cb = {}) final;
|
|
206
208
|
|
|
207
209
|
private:
|
|
208
210
|
virtual RTC::Producer* AssertAndGetProducerById(
|
|
@@ -228,14 +230,20 @@ namespace RTC
|
|
|
228
230
|
{
|
|
229
231
|
return false;
|
|
230
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Bytes that every packet sent through this transport carries on top of its
|
|
235
|
+
* own length once it's on the network, or zero while no path has been
|
|
236
|
+
* chosen yet.
|
|
237
|
+
*/
|
|
238
|
+
virtual size_t GetPacketOverhead() const = 0;
|
|
231
239
|
virtual void SendRtpPacket(
|
|
232
|
-
RTC::Consumer* consumer, RTC::RTP::Packet* packet,
|
|
240
|
+
RTC::Consumer* consumer, RTC::RTP::Packet* packet, onSendCallback cb = {}) = 0;
|
|
233
241
|
virtual void HandleRtcpPacket(RTC::RTCP::Packet* packet, int64_t receivedAtUs) final;
|
|
234
242
|
virtual void SendRtcp(int64_t nowUs) final;
|
|
235
243
|
virtual void SendRtcpPacket(RTC::RTCP::Packet* packet) = 0;
|
|
236
244
|
virtual void SendRtcpCompoundPacket(RTC::RTCP::CompoundPacket* packet) = 0;
|
|
237
245
|
virtual void SendMessage(
|
|
238
|
-
RTC::DataConsumer* dataConsumer, RTC::SCTP::Message message,
|
|
246
|
+
RTC::DataConsumer* dataConsumer, RTC::SCTP::Message message, onMessageQueuedCallback cb = {}) = 0;
|
|
239
247
|
virtual bool SendData(const uint8_t* data, size_t len) = 0;
|
|
240
248
|
virtual void RecvStreamClosed(uint32_t ssrc) = 0;
|
|
241
249
|
virtual void SendStreamClosed(uint32_t ssrc) = 0;
|
|
@@ -308,7 +316,7 @@ namespace RTC
|
|
|
308
316
|
/* Pure virtual methods inherited from RTC::DataConsumer::Listener. */
|
|
309
317
|
public:
|
|
310
318
|
void OnDataConsumerSendMessage(
|
|
311
|
-
RTC::DataConsumer* dataConsumer, RTC::SCTP::Message message,
|
|
319
|
+
RTC::DataConsumer* dataConsumer, RTC::SCTP::Message message, onMessageQueuedCallback cb) override;
|
|
312
320
|
void OnDataConsumerNeedBufferedAmount(
|
|
313
321
|
const RTC::DataConsumer* dataConsumer, uint32_t& bufferedAmount) const override;
|
|
314
322
|
void OnDataConsumerNeedBufferedAmountLowThreshold(
|
|
@@ -412,6 +420,13 @@ namespace RTC
|
|
|
412
420
|
size_t maxSendMessageSize{ 0 };
|
|
413
421
|
size_t maxReceiveMessageSize{ 0 };
|
|
414
422
|
struct TraceEventTypes traceEventTypes;
|
|
423
|
+
|
|
424
|
+
#ifdef MS_RTC_LOGGER_SEND_BURST
|
|
425
|
+
private:
|
|
426
|
+
RTC::RtcLogger::SendBurst sendBurstLogger;
|
|
427
|
+
// Allocated by this.
|
|
428
|
+
TimerHandleInterface* sendBurstLoggerTimer{ nullptr };
|
|
429
|
+
#endif
|
|
415
430
|
};
|
|
416
431
|
} // namespace RTC
|
|
417
432
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
5
|
#include "FBS/transport.h"
|
|
6
|
+
#include "handles/SendCallbacks.hpp"
|
|
7
|
+
#include "RTC/Consts.hpp"
|
|
6
8
|
#include "RTC/TcpConnection.hpp"
|
|
7
9
|
#include "RTC/UdpSocket.hpp"
|
|
8
10
|
#include "Utils.hpp"
|
|
@@ -13,9 +15,6 @@ namespace RTC
|
|
|
13
15
|
{
|
|
14
16
|
class TransportTuple
|
|
15
17
|
{
|
|
16
|
-
protected:
|
|
17
|
-
using onSendCallback = const std::function<void(bool sent)>;
|
|
18
|
-
|
|
19
18
|
public:
|
|
20
19
|
enum class Protocol : uint8_t
|
|
21
20
|
{
|
|
@@ -139,15 +138,15 @@ namespace RTC
|
|
|
139
138
|
this->localAnnouncedAddress = localAnnouncedAddress;
|
|
140
139
|
}
|
|
141
140
|
|
|
142
|
-
void Send(const uint8_t* data, size_t len,
|
|
141
|
+
void Send(const uint8_t* data, size_t len, onSendCallback cb = {})
|
|
143
142
|
{
|
|
144
143
|
if (this->protocol == Protocol::UDP)
|
|
145
144
|
{
|
|
146
|
-
this->udpSocket->Send(data, len, this->udpRemoteAddr, cb);
|
|
145
|
+
this->udpSocket->Send(data, len, this->udpRemoteAddr, std::move(cb));
|
|
147
146
|
}
|
|
148
147
|
else
|
|
149
148
|
{
|
|
150
|
-
this->tcpConnection->Send(data, len, cb);
|
|
149
|
+
this->tcpConnection->Send(data, len, std::move(cb));
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -156,6 +155,62 @@ namespace RTC
|
|
|
156
155
|
return this->protocol;
|
|
157
156
|
}
|
|
158
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Bytes that every packet sent through this tuple carries on top of its own
|
|
160
|
+
* length, which is what the network sees but nothing in here counts.
|
|
161
|
+
*
|
|
162
|
+
* @remarks
|
|
163
|
+
* - It only contemplates IPv4 and IPv6 for the network layer and UDP and
|
|
164
|
+
* TCP for the transport one, both without options, plus the length field
|
|
165
|
+
* that frames a packet sent over TCP. Anything below that, such as the
|
|
166
|
+
* Ethernet frame or a tunnel, is not counted.
|
|
167
|
+
*/
|
|
168
|
+
size_t GetPacketOverhead() const
|
|
169
|
+
{
|
|
170
|
+
size_t overhead{ 0 };
|
|
171
|
+
|
|
172
|
+
switch (GetLocalAddress()->sa_family)
|
|
173
|
+
{
|
|
174
|
+
case AF_INET:
|
|
175
|
+
{
|
|
176
|
+
overhead += RTC::Consts::Ipv4HeaderSize;
|
|
177
|
+
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
case AF_INET6:
|
|
182
|
+
{
|
|
183
|
+
overhead += RTC::Consts::Ipv6HeaderSize;
|
|
184
|
+
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
default:
|
|
189
|
+
{
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
switch (this->protocol)
|
|
195
|
+
{
|
|
196
|
+
case Protocol::UDP:
|
|
197
|
+
{
|
|
198
|
+
overhead += RTC::Consts::UdpHeaderSize;
|
|
199
|
+
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
case Protocol::TCP:
|
|
204
|
+
{
|
|
205
|
+
overhead += RTC::Consts::TcpHeaderSize + RTC::Consts::TcpFramingSize;
|
|
206
|
+
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return overhead;
|
|
212
|
+
}
|
|
213
|
+
|
|
159
214
|
const struct sockaddr* GetLocalAddress() const
|
|
160
215
|
{
|
|
161
216
|
if (this->protocol == Protocol::UDP)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#ifndef MS_RTC_WEBRTC_TRANSPORT_HPP
|
|
2
2
|
#define MS_RTC_WEBRTC_TRANSPORT_HPP
|
|
3
3
|
|
|
4
|
+
#include "handles/SendCallbacks.hpp"
|
|
4
5
|
#include "RTC/DtlsTransport.hpp"
|
|
5
6
|
#include "RTC/ICE/IceCandidate.hpp"
|
|
6
7
|
#include "RTC/ICE/IceServer.hpp"
|
|
@@ -82,17 +83,15 @@ namespace RTC
|
|
|
82
83
|
|
|
83
84
|
private:
|
|
84
85
|
bool IsConnected() const override;
|
|
86
|
+
size_t GetPacketOverhead() const override;
|
|
85
87
|
void MayRunDtlsTransport();
|
|
86
|
-
void SendRtpPacket(
|
|
87
|
-
RTC::Consumer* consumer,
|
|
88
|
-
RTC::RTP::Packet* packet,
|
|
89
|
-
RTC::Transport::onSendCallback* cb = nullptr) override;
|
|
88
|
+
void SendRtpPacket(RTC::Consumer* consumer, RTC::RTP::Packet* packet, onSendCallback cb = {}) override;
|
|
90
89
|
void SendRtcpPacket(RTC::RTCP::Packet* packet) override;
|
|
91
90
|
void SendRtcpCompoundPacket(RTC::RTCP::CompoundPacket* packet) override;
|
|
92
91
|
void SendMessage(
|
|
93
92
|
RTC::DataConsumer* dataConsumer,
|
|
94
93
|
RTC::SCTP::Message message,
|
|
95
|
-
|
|
94
|
+
onMessageQueuedCallback cb = {}) override;
|
|
96
95
|
bool SendData(const uint8_t* data, size_t len) override;
|
|
97
96
|
void RecvStreamClosed(uint32_t ssrc) override;
|
|
98
97
|
void SendStreamClosed(uint32_t ssrc) override;
|
|
@@ -51,6 +51,16 @@ public:
|
|
|
51
51
|
*/
|
|
52
52
|
virtual int64_t GetTimeUs() = 0;
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Get the time at which the current iteration of the event loop began (ms).
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* - It stays the same throughout an iteration no matter how long it takes, so it is
|
|
59
|
+
* what tells two iterations apart. The clocks above cannot, since they move while
|
|
60
|
+
* the iteration runs.
|
|
61
|
+
*/
|
|
62
|
+
virtual uint64_t GetLoopTimeMs() = 0;
|
|
63
|
+
|
|
54
64
|
/**
|
|
55
65
|
* Distance from the clock above to the NTP epoch (us), which is what has to be added
|
|
56
66
|
* to it to obtain the NTP timestamps of the RTCP we generate.
|
package/worker/include/Utils.hpp
CHANGED
|
@@ -515,10 +515,40 @@ namespace Utils
|
|
|
515
515
|
uint32_t fractions;
|
|
516
516
|
};
|
|
517
517
|
|
|
518
|
+
/**
|
|
519
|
+
* Convert microseconds into milliseconds.
|
|
520
|
+
*
|
|
521
|
+
* @remarks
|
|
522
|
+
* - The result is rounded to the nearest millisecond, halves upwards.
|
|
523
|
+
*/
|
|
524
|
+
static int64_t TimeUsToMs(int64_t timeUs)
|
|
525
|
+
{
|
|
526
|
+
// NOTE: The remainder decides the rounding instead of adding half the
|
|
527
|
+
// divisor first, which would overflow for a time close to the maximum.
|
|
528
|
+
// Integer division truncates towards zero, so a negative remainder is
|
|
529
|
+
// walked down to the next whole millisecond for halves to go upwards
|
|
530
|
+
// there too.
|
|
531
|
+
const int64_t quotient = timeUs / 1000;
|
|
532
|
+
const int64_t remainder = timeUs % 1000;
|
|
533
|
+
|
|
534
|
+
if (remainder >= 500)
|
|
535
|
+
{
|
|
536
|
+
return quotient + 1;
|
|
537
|
+
}
|
|
538
|
+
else if (remainder < -500)
|
|
539
|
+
{
|
|
540
|
+
return quotient - 1;
|
|
541
|
+
}
|
|
542
|
+
else
|
|
543
|
+
{
|
|
544
|
+
return quotient;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
518
548
|
/**
|
|
519
549
|
* Convert microseconds into an NTP timestamp.
|
|
520
550
|
*/
|
|
521
|
-
static Time::Ntp
|
|
551
|
+
static Time::Ntp TimeUsToNtp(int64_t timeUs)
|
|
522
552
|
{
|
|
523
553
|
Time::Ntp ntp{}; // NOLINT(cppcoreguidelines-pro-type-member-init)
|
|
524
554
|
|
|
@@ -536,7 +566,7 @@ namespace Utils
|
|
|
536
566
|
/**
|
|
537
567
|
* Convert an NTP timestamp into microseconds.
|
|
538
568
|
*/
|
|
539
|
-
static int64_t
|
|
569
|
+
static int64_t NtpToTimeUs(Time::Ntp ntp)
|
|
540
570
|
{
|
|
541
571
|
return (
|
|
542
572
|
(static_cast<int64_t>(ntp.seconds) * 1000000) +
|
|
@@ -544,6 +574,45 @@ namespace Utils
|
|
|
544
574
|
std::round((static_cast<double>(ntp.fractions) * 1000000) / NtpFractionalUnit)));
|
|
545
575
|
}
|
|
546
576
|
|
|
577
|
+
/**
|
|
578
|
+
* Convert an interval in compact NTP representation (the middle 32 bits of an
|
|
579
|
+
* NTP timestamp, so 1/65536 seconds units) into microseconds.
|
|
580
|
+
*
|
|
581
|
+
* @remarks
|
|
582
|
+
* - The interval is usually the difference between two compact NTP timestamps,
|
|
583
|
+
* which wraps around every 65536 seconds. Values above 0x80000000 are hence
|
|
584
|
+
* taken as negative intervals rather than as intervals of more than 32768
|
|
585
|
+
* seconds.
|
|
586
|
+
* - The result is rounded to the nearest microsecond, halves upwards.
|
|
587
|
+
*/
|
|
588
|
+
static int64_t CompactNtpIntervalToTimeUs(uint32_t compactNtpInterval)
|
|
589
|
+
{
|
|
590
|
+
auto value = static_cast<int64_t>(compactNtpInterval);
|
|
591
|
+
|
|
592
|
+
if (compactNtpInterval > 0x80000000)
|
|
593
|
+
{
|
|
594
|
+
value -= (int64_t{ 1 } << 32);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// NOTE: Right shifting a negative value rounds towards negative infinity,
|
|
598
|
+
// so adding half the divisor first rounds to the nearest value.
|
|
599
|
+
return ((value * 1000000) + (1 << 15)) >> 16;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Convert a round trip time in compact NTP representation into microseconds.
|
|
604
|
+
*
|
|
605
|
+
* @remarks
|
|
606
|
+
* - A non-monotonic clock can make the round trip time negative, so a negative
|
|
607
|
+
* value, as well as one too small to be true, yields 1 millisecond.
|
|
608
|
+
*/
|
|
609
|
+
static int64_t CompactNtpRttToTimeUs(uint32_t compactNtpRtt)
|
|
610
|
+
{
|
|
611
|
+
static constexpr int64_t MinRttUs{ 1000 };
|
|
612
|
+
|
|
613
|
+
return std::max(CompactNtpIntervalToTimeUs(compactNtpRtt), MinRttUs);
|
|
614
|
+
}
|
|
615
|
+
|
|
547
616
|
/**
|
|
548
617
|
* Convert microseconds into the 6.18 fixed point seconds of the
|
|
549
618
|
* `abs-send-time` RTP header extension, whose resolution is hence 1/262144
|
|
@@ -572,7 +641,7 @@ namespace Utils
|
|
|
572
641
|
*
|
|
573
642
|
* @see https://datatracker.ietf.org/doc/html/draft-ietf-avtcore-abs-capture-time-00
|
|
574
643
|
*/
|
|
575
|
-
static std::optional<int64_t>
|
|
644
|
+
static std::optional<int64_t> TimeUsToQ32x32(int64_t timeUs)
|
|
576
645
|
{
|
|
577
646
|
// The seconds of the format are 32 bits wide, so from here on it does not fit.
|
|
578
647
|
static constexpr int64_t OutOfRangeUs{ (1LL << 31) * 1000000 };
|
|
@@ -29,14 +29,22 @@ typedef SSIZE_T ssize_t;
|
|
|
29
29
|
#endif
|
|
30
30
|
// IWYU pragma: end_exports
|
|
31
31
|
|
|
32
|
-
// This is a macro to silence false warnings in
|
|
33
|
-
//
|
|
32
|
+
// This is a macro to silence false warnings in switch() blocks that already
|
|
33
|
+
// cover every value of their enum and hence need no default label.
|
|
34
|
+
//
|
|
35
|
+
// GCC warns that the enum is not fully handled (typically with FBS types) and
|
|
36
|
+
// MSVC warns that the function may fall off its end without returning a value,
|
|
37
|
+
// so each of them is told that reaching the default label is impossible.
|
|
34
38
|
#if defined(__GNUC__) && !defined(__clang__)
|
|
35
|
-
#define
|
|
39
|
+
#define NO_DEFAULT() \
|
|
36
40
|
default: \
|
|
37
41
|
__builtin_unreachable()
|
|
42
|
+
#elif defined(_MSC_VER)
|
|
43
|
+
#define NO_DEFAULT() \
|
|
44
|
+
default: \
|
|
45
|
+
__assume(0)
|
|
38
46
|
#else
|
|
39
|
-
#define
|
|
47
|
+
#define NO_DEFAULT()
|
|
40
48
|
#endif
|
|
41
49
|
|
|
42
50
|
using ChannelReadCtx = void*;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef MS_SEND_CALLBACKS_HPP
|
|
2
|
+
#define MS_SEND_CALLBACKS_HPP
|
|
3
|
+
|
|
4
|
+
#include "common.hpp"
|
|
5
|
+
|
|
6
|
+
// NOTE: Nothing ever copies one of these, so what they want to be is move only
|
|
7
|
+
// callables. `std::function` is used instead because we are on C++20, and it
|
|
8
|
+
// additionally demands that the callable be copyable, so a lambda capturing
|
|
9
|
+
// anything move only is rejected.
|
|
10
|
+
//
|
|
11
|
+
// TODO: Once we upgrade to C++23, replace both with `std::move_only_function`.
|
|
12
|
+
// Its signature must carry a trailing `const` so that its `operator()` is const
|
|
13
|
+
// and the paths that hold one by const reference keep compiling:
|
|
14
|
+
// using onSendCallback = std::move_only_function<void(bool sent) const>;
|
|
15
|
+
// using onMessageQueuedCallback =
|
|
16
|
+
// std::move_only_function<void(bool queued, bool isSendBufferFull) const>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Told whether a packet handed over for sending actually left the socket.
|
|
20
|
+
*
|
|
21
|
+
* It travels by value down the send path and is moved at every step, so it
|
|
22
|
+
* cannot be leaked nor released twice, and any failure path can answer `false`
|
|
23
|
+
* by just invoking it. An empty one means that nobody wants to know, which is
|
|
24
|
+
* the common case, so every send path must tolerate it.
|
|
25
|
+
*/
|
|
26
|
+
using onSendCallback = std::function<void(bool sent)>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Told whether a message (such as SCTP message) was queued for sending, and
|
|
30
|
+
* whether it was the send buffer being full what kept it from being queued.
|
|
31
|
+
*/
|
|
32
|
+
using onMessageQueuedCallback = std::function<void(bool queued, bool isSendBufferFull)>;
|
|
33
|
+
|
|
34
|
+
#endif
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
#define MS_TCP_CONNECTION_HANDLE_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "handles/SendCallbacks.hpp"
|
|
5
6
|
#include <uv.h>
|
|
6
7
|
#include <string>
|
|
7
8
|
|
|
8
9
|
class TcpConnectionHandle
|
|
9
10
|
{
|
|
10
|
-
protected:
|
|
11
|
-
using onSendCallback = const std::function<void(bool sent)>;
|
|
12
|
-
|
|
13
11
|
public:
|
|
14
12
|
class Listener
|
|
15
13
|
{
|
|
@@ -34,12 +32,11 @@ public:
|
|
|
34
32
|
~UvWriteData()
|
|
35
33
|
{
|
|
36
34
|
delete[] this->store;
|
|
37
|
-
delete this->cb;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
uv_write_t req{};
|
|
41
38
|
uint8_t* store{ nullptr };
|
|
42
|
-
|
|
39
|
+
onSendCallback cb;
|
|
43
40
|
};
|
|
44
41
|
|
|
45
42
|
public:
|
|
@@ -65,12 +62,7 @@ public:
|
|
|
65
62
|
return this->uvHandle;
|
|
66
63
|
}
|
|
67
64
|
bool Start() noexcept;
|
|
68
|
-
void Write(
|
|
69
|
-
const uint8_t* data1,
|
|
70
|
-
size_t len1,
|
|
71
|
-
const uint8_t* data2,
|
|
72
|
-
size_t len2,
|
|
73
|
-
TcpConnectionHandle::onSendCallback* cb);
|
|
65
|
+
void Write(const uint8_t* data1, size_t len1, const uint8_t* data2, size_t len2, onSendCallback cb);
|
|
74
66
|
void ErrorReceiving();
|
|
75
67
|
const struct sockaddr* GetLocalAddress() const
|
|
76
68
|
{
|
|
@@ -117,7 +109,7 @@ private:
|
|
|
117
109
|
public:
|
|
118
110
|
void OnUvReadAlloc(size_t suggestedSize, uv_buf_t* buf);
|
|
119
111
|
void OnUvRead(ssize_t nread, const uv_buf_t* buf);
|
|
120
|
-
void OnUvWrite(int status, onSendCallback
|
|
112
|
+
void OnUvWrite(int status, const onSendCallback& cb);
|
|
121
113
|
|
|
122
114
|
/* Pure virtual methods that must be implemented by the subclass. */
|
|
123
115
|
protected:
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
#define MS_UDP_SOCKET_HANDLE_HPP
|
|
3
3
|
|
|
4
4
|
#include "common.hpp"
|
|
5
|
+
#include "handles/SendCallbacks.hpp"
|
|
5
6
|
#include <uv.h>
|
|
6
7
|
#include <string>
|
|
7
8
|
|
|
8
9
|
class UdpSocketHandle
|
|
9
10
|
{
|
|
10
|
-
protected:
|
|
11
|
-
using onSendCallback = const std::function<void(bool sent)>;
|
|
12
|
-
|
|
13
11
|
public:
|
|
14
12
|
/* Struct for the data field of uv_req_t when sending a datagram. */
|
|
15
13
|
struct UvSendData
|
|
@@ -24,12 +22,11 @@ public:
|
|
|
24
22
|
~UvSendData()
|
|
25
23
|
{
|
|
26
24
|
delete[] this->store;
|
|
27
|
-
delete this->cb;
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
uv_udp_send_t req{};
|
|
31
28
|
uint8_t* store{ nullptr };
|
|
32
|
-
|
|
29
|
+
onSendCallback cb;
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
public:
|
|
@@ -47,8 +44,7 @@ public:
|
|
|
47
44
|
return this->closed;
|
|
48
45
|
}
|
|
49
46
|
void Dump(int indentation = 0) const;
|
|
50
|
-
void Send(
|
|
51
|
-
const uint8_t* data, size_t len, const struct sockaddr* addr, UdpSocketHandle::onSendCallback* cb);
|
|
47
|
+
void Send(const uint8_t* data, size_t len, const struct sockaddr* addr, onSendCallback cb);
|
|
52
48
|
const struct sockaddr* GetLocalAddress() const
|
|
53
49
|
{
|
|
54
50
|
return reinterpret_cast<const struct sockaddr*>(std::addressof(this->localAddr));
|
|
@@ -86,7 +82,7 @@ private:
|
|
|
86
82
|
public:
|
|
87
83
|
void OnUvRecvAlloc(size_t suggestedSize, uv_buf_t* buf);
|
|
88
84
|
void OnUvRecv(ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned int flags);
|
|
89
|
-
void OnUvSend(int status,
|
|
85
|
+
void OnUvSend(int status, const onSendCallback& cb);
|
|
90
86
|
|
|
91
87
|
/* Pure virtual methods that must be implemented by the subclass. */
|
|
92
88
|
protected:
|
package/worker/meson.build
CHANGED
|
@@ -23,6 +23,11 @@ if host_machine.system() == 'windows'
|
|
|
23
23
|
'-D_SCL_SECURE_NO_WARNINGS',
|
|
24
24
|
# Introduced in VS 2017 15.8, allow overaligned types in aligned_storage.
|
|
25
25
|
'-D_ENABLE_EXTENDED_ALIGNED_STORAGE',
|
|
26
|
+
# Don't warn about flexible array members (a C99 feature that C++ lacks and
|
|
27
|
+
# every compiler offers as an extension). They are how RTP and RTCP headers
|
|
28
|
+
# give a name to the bytes that follow them, so their length is part of the
|
|
29
|
+
# parsing arithmetic and cannot be declared.
|
|
30
|
+
'/wd4200',
|
|
26
31
|
]
|
|
27
32
|
endif
|
|
28
33
|
|
|
@@ -44,6 +49,12 @@ if get_option('ms_rtc_logger_rtp')
|
|
|
44
49
|
]
|
|
45
50
|
endif
|
|
46
51
|
|
|
52
|
+
if get_option('ms_rtc_logger_send_burst')
|
|
53
|
+
cpp_args += [
|
|
54
|
+
'-DMS_RTC_LOGGER_SEND_BURST',
|
|
55
|
+
]
|
|
56
|
+
endif
|
|
57
|
+
|
|
47
58
|
if get_option('ms_dump_rtp_payload_descriptor')
|
|
48
59
|
cpp_args += [
|
|
49
60
|
'-DMS_DUMP_RTP_PAYLOAD_DESCRIPTOR',
|
|
@@ -132,7 +143,8 @@ common_sources = [
|
|
|
132
143
|
'src/RTC/RemoteCaptureTimeEstimator.cpp',
|
|
133
144
|
'src/RTC/RemoteClockOffsetEstimator.cpp',
|
|
134
145
|
'src/RTC/Router.cpp',
|
|
135
|
-
'src/RTC/RtcLogger.cpp',
|
|
146
|
+
'src/RTC/RtcLogger/RtpPacket.cpp',
|
|
147
|
+
'src/RTC/RtcLogger/SendBurst.cpp',
|
|
136
148
|
'src/RTC/RtpListener.cpp',
|
|
137
149
|
'src/RTC/RtpObserver.cpp',
|
|
138
150
|
'src/RTC/SctpListener.cpp',
|
|
@@ -164,13 +176,29 @@ common_sources = [
|
|
|
164
176
|
'src/RTC/RtpDictionaries/RtpRtxParameters.cpp',
|
|
165
177
|
'src/RTC/SctpDictionaries/SctpStreamParameters.cpp',
|
|
166
178
|
'src/RTC/BWE/AimdRateControl.cpp',
|
|
179
|
+
'src/RTC/BWE/AlrDetector.cpp',
|
|
180
|
+
'src/RTC/BWE/BitrateProber.cpp',
|
|
181
|
+
'src/RTC/BWE/BitrateUtils.cpp',
|
|
167
182
|
'src/RTC/BWE/BweTypes.cpp',
|
|
168
183
|
'src/RTC/BWE/DelayBasedBwe.cpp',
|
|
169
184
|
'src/RTC/BWE/FeedbackAdapter.cpp',
|
|
185
|
+
'src/RTC/BWE/InterArrival.cpp',
|
|
170
186
|
'src/RTC/BWE/InterArrivalDelta.cpp',
|
|
187
|
+
'src/RTC/BWE/IntervalBudget.cpp',
|
|
171
188
|
'src/RTC/BWE/LinkCapacityEstimator.cpp',
|
|
189
|
+
'src/RTC/BWE/LossBasedController.cpp',
|
|
190
|
+
'src/RTC/BWE/OveruseDetector.cpp',
|
|
191
|
+
'src/RTC/BWE/OveruseEstimator.cpp',
|
|
192
|
+
'src/RTC/BWE/ProbeBitrateEstimator.cpp',
|
|
193
|
+
'src/RTC/BWE/ProbeController.cpp',
|
|
194
|
+
'src/RTC/BWE/ProbePacketGenerator.cpp',
|
|
195
|
+
'src/RTC/BWE/ProbingScheduler.cpp',
|
|
196
|
+
'src/RTC/BWE/RembGenerator.cpp',
|
|
197
|
+
'src/RTC/BWE/RemoteBitrateEstimatorAbsSendTime.cpp',
|
|
172
198
|
'src/RTC/BWE/RobustThroughputEstimator.cpp',
|
|
173
199
|
'src/RTC/BWE/SendPacketHistory.cpp',
|
|
200
|
+
'src/RTC/BWE/TargetRateController.cpp',
|
|
201
|
+
'src/RTC/BWE/TransportWideCcFeedbackGenerator.cpp',
|
|
174
202
|
'src/RTC/BWE/TrendlineEstimator.cpp',
|
|
175
203
|
'src/RTC/ICE/IceCandidate.cpp',
|
|
176
204
|
'src/RTC/ICE/IceServer.cpp',
|
|
@@ -470,13 +498,29 @@ test_sources = [
|
|
|
470
498
|
'test/src/RTC/TestTransportTuple.cpp',
|
|
471
499
|
'test/src/RTC/TestTrendCalculator.cpp',
|
|
472
500
|
'test/src/RTC/BWE/helpers/LinkSimulator.cpp',
|
|
501
|
+
'test/src/RTC/BWE/helpers/RemoteBitrateEstimatorAbsSendTimeTestHelper.cpp',
|
|
473
502
|
'test/src/RTC/BWE/TestAimdRateControl.cpp',
|
|
503
|
+
'test/src/RTC/BWE/TestAlrDetector.cpp',
|
|
504
|
+
'test/src/RTC/BWE/TestBitrateProber.cpp',
|
|
505
|
+
'test/src/RTC/BWE/TestBitrateUtils.cpp',
|
|
474
506
|
'test/src/RTC/BWE/TestDelayBasedBwe.cpp',
|
|
475
507
|
'test/src/RTC/BWE/TestFeedbackAdapter.cpp',
|
|
508
|
+
'test/src/RTC/BWE/TestInterArrival.cpp',
|
|
476
509
|
'test/src/RTC/BWE/TestInterArrivalDelta.cpp',
|
|
510
|
+
'test/src/RTC/BWE/TestIntervalBudget.cpp',
|
|
477
511
|
'test/src/RTC/BWE/TestLinkCapacityEstimator.cpp',
|
|
512
|
+
'test/src/RTC/BWE/TestLossBasedController.cpp',
|
|
513
|
+
'test/src/RTC/BWE/TestOveruseDetector.cpp',
|
|
514
|
+
'test/src/RTC/BWE/TestProbeBitrateEstimator.cpp',
|
|
515
|
+
'test/src/RTC/BWE/TestProbeController.cpp',
|
|
516
|
+
'test/src/RTC/BWE/TestProbePacketGenerator.cpp',
|
|
517
|
+
'test/src/RTC/BWE/TestProbingScheduler.cpp',
|
|
518
|
+
'test/src/RTC/BWE/TestRembGenerator.cpp',
|
|
519
|
+
'test/src/RTC/BWE/TestRemoteBitrateEstimatorAbsSendTime.cpp',
|
|
478
520
|
'test/src/RTC/BWE/TestRobustThroughputEstimator.cpp',
|
|
479
521
|
'test/src/RTC/BWE/TestSendPacketHistory.cpp',
|
|
522
|
+
'test/src/RTC/BWE/TestTargetRateController.cpp',
|
|
523
|
+
'test/src/RTC/BWE/TestTransportWideCcFeedbackGenerator.cpp',
|
|
480
524
|
'test/src/RTC/BWE/TestTrendlineEstimator.cpp',
|
|
481
525
|
'test/src/RTC/ICE/iceCommon.cpp',
|
|
482
526
|
'test/src/RTC/ICE/TestStunPacket.cpp',
|
package/worker/meson_options.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
option('ms_log_trace', type: 'boolean', value: false, description: 'Logs the current method/function if current log level is "debug"')
|
|
2
2
|
option('ms_log_file_line', type: 'boolean', value: false, description: 'Logging macros print more verbose information, including current file and line')
|
|
3
3
|
option('ms_rtc_logger_rtp', type: 'boolean', value: false, description: 'Prints a line with information for each processed RTP packet')
|
|
4
|
+
option('ms_rtc_logger_send_burst', type: 'boolean', value: false, description: 'Prints how many RTP packets each transport sends within a single iteration of the event loop')
|
|
4
5
|
option('ms_dump_rtp_payload_descriptor', type: 'boolean', value: false, description: 'RTC::RTP::Packet::Dump() method also dumps payload descriptor details')
|
|
5
6
|
option('ms_dump_rtp_shared_packet_memory_usage', type: 'boolean', value: false, description: 'prints information about total memory allocated by RTC::RTP::SharedPacket instances')
|
|
6
7
|
option('ms_build_tests', type: 'boolean', value: false, description: 'Must be enabled when building mediasoup worker tests')
|
|
@@ -46,8 +46,22 @@ namespace mocks
|
|
|
46
46
|
return this->getTimeUs();
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* @remarks
|
|
51
|
+
* - There is no event loop here, and the clock given by argument only moves when the
|
|
52
|
+
* test moves it, which is the very semantics of a time that stays put for the whole
|
|
53
|
+
* iteration.
|
|
54
|
+
*/
|
|
55
|
+
uint64_t GetLoopTimeMs() override
|
|
56
|
+
{
|
|
57
|
+
return static_cast<uint64_t>(GetTimeMs());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @remarks
|
|
62
|
+
* - The NTP epoch is made to be the very clock given by argument, so that tests can
|
|
63
|
+
* reason about a single set of values.
|
|
64
|
+
*/
|
|
51
65
|
int64_t GetNtpOffsetUs() override
|
|
52
66
|
{
|
|
53
67
|
return 0;
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"node_modules/brace-expansion": {
|
|
24
|
-
"version": "5.0.
|
|
25
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.
|
|
26
|
-
"integrity": "sha512-
|
|
24
|
+
"version": "5.0.12",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",
|
|
26
|
+
"integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"balanced-match": "^4.0.2"
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="
|
|
106
106
|
},
|
|
107
107
|
"brace-expansion": {
|
|
108
|
-
"version": "5.0.
|
|
109
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.
|
|
110
|
-
"integrity": "sha512-
|
|
108
|
+
"version": "5.0.12",
|
|
109
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",
|
|
110
|
+
"integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",
|
|
111
111
|
"requires": {
|
|
112
112
|
"balanced-match": "^4.0.2"
|
|
113
113
|
}
|