| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (mouse_monitor_.get()) | 138 if (mouse_monitor_.get()) |
| 139 mouse_monitor_->Init(this, MouseCursorMonitor::SHAPE_AND_POSITION); | 139 mouse_monitor_->Init(this, MouseCursorMonitor::SHAPE_AND_POSITION); |
| 140 desktop_capturer_->Start(this); | 140 desktop_capturer_->Start(this); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void DesktopAndCursorComposer::SetSharedMemoryFactory( | 143 void DesktopAndCursorComposer::SetSharedMemoryFactory( |
| 144 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) { | 144 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) { |
| 145 desktop_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory)); | 145 desktop_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void DesktopAndCursorComposer::Capture(const DesktopRegion& region) { | 148 void DesktopAndCursorComposer::CaptureFrame() { |
| 149 if (mouse_monitor_.get()) | 149 if (mouse_monitor_.get()) |
| 150 mouse_monitor_->Capture(); | 150 mouse_monitor_->Capture(); |
| 151 desktop_capturer_->Capture(region); | 151 desktop_capturer_->CaptureFrame(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void DesktopAndCursorComposer::SetExcludedWindow(WindowId window) { | 154 void DesktopAndCursorComposer::SetExcludedWindow(WindowId window) { |
| 155 desktop_capturer_->SetExcludedWindow(window); | 155 desktop_capturer_->SetExcludedWindow(window); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void DesktopAndCursorComposer::OnCaptureResult( | 158 void DesktopAndCursorComposer::OnCaptureResult( |
| 159 DesktopCapturer::Result result, | 159 DesktopCapturer::Result result, |
| 160 std::unique_ptr<DesktopFrame> frame) { | 160 std::unique_ptr<DesktopFrame> frame) { |
| 161 if (frame && cursor_ && cursor_state_ == MouseCursorMonitor::INSIDE) { | 161 if (frame && cursor_ && cursor_state_ == MouseCursorMonitor::INSIDE) { |
| 162 frame = std::unique_ptr<DesktopFrameWithCursor>(new DesktopFrameWithCursor( | 162 frame = std::unique_ptr<DesktopFrameWithCursor>(new DesktopFrameWithCursor( |
| 163 std::move(frame), *cursor_, cursor_position_)); | 163 std::move(frame), *cursor_, cursor_position_)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 callback_->OnCaptureResult(result, std::move(frame)); | 166 callback_->OnCaptureResult(result, std::move(frame)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void DesktopAndCursorComposer::OnMouseCursor(MouseCursor* cursor) { | 169 void DesktopAndCursorComposer::OnMouseCursor(MouseCursor* cursor) { |
| 170 cursor_.reset(cursor); | 170 cursor_.reset(cursor); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void DesktopAndCursorComposer::OnMouseCursorPosition( | 173 void DesktopAndCursorComposer::OnMouseCursorPosition( |
| 174 MouseCursorMonitor::CursorState state, | 174 MouseCursorMonitor::CursorState state, |
| 175 const DesktopVector& position) { | 175 const DesktopVector& position) { |
| 176 cursor_state_ = state; | 176 cursor_state_ = state; |
| 177 cursor_position_ = position; | 177 cursor_position_ = position; |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace webrtc | 180 } // namespace webrtc |
| OLD | NEW |