Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: webrtc/video/payload_router_unittest.cc

Issue 2947633003: Allow parsing empty RTCP TargetBitrate messages, but stop sending them. (Closed)
Patch Set: Shotgun fix: missing initializer for unrelated member Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 BitrateAllocation layer1_bitrate; 171 BitrateAllocation layer1_bitrate;
172 layer1_bitrate.SetBitrate(0, 0, 40000); 172 layer1_bitrate.SetBitrate(0, 0, 40000);
173 layer1_bitrate.SetBitrate(0, 1, 80000); 173 layer1_bitrate.SetBitrate(0, 1, 80000);
174 174
175 EXPECT_CALL(rtp_1, SetVideoBitrateAllocation(layer0_bitrate)).Times(1); 175 EXPECT_CALL(rtp_1, SetVideoBitrateAllocation(layer0_bitrate)).Times(1);
176 EXPECT_CALL(rtp_2, SetVideoBitrateAllocation(layer1_bitrate)).Times(1); 176 EXPECT_CALL(rtp_2, SetVideoBitrateAllocation(layer1_bitrate)).Times(1);
177 177
178 payload_router.OnBitrateAllocationUpdated(bitrate); 178 payload_router.OnBitrateAllocationUpdated(bitrate);
179 } 179 }
180 180
181 TEST(PayloadRouterTest, SimulcastTargetBitrateWithInactiveStream) {
182 NiceMock<MockRtpRtcp> rtp_1;
183 NiceMock<MockRtpRtcp> rtp_2;
184 std::vector<RtpRtcp*> modules;
185 modules.push_back(&rtp_1);
186 modules.push_back(&rtp_2);
187 PayloadRouter payload_router(modules, 42);
188 payload_router.SetActive(true);
189
190 BitrateAllocation bitrate;
191 bitrate.SetBitrate(0, 0, 10000);
192 bitrate.SetBitrate(0, 1, 20000);
193
194 BitrateAllocation layer0_bitrate;
195 layer0_bitrate.SetBitrate(0, 0, 10000);
196 layer0_bitrate.SetBitrate(0, 1, 20000);
197
198 EXPECT_CALL(rtp_1, SetVideoBitrateAllocation(layer0_bitrate)).Times(1);
199 EXPECT_CALL(rtp_2, SetVideoBitrateAllocation(_)).Times(0);
200
201 payload_router.OnBitrateAllocationUpdated(bitrate);
202 }
203
181 TEST(PayloadRouterTest, SvcTargetBitrate) { 204 TEST(PayloadRouterTest, SvcTargetBitrate) {
182 NiceMock<MockRtpRtcp> rtp_1; 205 NiceMock<MockRtpRtcp> rtp_1;
183 std::vector<RtpRtcp*> modules; 206 std::vector<RtpRtcp*> modules;
184 modules.push_back(&rtp_1); 207 modules.push_back(&rtp_1);
185 PayloadRouter payload_router(modules, 42); 208 PayloadRouter payload_router(modules, 42);
186 payload_router.SetActive(true); 209 payload_router.SetActive(true);
187 210
188 BitrateAllocation bitrate; 211 BitrateAllocation bitrate;
189 bitrate.SetBitrate(0, 0, 10000); 212 bitrate.SetBitrate(0, 0, 10000);
190 bitrate.SetBitrate(0, 1, 20000); 213 bitrate.SetBitrate(0, 1, 20000);
191 bitrate.SetBitrate(1, 0, 40000); 214 bitrate.SetBitrate(1, 0, 40000);
192 bitrate.SetBitrate(1, 1, 80000); 215 bitrate.SetBitrate(1, 1, 80000);
193 216
194 EXPECT_CALL(rtp_1, SetVideoBitrateAllocation(bitrate)).Times(1); 217 EXPECT_CALL(rtp_1, SetVideoBitrateAllocation(bitrate)).Times(1);
195 218
196 payload_router.OnBitrateAllocationUpdated(bitrate); 219 payload_router.OnBitrateAllocationUpdated(bitrate);
197 } 220 }
198 221
199 } // namespace webrtc 222 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698