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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // The modules return a value lower than default. | 179 // The modules return a value lower than default. |
180 const size_t kTestMinPayloadLength = 1001; | 180 const size_t kTestMinPayloadLength = 1001; |
181 EXPECT_CALL(rtp_1, MaxDataPayloadLength()) | 181 EXPECT_CALL(rtp_1, MaxDataPayloadLength()) |
182 .Times(1) | 182 .Times(1) |
183 .WillOnce(Return(kTestMinPayloadLength + 10)); | 183 .WillOnce(Return(kTestMinPayloadLength + 10)); |
184 EXPECT_CALL(rtp_2, MaxDataPayloadLength()) | 184 EXPECT_CALL(rtp_2, MaxDataPayloadLength()) |
185 .Times(1) | 185 .Times(1) |
186 .WillOnce(Return(kTestMinPayloadLength)); | 186 .WillOnce(Return(kTestMinPayloadLength)); |
187 EXPECT_EQ(kTestMinPayloadLength, payload_router.MaxPayloadLength()); | 187 EXPECT_EQ(kTestMinPayloadLength, payload_router.MaxPayloadLength()); |
188 } | 188 } |
| 189 |
| 190 TEST(PayloadRouterTest, SetTargetSendBitrates) { |
| 191 NiceMock<MockRtpRtcp> rtp_1; |
| 192 NiceMock<MockRtpRtcp> rtp_2; |
| 193 std::vector<RtpRtcp*> modules; |
| 194 modules.push_back(&rtp_1); |
| 195 modules.push_back(&rtp_2); |
| 196 PayloadRouter payload_router(modules, 42); |
| 197 std::vector<VideoStream> streams(2); |
| 198 streams[0].max_bitrate_bps = 10000; |
| 199 streams[1].max_bitrate_bps = 100000; |
| 200 payload_router.SetSendStreams(streams); |
| 201 |
| 202 const uint32_t bitrate_1 = 10000; |
| 203 const uint32_t bitrate_2 = 76543; |
| 204 EXPECT_CALL(rtp_1, SetTargetSendBitrate(bitrate_1)) |
| 205 .Times(1); |
| 206 EXPECT_CALL(rtp_2, SetTargetSendBitrate(bitrate_2)) |
| 207 .Times(1); |
| 208 payload_router.SetTargetSendBitrate(bitrate_1 + bitrate_2); |
| 209 } |
189 } // namespace webrtc | 210 } // namespace webrtc |
OLD | NEW |