blob: 036c1f7497a72c7672ba795ffd688a81f42a8025 [file] [log] [blame]
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +00001/*
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +00003 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11
12// This file includes unit tests for ViERemb.
13
14#include <gmock/gmock.h>
15#include <gtest/gtest.h>
16
mflodman@webrtc.orgf89fb9d2012-11-22 09:41:42 +000017#include <vector>
18
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +000019#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
20#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
21#include "webrtc/modules/utility/interface/process_thread.h"
22#include "webrtc/system_wrappers/interface/scoped_ptr.h"
23#include "webrtc/system_wrappers/interface/tick_util.h"
24#include "webrtc/video_engine/vie_remb.h"
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000025
26using ::testing::_;
27using ::testing::AnyNumber;
28using ::testing::Return;
29
30namespace webrtc {
31
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +000032class TestProcessThread : public ProcessThread {
33 public:
34 explicit TestProcessThread() {}
35 ~TestProcessThread() {}
pbos@webrtc.orgb238d122013-04-09 13:41:51 +000036 virtual int32_t Start() { return 0; }
37 virtual int32_t Stop() { return 0; }
38 virtual int32_t RegisterModule(const Module* module) { return 0; }
39 virtual int32_t DeRegisterModule(const Module* module) { return 0; }
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +000040};
41
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000042class ViERembTest : public ::testing::Test {
43 protected:
44 virtual void SetUp() {
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +000045 TickTime::UseFakeClock(12345);
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +000046 process_thread_.reset(new TestProcessThread);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +000047 vie_remb_.reset(new VieRemb());
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000048 }
mflodman@webrtc.org9ec883e2012-03-05 17:12:41 +000049 scoped_ptr<TestProcessThread> process_thread_;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000050 scoped_ptr<VieRemb> vie_remb_;
51};
52
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +000053TEST_F(ViERembTest, OneModuleTestForSendingRemb) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000054 MockRtpRtcp rtp;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000055 vie_remb_->AddReceiveChannel(&rtp);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +000056 vie_remb_->AddRembSender(&rtp);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000057
58 const unsigned int bitrate_estimate = 456;
stefan@webrtc.org3aece422012-10-18 11:12:39 +000059 unsigned int ssrc = 1234;
stefan@webrtc.org4100b042012-11-19 10:09:20 +000060 std::vector<unsigned int> ssrcs(&ssrc, &ssrc + 1);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000061
stefan@webrtc.org4100b042012-11-19 10:09:20 +000062 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000063
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +000064 TickTime::AdvanceFakeClock(1000);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000065 EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, 1, _))
66 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +000067 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000068
69 // Lower bitrate to send another REMB packet.
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000070 EXPECT_CALL(rtp, SetREMBData(bitrate_estimate - 100, 1, _))
71 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +000072 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate - 100);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000073
74 vie_remb_->RemoveReceiveChannel(&rtp);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +000075 vie_remb_->RemoveRembSender(&rtp);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000076}
77
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +000078TEST_F(ViERembTest, LowerEstimateToSendRemb) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000079 MockRtpRtcp rtp;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000080 vie_remb_->AddReceiveChannel(&rtp);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +000081 vie_remb_->AddRembSender(&rtp);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000082
83 unsigned int bitrate_estimate = 456;
stefan@webrtc.org3aece422012-10-18 11:12:39 +000084 unsigned int ssrc = 1234;
stefan@webrtc.org4100b042012-11-19 10:09:20 +000085 std::vector<unsigned int> ssrcs(&ssrc, &ssrc + 1);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000086
stefan@webrtc.org4100b042012-11-19 10:09:20 +000087 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +000088 // Call OnReceiveBitrateChanged twice to get a first estimate.
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +000089 TickTime::AdvanceFakeClock(1000);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +000090 EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, 1, _))
91 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +000092 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +000093
94 // Lower the estimate with more than 3% to trigger a call to SetREMBData right
95 // away.
96 bitrate_estimate = bitrate_estimate - 100;
97 EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, 1, _))
98 .Times(1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +000099 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000100}
101
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000102TEST_F(ViERembTest, VerifyIncreasingAndDecreasing) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000103 MockRtpRtcp rtp_0;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000104 MockRtpRtcp rtp_1;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000105 vie_remb_->AddReceiveChannel(&rtp_0);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000106 vie_remb_->AddRembSender(&rtp_0);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000107 vie_remb_->AddReceiveChannel(&rtp_1);
108
109 unsigned int bitrate_estimate[] = { 456, 789 };
110 unsigned int ssrc[] = { 1234, 5678 };
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000111 std::vector<unsigned int> ssrcs(ssrc, ssrc + sizeof(ssrc) / sizeof(ssrc[0]));
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000112
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000113 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate[0]);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000114
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000115 // Call OnReceiveBitrateChanged twice to get a first estimate.
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000116 EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate[0], 2, _))
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000117 .Times(1);
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +0000118 TickTime::AdvanceFakeClock(1000);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000119 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate[0]);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000120
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000121 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate[1] + 100);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000122
123 // Lower the estimate to trigger a callback.
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000124 EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate[1], 2, _))
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000125 .Times(1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000126 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate[1]);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000127
128 vie_remb_->RemoveReceiveChannel(&rtp_0);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000129 vie_remb_->RemoveRembSender(&rtp_0);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000130 vie_remb_->RemoveReceiveChannel(&rtp_1);
131}
132
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +0000133TEST_F(ViERembTest, NoRembForIncreasedBitrate) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000134 MockRtpRtcp rtp_0;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000135 MockRtpRtcp rtp_1;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000136 vie_remb_->AddReceiveChannel(&rtp_0);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000137 vie_remb_->AddRembSender(&rtp_0);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000138 vie_remb_->AddReceiveChannel(&rtp_1);
139
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000140 unsigned int bitrate_estimate = 456;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000141 unsigned int ssrc[] = { 1234, 5678 };
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000142 std::vector<unsigned int> ssrcs(ssrc, ssrc + sizeof(ssrc) / sizeof(ssrc[0]));
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000143
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000144 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000145 // Call OnReceiveBitrateChanged twice to get a first estimate.
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +0000146 TickTime::AdvanceFakeClock(1000);
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000147 EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate, 2, _))
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000148 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000149 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000150
151 // Increased estimate shouldn't trigger a callback right away.
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000152 EXPECT_CALL(rtp_0, SetREMBData(_, _, _))
153 .Times(0);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000154 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate + 1);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000155
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000156 // Decreasing the estimate less than 3% shouldn't trigger a new callback.
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +0000157 EXPECT_CALL(rtp_0, SetREMBData(_, _, _))
158 .Times(0);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000159 int lower_estimate = bitrate_estimate * 98 / 100;
160 vie_remb_->OnReceiveBitrateChanged(&ssrcs, lower_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000161
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000162 vie_remb_->RemoveReceiveChannel(&rtp_1);
163 vie_remb_->RemoveReceiveChannel(&rtp_0);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000164 vie_remb_->RemoveRembSender(&rtp_0);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000165}
166
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +0000167TEST_F(ViERembTest, ChangeSendRtpModule) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000168 MockRtpRtcp rtp_0;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000169 MockRtpRtcp rtp_1;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000170 vie_remb_->AddReceiveChannel(&rtp_0);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000171 vie_remb_->AddRembSender(&rtp_0);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000172 vie_remb_->AddReceiveChannel(&rtp_1);
173
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000174 unsigned int bitrate_estimate = 456;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000175 unsigned int ssrc[] = { 1234, 5678 };
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000176 std::vector<unsigned int> ssrcs(ssrc, ssrc + sizeof(ssrc) / sizeof(ssrc[0]));
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000177
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000178 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000179 // Call OnReceiveBitrateChanged twice to get a first estimate.
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +0000180 TickTime::AdvanceFakeClock(1000);
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000181 EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate, 2, _))
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000182 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000183 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000184
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000185 // Decrease estimate to trigger a REMB.
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000186 bitrate_estimate = bitrate_estimate - 100;
187 EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate, 2, _))
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000188 .Times(1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000189 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000190
191 // Remove the sending module, add it again -> should get remb on the second
192 // module.
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000193 vie_remb_->RemoveRembSender(&rtp_0);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000194 vie_remb_->AddRembSender(&rtp_1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000195 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000196
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000197 bitrate_estimate = bitrate_estimate - 100;
198 EXPECT_CALL(rtp_1, SetREMBData(bitrate_estimate, 2, _))
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000199 .Times(1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000200 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000201
202 vie_remb_->RemoveReceiveChannel(&rtp_0);
203 vie_remb_->RemoveReceiveChannel(&rtp_1);
204}
205
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +0000206TEST_F(ViERembTest, OnlyOneRembForDoubleProcess) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000207 MockRtpRtcp rtp;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000208 unsigned int bitrate_estimate = 456;
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000209 unsigned int ssrc = 1234;
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000210 std::vector<unsigned int> ssrcs(&ssrc, &ssrc + 1);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000211
212 vie_remb_->AddReceiveChannel(&rtp);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000213 vie_remb_->AddRembSender(&rtp);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000214 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000215 // Call OnReceiveBitrateChanged twice to get a first estimate.
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +0000216 TickTime::AdvanceFakeClock(1000);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000217 EXPECT_CALL(rtp, SetREMBData(_, _, _))
218 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000219 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000220
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000221 // Lower the estimate, should trigger a call to SetREMBData right away.
222 bitrate_estimate = bitrate_estimate - 100;
223 EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, 1, _))
224 .Times(1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000225 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000226
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000227 // Call OnReceiveBitrateChanged again, this should not trigger a new callback.
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000228 EXPECT_CALL(rtp, SetREMBData(_, _, _))
229 .Times(0);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000230 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000231 vie_remb_->RemoveReceiveChannel(&rtp);
mflodman@webrtc.orgf7b60782012-02-16 14:50:24 +0000232 vie_remb_->RemoveRembSender(&rtp);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000233}
234
mflodman@webrtc.org5284d6e2012-04-23 13:22:26 +0000235// Only register receiving modules and make sure we fallback to trigger a REMB
236// packet on this one.
mflodman@webrtc.orgab2610f2012-06-29 10:05:28 +0000237TEST_F(ViERembTest, NoSendingRtpModule) {
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000238 MockRtpRtcp rtp;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000239 vie_remb_->AddReceiveChannel(&rtp);
240
241 unsigned int bitrate_estimate = 456;
stefan@webrtc.org3aece422012-10-18 11:12:39 +0000242 unsigned int ssrc = 1234;
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000243 std::vector<unsigned int> ssrcs(&ssrc, &ssrc + 1);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000244
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000245 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000246
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000247 // Call OnReceiveBitrateChanged twice to get a first estimate.
mflodman@webrtc.orgc289f9f2012-11-16 13:24:18 +0000248 TickTime::AdvanceFakeClock(1000);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000249 EXPECT_CALL(rtp, SetREMBData(_, _, _))
250 .Times(1);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000251 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org1fb39ba2012-08-13 17:05:14 +0000252
mflodman@webrtc.org5284d6e2012-04-23 13:22:26 +0000253 // Lower the estimate to trigger a new packet REMB packet.
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000254 bitrate_estimate = bitrate_estimate - 100;
255 EXPECT_CALL(rtp, SetREMBData(_, _, _))
mflodman@webrtc.org5284d6e2012-04-23 13:22:26 +0000256 .Times(1);
stefan@webrtc.org4100b042012-11-19 10:09:20 +0000257 vie_remb_->OnReceiveBitrateChanged(&ssrcs, bitrate_estimate);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000258}
259
260} // namespace webrtc