OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #include "webrtc/video/video_capture_input.h" | 10 #include "webrtc/video/video_capture_input.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 webrtc::VideoSendStream::Config(nullptr)) {} | 57 webrtc::VideoSendStream::Config(nullptr)) {} |
58 | 58 |
59 virtual void SetUp() { | 59 virtual void SetUp() { |
60 EXPECT_CALL(*mock_frame_callback_, DeliverFrame(_)) | 60 EXPECT_CALL(*mock_frame_callback_, DeliverFrame(_)) |
61 .WillRepeatedly( | 61 .WillRepeatedly( |
62 WithArg<0>(Invoke(this, &VideoCaptureInputTest::AddOutputFrame))); | 62 WithArg<0>(Invoke(this, &VideoCaptureInputTest::AddOutputFrame))); |
63 | 63 |
64 Config config; | 64 Config config; |
65 input_.reset(new internal::VideoCaptureInput( | 65 input_.reset(new internal::VideoCaptureInput( |
66 mock_process_thread_.get(), mock_frame_callback_.get(), nullptr, | 66 mock_process_thread_.get(), mock_frame_callback_.get(), nullptr, |
67 &stats_proxy_, nullptr, nullptr)); | 67 &stats_proxy_, nullptr)); |
68 } | 68 } |
69 | 69 |
70 virtual void TearDown() { | 70 virtual void TearDown() { |
71 // VideoCaptureInput accesses |mock_process_thread_| in destructor and | 71 // VideoCaptureInput accesses |mock_process_thread_| in destructor and |
72 // should | 72 // should |
73 // be deleted first. | 73 // be deleted first. |
74 input_.reset(); | 74 input_.reset(); |
75 } | 75 } |
76 | 76 |
77 void AddInputFrame(VideoFrame* frame) { | 77 void AddInputFrame(VideoFrame* frame) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 const int kSizeY = width * height * 2; | 297 const int kSizeY = width * height * 2; |
298 uint8_t buffer[kSizeY]; | 298 uint8_t buffer[kSizeY]; |
299 memset(buffer, data, kSizeY); | 299 memset(buffer, data, kSizeY); |
300 frame->CreateFrame(buffer, buffer, buffer, width, height, width, width / 2, | 300 frame->CreateFrame(buffer, buffer, buffer, width, height, width, width / 2, |
301 width / 2); | 301 width / 2); |
302 frame->set_render_time_ms(data); | 302 frame->set_render_time_ms(data); |
303 return frame; | 303 return frame; |
304 } | 304 } |
305 | 305 |
306 } // namespace webrtc | 306 } // namespace webrtc |
OLD | NEW |