OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 test_frame_.height()); | 480 test_frame_.height()); |
481 std::unique_ptr<uint8_t[]> test_buffer(new uint8_t[length]); | 481 std::unique_ptr<uint8_t[]> test_buffer(new uint8_t[length]); |
482 webrtc::ExtractBuffer(test_frame_, length, test_buffer.get()); | 482 webrtc::ExtractBuffer(test_frame_, length, test_buffer.get()); |
483 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 483 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
484 length, capture_callback_.capability(), 0)); | 484 length, capture_callback_.capability(), 0)); |
485 EXPECT_TRUE(capture_callback_.CompareLastFrame(test_frame_)); | 485 EXPECT_TRUE(capture_callback_.CompareLastFrame(test_frame_)); |
486 } | 486 } |
487 | 487 |
488 // Test frame rate and no picture alarm. | 488 // Test frame rate and no picture alarm. |
489 // Flaky on Win32, see webrtc:3270. | 489 // Flaky on Win32, see webrtc:3270. |
490 #if defined(WEBRTC_WIN) | 490 #if defined(WEBRTC_WIN) || defined(WEBRTC_MAC) |
491 #define MAYBE_FrameRate DISABLED_FrameRate | 491 #define MAYBE_FrameRate DISABLED_FrameRate |
492 #else | 492 #else |
493 #define MAYBE_FrameRate FrameRate | 493 #define MAYBE_FrameRate FrameRate |
494 #endif | 494 #endif |
495 TEST_F(VideoCaptureExternalTest, MAYBE_FrameRate) { | 495 TEST_F(VideoCaptureExternalTest, MAYBE_FrameRate) { |
496 int64_t testTime = 3; | 496 int64_t testTime = 3; |
497 TickTime startTime = TickTime::Now(); | 497 TickTime startTime = TickTime::Now(); |
498 | 498 |
499 while ((TickTime::Now() - startTime).Milliseconds() < testTime * 1000) { | 499 while ((TickTime::Now() - startTime).Milliseconds() < testTime * 1000) { |
500 size_t length = webrtc::CalcBufferSize(webrtc::kI420, | 500 size_t length = webrtc::CalcBufferSize(webrtc::kI420, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 length, capture_callback_.capability(), 0)); | 544 length, capture_callback_.capability(), 0)); |
545 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); | 545 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); |
546 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); | 546 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); |
547 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 547 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
548 length, capture_callback_.capability(), 0)); | 548 length, capture_callback_.capability(), 0)); |
549 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); | 549 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); |
550 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); | 550 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); |
551 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 551 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
552 length, capture_callback_.capability(), 0)); | 552 length, capture_callback_.capability(), 0)); |
553 } | 553 } |
OLD | NEW |