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
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#include "common.hpp"
|
|
2
|
+
#include "RTC/BWE/IntervalBudget.hpp"
|
|
3
|
+
#include <catch2/catch_test_macros.hpp>
|
|
4
|
+
|
|
5
|
+
SCENARIO("BWE IntervalBudget", "[bwe][intervalbudget]")
|
|
6
|
+
{
|
|
7
|
+
// Span of time the budget is measured over.
|
|
8
|
+
constexpr int64_t WindowUs{ 500 * 1000 };
|
|
9
|
+
constexpr int64_t TargetBitrate{ 100000 };
|
|
10
|
+
|
|
11
|
+
// Bytes the given bitrate delivers over the given span of time.
|
|
12
|
+
const auto bitrateToBytes = [](int64_t bitrate, int64_t durationUs) -> int64_t
|
|
13
|
+
{
|
|
14
|
+
return (bitrate * durationUs) / (8 * 1000000);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
SECTION("a new budget holds nothing")
|
|
18
|
+
{
|
|
19
|
+
const RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
20
|
+
|
|
21
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.0);
|
|
22
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
SECTION("time passing without spending fills the budget in proportion")
|
|
26
|
+
{
|
|
27
|
+
constexpr int64_t DeltaTimeUs{ 50 * 1000 };
|
|
28
|
+
|
|
29
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
30
|
+
|
|
31
|
+
intervalBudget.IncreaseBudget(DeltaTimeUs);
|
|
32
|
+
|
|
33
|
+
// A tenth of the window went by, so a tenth of it is what the budget holds.
|
|
34
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.1);
|
|
35
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, DeltaTimeUs));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
SECTION("the budget doesn't grow past the window")
|
|
39
|
+
{
|
|
40
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
41
|
+
|
|
42
|
+
intervalBudget.IncreaseBudget(/*deltaTimeUs*/ 1000 * 1000);
|
|
43
|
+
|
|
44
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 1.0);
|
|
45
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, WindowUs));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
SECTION("lowering the bitrate brings the budget down to the new window")
|
|
49
|
+
{
|
|
50
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
51
|
+
|
|
52
|
+
intervalBudget.IncreaseBudget(/*deltaTimeUs*/ WindowUs / 2);
|
|
53
|
+
intervalBudget.SetTargetBitrate(TargetBitrate / 10);
|
|
54
|
+
|
|
55
|
+
// Half of the old window is more than the whole of the new one.
|
|
56
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 1.0);
|
|
57
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate / 10, WindowUs));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
SECTION("raising the bitrate leaves the budget where it was")
|
|
61
|
+
{
|
|
62
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
63
|
+
|
|
64
|
+
intervalBudget.IncreaseBudget(/*deltaTimeUs*/ WindowUs);
|
|
65
|
+
intervalBudget.SetTargetBitrate(TargetBitrate * 2);
|
|
66
|
+
|
|
67
|
+
// The bytes held are the same ones, but now they're half of the window.
|
|
68
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.5);
|
|
69
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, WindowUs));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
SECTION("spending more than there is takes the budget into debt")
|
|
73
|
+
{
|
|
74
|
+
constexpr int64_t OveruseTimeUs{ 50 * 1000 };
|
|
75
|
+
|
|
76
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
77
|
+
|
|
78
|
+
intervalBudget.UseBudget(bitrateToBytes(TargetBitrate, OveruseTimeUs));
|
|
79
|
+
|
|
80
|
+
// A tenth of the window was spent without any of it having been refilled.
|
|
81
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == -0.1);
|
|
82
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == 0);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
SECTION("the debt doesn't grow past the window either")
|
|
86
|
+
{
|
|
87
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate);
|
|
88
|
+
|
|
89
|
+
intervalBudget.UseBudget(bitrateToBytes(TargetBitrate, /*durationUs*/ 1000 * 1000));
|
|
90
|
+
|
|
91
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == -1.0);
|
|
92
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == 0);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
SECTION("what an interval leaves unspent adds up when told to")
|
|
96
|
+
{
|
|
97
|
+
constexpr int64_t DeltaTimeUs{ 50 * 1000 };
|
|
98
|
+
|
|
99
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate, /*canBuildUpUnderuse*/ true);
|
|
100
|
+
|
|
101
|
+
intervalBudget.IncreaseBudget(DeltaTimeUs);
|
|
102
|
+
|
|
103
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.1);
|
|
104
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, DeltaTimeUs));
|
|
105
|
+
|
|
106
|
+
intervalBudget.IncreaseBudget(DeltaTimeUs);
|
|
107
|
+
|
|
108
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.2);
|
|
109
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, 2 * DeltaTimeUs));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
SECTION("and doesn't when told not to")
|
|
113
|
+
{
|
|
114
|
+
constexpr int64_t DeltaTimeUs{ 50 * 1000 };
|
|
115
|
+
|
|
116
|
+
RTC::BWE::IntervalBudget intervalBudget(TargetBitrate, /*canBuildUpUnderuse*/ false);
|
|
117
|
+
|
|
118
|
+
intervalBudget.IncreaseBudget(DeltaTimeUs);
|
|
119
|
+
|
|
120
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.1);
|
|
121
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, DeltaTimeUs));
|
|
122
|
+
|
|
123
|
+
intervalBudget.IncreaseBudget(DeltaTimeUs);
|
|
124
|
+
|
|
125
|
+
// The second span refills just as much as the first one did, instead of
|
|
126
|
+
// adding to what was already there.
|
|
127
|
+
REQUIRE(intervalBudget.GetBudgetRatio() == 0.1);
|
|
128
|
+
REQUIRE(intervalBudget.GetBytesRemaining() == bitrateToBytes(TargetBitrate, DeltaTimeUs));
|
|
129
|
+
}
|
|
130
|
+
}
|