OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/fake_desktop_capturer.h" | 5 #include "remoting/protocol/fake_desktop_capturer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 void FakeDesktopCapturer::Capture(const webrtc::DesktopRegion& region) { | 148 void FakeDesktopCapturer::Capture(const webrtc::DesktopRegion& region) { |
149 base::Time capture_start_time = base::Time::Now(); | 149 base::Time capture_start_time = base::Time::Now(); |
150 std::unique_ptr<webrtc::DesktopFrame> frame = | 150 std::unique_ptr<webrtc::DesktopFrame> frame = |
151 frame_generator_.Run(shared_memory_factory_.get()); | 151 frame_generator_.Run(shared_memory_factory_.get()); |
152 if (frame) { | 152 if (frame) { |
153 frame->set_capture_time_ms( | 153 frame->set_capture_time_ms( |
154 (base::Time::Now() - capture_start_time).InMillisecondsRoundedUp()); | 154 (base::Time::Now() - capture_start_time).InMillisecondsRoundedUp()); |
155 } | 155 } |
156 callback_->OnCaptureCompleted(frame.release()); | 156 callback_->OnCaptureResult( |
| 157 frame ? webrtc::DesktopCapturer::Result::SUCCESS |
| 158 : webrtc::DesktopCapturer::Result::ERROR_TEMPORARY, |
| 159 std::move(frame)); |
157 } | 160 } |
158 | 161 |
159 } // namespace protocol | 162 } // namespace protocol |
160 } // namespace remoting | 163 } // namespace remoting |
OLD | NEW |