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 if (rotate_frame_ == webrtc::kVideoRotation_90 || | 115 EXPECT_EQ(height, capability_.height); |
116 rotate_frame_ == webrtc::kVideoRotation_270) { | 116 EXPECT_EQ(width, capability_.width); |
117 EXPECT_EQ(width, capability_.height); | 117 EXPECT_EQ(rotate_frame_, videoFrame.rotation()); |
118 EXPECT_EQ(height, capability_.width); | |
119 } else { | |
120 EXPECT_EQ(height, capability_.height); | |
121 EXPECT_EQ(width, capability_.width); | |
122 } | |
123 #endif | 118 #endif |
124 // RenderTimstamp should be the time now. | 119 // RenderTimstamp should be the time now. |
125 EXPECT_TRUE( | 120 EXPECT_TRUE( |
126 videoFrame.render_time_ms() >= TickTime::MillisecondTimestamp()-30 && | 121 videoFrame.render_time_ms() >= TickTime::MillisecondTimestamp()-30 && |
127 videoFrame.render_time_ms() <= TickTime::MillisecondTimestamp()); | 122 videoFrame.render_time_ms() <= TickTime::MillisecondTimestamp()); |
128 | 123 |
129 if ((videoFrame.render_time_ms() > | 124 if ((videoFrame.render_time_ms() > |
130 last_render_time_ms_ + (1000 * 1.1) / capability_.maxFPS && | 125 last_render_time_ms_ + (1000 * 1.1) / capability_.maxFPS && |
131 last_render_time_ms_ > 0) || | 126 last_render_time_ms_ > 0) || |
132 (videoFrame.render_time_ms() < | 127 (videoFrame.render_time_ms() < |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 length, capture_callback_.capability(), 0)); | 544 length, capture_callback_.capability(), 0)); |
550 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); | 545 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); |
551 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); | 546 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); |
552 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 547 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
553 length, capture_callback_.capability(), 0)); | 548 length, capture_callback_.capability(), 0)); |
554 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); | 549 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); |
555 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); | 550 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); |
556 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 551 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
557 length, capture_callback_.capability(), 0)); | 552 length, capture_callback_.capability(), 0)); |
558 } | 553 } |
OLD | NEW |