| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 EXPECT_EQ(0, sender_->IntraFrameRequest(2)); | 284 EXPECT_EQ(0, sender_->IntraFrameRequest(2)); |
| 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 | |
| 294 EXPECT_EQ(-1, sender_->IntraFrameRequest(-1)); | |
| 295 ExpectIntraRequest(-1); | |
| 296 AddFrame(); | |
| 297 } | 293 } |
| 298 | 294 |
| 299 TEST_F(TestVideoSenderWithMockEncoder, TestIntraRequestsInternalCapture) { | 295 TEST_F(TestVideoSenderWithMockEncoder, TestIntraRequestsInternalCapture) { |
| 300 // De-register current external encoder. | 296 // De-register current external encoder. |
| 301 sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false); | 297 sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false); |
| 302 // Register encoder with internal capture. | 298 // Register encoder with internal capture. |
| 303 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, true); | 299 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, true); |
| 304 EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); | 300 EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); |
| 305 // Initial request should be all keyframes. | 301 // Initial request should be all keyframes. |
| 306 ExpectInitialKeyFrames(); | 302 ExpectInitialKeyFrames(); |
| 307 AddFrame(); | 303 AddFrame(); |
| 308 ExpectIntraRequest(0); | 304 ExpectIntraRequest(0); |
| 309 EXPECT_EQ(0, sender_->IntraFrameRequest(0)); | 305 EXPECT_EQ(0, sender_->IntraFrameRequest(0)); |
| 310 ExpectIntraRequest(1); | 306 ExpectIntraRequest(1); |
| 311 EXPECT_EQ(0, sender_->IntraFrameRequest(1)); | 307 EXPECT_EQ(0, sender_->IntraFrameRequest(1)); |
| 312 ExpectIntraRequest(2); | 308 ExpectIntraRequest(2); |
| 313 EXPECT_EQ(0, sender_->IntraFrameRequest(2)); | 309 EXPECT_EQ(0, sender_->IntraFrameRequest(2)); |
| 314 // No requests expected since these indices are out of bounds. | 310 // No requests expected since these indices are out of bounds. |
| 315 EXPECT_EQ(-1, sender_->IntraFrameRequest(3)); | 311 EXPECT_EQ(-1, sender_->IntraFrameRequest(3)); |
| 316 EXPECT_EQ(-1, sender_->IntraFrameRequest(-1)); | |
| 317 } | 312 } |
| 318 | 313 |
| 319 TEST_F(TestVideoSenderWithMockEncoder, TestEncoderParametersForInternalSource) { | 314 TEST_F(TestVideoSenderWithMockEncoder, TestEncoderParametersForInternalSource) { |
| 320 // De-register current external encoder. | 315 // De-register current external encoder. |
| 321 sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false); | 316 sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false); |
| 322 // Register encoder with internal capture. | 317 // Register encoder with internal capture. |
| 323 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, true); | 318 sender_->RegisterExternalEncoder(&encoder_, kUnusedPayloadType, true); |
| 324 EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); | 319 EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); |
| 325 // Update encoder bitrate parameters. We expect that to immediately call | 320 // Update encoder bitrate parameters. We expect that to immediately call |
| 326 // SetRates on the encoder without waiting for AddFrame processing. | 321 // SetRates on the encoder without waiting for AddFrame processing. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } | 495 } |
| 501 { | 496 { |
| 502 // TODO(andresp): Find out why this fails with framerate = 7.5 | 497 // TODO(andresp): Find out why this fails with framerate = 7.5 |
| 503 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; | 498 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; |
| 504 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); | 499 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); |
| 505 } | 500 } |
| 506 } | 501 } |
| 507 } // namespace | 502 } // namespace |
| 508 } // namespace vcm | 503 } // namespace vcm |
| 509 } // namespace webrtc | 504 } // namespace webrtc |
| OLD | NEW |