| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const webrtc::VideoFrame& videoFrame) { | 105 const webrtc::VideoFrame& videoFrame) { |
| 106 CriticalSectionScoped cs(capture_cs_.get()); | 106 CriticalSectionScoped cs(capture_cs_.get()); |
| 107 int height = videoFrame.height(); | 107 int height = videoFrame.height(); |
| 108 int width = videoFrame.width(); | 108 int width = videoFrame.width(); |
| 109 #if ANDROID | 109 #if ANDROID |
| 110 // Android camera frames may be rotated depending on test device | 110 // Android camera frames may be rotated depending on test device |
| 111 // orientation. | 111 // orientation. |
| 112 EXPECT_TRUE(height == capability_.height || height == capability_.width); | 112 EXPECT_TRUE(height == capability_.height || height == capability_.width); |
| 113 EXPECT_TRUE(width == capability_.width || width == capability_.height); | 113 EXPECT_TRUE(width == capability_.width || width == capability_.height); |
| 114 #else | 114 #else |
| 115 EXPECT_EQ(height, capability_.height); | 115 if (rotate_frame_ == webrtc::kVideoRotation_90 || |
| 116 EXPECT_EQ(width, capability_.width); | 116 rotate_frame_ == webrtc::kVideoRotation_270) { |
| 117 EXPECT_EQ(rotate_frame_, videoFrame.rotation()); | 117 EXPECT_EQ(width, capability_.height); |
| 118 EXPECT_EQ(height, capability_.width); |
| 119 } else { |
| 120 EXPECT_EQ(height, capability_.height); |
| 121 EXPECT_EQ(width, capability_.width); |
| 122 } |
| 118 #endif | 123 #endif |
| 119 // RenderTimstamp should be the time now. | 124 // RenderTimstamp should be the time now. |
| 120 EXPECT_TRUE( | 125 EXPECT_TRUE( |
| 121 videoFrame.render_time_ms() >= TickTime::MillisecondTimestamp()-30 && | 126 videoFrame.render_time_ms() >= TickTime::MillisecondTimestamp()-30 && |
| 122 videoFrame.render_time_ms() <= TickTime::MillisecondTimestamp()); | 127 videoFrame.render_time_ms() <= TickTime::MillisecondTimestamp()); |
| 123 | 128 |
| 124 if ((videoFrame.render_time_ms() > | 129 if ((videoFrame.render_time_ms() > |
| 125 last_render_time_ms_ + (1000 * 1.1) / capability_.maxFPS && | 130 last_render_time_ms_ + (1000 * 1.1) / capability_.maxFPS && |
| 126 last_render_time_ms_ > 0) || | 131 last_render_time_ms_ > 0) || |
| 127 (videoFrame.render_time_ms() < | 132 (videoFrame.render_time_ms() < |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 length, capture_callback_.capability(), 0)); | 549 length, capture_callback_.capability(), 0)); |
| 545 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); | 550 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); |
| 546 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); | 551 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); |
| 547 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 552 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
| 548 length, capture_callback_.capability(), 0)); | 553 length, capture_callback_.capability(), 0)); |
| 549 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); | 554 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); |
| 550 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); | 555 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); |
| 551 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 556 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
| 552 length, capture_callback_.capability(), 0)); | 557 length, capture_callback_.capability(), 0)); |
| 553 } | 558 } |
| OLD | NEW |