| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 ExpectIntraRequest(2); | 285 ExpectIntraRequest(2); |
| 286 AddFrame(); | 286 AddFrame(); |
| 287 ExpectIntraRequest(-1); | 287 ExpectIntraRequest(-1); |
| 288 AddFrame(); | 288 AddFrame(); |
| 289 | 289 |
| 290 EXPECT_EQ(-1, sender_->IntraFrameRequest(3)); | 290 EXPECT_EQ(-1, sender_->IntraFrameRequest(3)); |
| 291 ExpectIntraRequest(-1); | 291 ExpectIntraRequest(-1); |
| 292 AddFrame(); | 292 AddFrame(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 TEST_F(TestVideoSenderWithMockEncoder, TestSetRate) { |
| 296 const uint32_t new_bitrate = settings_.startBitrate + 300; |
| 297 EXPECT_CALL(encoder_, SetRates(new_bitrate, _)).Times(1).WillOnce(Return(0)); |
| 298 sender_->SetChannelParameters(new_bitrate * 1000, 0, 200); |
| 299 AddFrame(); |
| 300 |
| 301 // Expect no call to encoder_.SetRates if the new bitrate is zero. |
| 302 EXPECT_CALL(encoder_, SetRates(new_bitrate, _)).Times(0); |
| 303 sender_->SetChannelParameters(0, 0, 200); |
| 304 AddFrame(); |
| 305 } |
| 306 |
| 295 TEST_F(TestVideoSenderWithMockEncoder, TestIntraRequestsInternalCapture) { | 307 TEST_F(TestVideoSenderWithMockEncoder, TestIntraRequestsInternalCapture) { |
| 296 // De-register current external encoder. | 308 // De-register current external encoder. |
| 297 sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false); | 309 sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false); |
| 298 // Register encoder with internal capture. | 310 // Register encoder with internal capture. |
| 299 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, true); | 311 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, true); |
| 300 EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); | 312 EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); |
| 301 // Initial request should be all keyframes. | 313 // Initial request should be all keyframes. |
| 302 ExpectInitialKeyFrames(); | 314 ExpectInitialKeyFrames(); |
| 303 AddFrame(); | 315 AddFrame(); |
| 304 ExpectIntraRequest(0); | 316 ExpectIntraRequest(0); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 507 } |
| 496 { | 508 { |
| 497 // TODO(andresp): Find out why this fails with framerate = 7.5 | 509 // TODO(andresp): Find out why this fails with framerate = 7.5 |
| 498 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; | 510 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; |
| 499 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); | 511 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); |
| 500 } | 512 } |
| 501 } | 513 } |
| 502 } // namespace | 514 } // namespace |
| 503 } // namespace vcm | 515 } // namespace vcm |
| 504 } // namespace webrtc | 516 } // namespace webrtc |
| OLD | NEW |