| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 timing_warnings_++; | 101 timing_warnings_++; |
| 102 } | 102 } |
| 103 | 103 |
| 104 incoming_frames_++; | 104 incoming_frames_++; |
| 105 last_render_time_ms_ = videoFrame.render_time_ms(); | 105 last_render_time_ms_ = videoFrame.render_time_ms(); |
| 106 last_frame_ = videoFrame.video_frame_buffer(); | 106 last_frame_ = videoFrame.video_frame_buffer(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void SetExpectedCapability(VideoCaptureCapability capability) { | 109 void SetExpectedCapability(VideoCaptureCapability capability) { |
| 110 CriticalSectionScoped cs(capture_cs_.get()); | 110 CriticalSectionScoped cs(capture_cs_.get()); |
| 111 capability_= capability; | 111 capability_ = capability; |
| 112 incoming_frames_ = 0; | 112 incoming_frames_ = 0; |
| 113 last_render_time_ms_ = 0; | 113 last_render_time_ms_ = 0; |
| 114 } | 114 } |
| 115 int incoming_frames() { | 115 int incoming_frames() { |
| 116 CriticalSectionScoped cs(capture_cs_.get()); | 116 CriticalSectionScoped cs(capture_cs_.get()); |
| 117 return incoming_frames_; | 117 return incoming_frames_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 int timing_warnings() { | 120 int timing_warnings() { |
| 121 CriticalSectionScoped cs(capture_cs_.get()); | 121 CriticalSectionScoped cs(capture_cs_.get()); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 rtc::scoped_refptr<webrtc::I420Buffer> buffer = webrtc::I420Buffer::Create( | 368 rtc::scoped_refptr<webrtc::I420Buffer> buffer = webrtc::I420Buffer::Create( |
| 369 kTestWidth, kTestHeight, | 369 kTestWidth, kTestHeight, |
| 370 kTestWidth, ((kTestWidth + 1) / 2), (kTestWidth + 1) / 2); | 370 kTestWidth, ((kTestWidth + 1) / 2), (kTestWidth + 1) / 2); |
| 371 | 371 |
| 372 memset(buffer->MutableDataY(), 127, kTestWidth * kTestHeight); | 372 memset(buffer->MutableDataY(), 127, kTestWidth * kTestHeight); |
| 373 memset(buffer->MutableDataU(), 127, | 373 memset(buffer->MutableDataU(), 127, |
| 374 ((kTestWidth + 1) / 2) * ((kTestHeight + 1) / 2)); | 374 ((kTestWidth + 1) / 2) * ((kTestHeight + 1) / 2)); |
| 375 memset(buffer->MutableDataV(), 127, | 375 memset(buffer->MutableDataV(), 127, |
| 376 ((kTestWidth + 1) / 2) * ((kTestHeight + 1) / 2)); | 376 ((kTestWidth + 1) / 2) * ((kTestHeight + 1) / 2)); |
| 377 test_frame_.reset( | 377 test_frame_.reset( |
| 378 new webrtc::VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0)); | 378 new webrtc::VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0, |
| 379 webrtc::VideoContentType::kDefault)); |
| 379 | 380 |
| 380 SleepMs(1); // Wait 1ms so that two tests can't have the same timestamp. | 381 SleepMs(1); // Wait 1ms so that two tests can't have the same timestamp. |
| 381 | 382 |
| 382 capture_module_->RegisterCaptureDataCallback(&capture_callback_); | 383 capture_module_->RegisterCaptureDataCallback(&capture_callback_); |
| 383 } | 384 } |
| 384 | 385 |
| 385 void TearDown() { | 386 void TearDown() { |
| 386 } | 387 } |
| 387 | 388 |
| 388 webrtc::VideoCaptureExternal* capture_input_interface_; | 389 webrtc::VideoCaptureExternal* capture_input_interface_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 418 length, capture_callback_.capability(), 0)); | 419 length, capture_callback_.capability(), 0)); |
| 419 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); | 420 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_180)); |
| 420 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); | 421 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_180); |
| 421 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 422 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
| 422 length, capture_callback_.capability(), 0)); | 423 length, capture_callback_.capability(), 0)); |
| 423 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); | 424 EXPECT_EQ(0, capture_module_->SetCaptureRotation(webrtc::kVideoRotation_270)); |
| 424 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); | 425 capture_callback_.SetExpectedCaptureRotation(webrtc::kVideoRotation_270); |
| 425 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), | 426 EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(), |
| 426 length, capture_callback_.capability(), 0)); | 427 length, capture_callback_.capability(), 0)); |
| 427 } | 428 } |
| OLD | NEW |