OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 bwe.SetMinMaxBitrate(100000, 1500000); | 21 bwe.SetMinMaxBitrate(100000, 1500000); |
22 bwe.SetSendBitrate(200000); | 22 bwe.SetSendBitrate(200000); |
23 | 23 |
24 const int kRembBps = 1000000; | 24 const int kRembBps = 1000000; |
25 const int kSecondRembBps = kRembBps + 500000; | 25 const int kSecondRembBps = kRembBps + 500000; |
26 int64_t now_ms = 0; | 26 int64_t now_ms = 0; |
27 | 27 |
28 bwe.UpdateReceiverBlock(0, 50, 1, now_ms); | 28 bwe.UpdateReceiverBlock(0, 50, 1, now_ms); |
29 | 29 |
30 // Initial REMB applies immediately. | 30 // Initial REMB applies immediately. |
31 bwe.UpdateReceiverEstimate(kRembBps); | 31 bwe.UpdateReceiverEstimate(now_ms, kRembBps); |
32 bwe.UpdateEstimate(now_ms); | 32 bwe.UpdateEstimate(now_ms); |
33 int bitrate; | 33 int bitrate; |
34 uint8_t fraction_loss; | 34 uint8_t fraction_loss; |
35 int64_t rtt; | 35 int64_t rtt; |
36 bwe.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 36 bwe.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
37 EXPECT_EQ(kRembBps, bitrate); | 37 EXPECT_EQ(kRembBps, bitrate); |
38 | 38 |
39 // Second REMB doesn't apply immediately. | 39 // Second REMB doesn't apply immediately. |
40 now_ms += 2001; | 40 now_ms += 2001; |
41 bwe.UpdateReceiverEstimate(kSecondRembBps); | 41 bwe.UpdateReceiverEstimate(now_ms, kSecondRembBps); |
42 bwe.UpdateEstimate(now_ms); | 42 bwe.UpdateEstimate(now_ms); |
43 bitrate = 0; | 43 bitrate = 0; |
44 bwe.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 44 bwe.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
45 EXPECT_EQ(kRembBps, bitrate); | 45 EXPECT_EQ(kRembBps, bitrate); |
46 } | 46 } |
47 } // namespace webrtc | 47 } // namespace webrtc |
OLD | NEW |