OLD | NEW |
---|---|
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 Loading... | |
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; | |
danilchap
2017/06/20 10:29:27
is it same as bitrate? why do you need two variabl
sprang_webrtc
2017/06/20 15:24:34
I don't, I was just lazy (copy/paste from other te
| |
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); | |
danilchap
2017/06/20 10:29:26
can you explain (with test name or comments, bette
sprang_webrtc
2017/06/20 15:24:34
Done.
| |
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 |
OLD | NEW |