| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/host/desktop_session_proxy.h" | 5 #include "remoting/host/desktop_session_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 desktop_channel_.reset(); | 242 desktop_channel_.reset(); |
| 243 desktop_session_id_ = UINT32_MAX; | 243 desktop_session_id_ = UINT32_MAX; |
| 244 | 244 |
| 245 shared_buffers_.clear(); | 245 shared_buffers_.clear(); |
| 246 | 246 |
| 247 // Generate fake responses to keep the video capturer in sync. | 247 // Generate fake responses to keep the video capturer in sync. |
| 248 while (pending_capture_frame_requests_) { | 248 while (pending_capture_frame_requests_) { |
| 249 --pending_capture_frame_requests_; | 249 --pending_capture_frame_requests_; |
| 250 video_capturer_->OnCaptureResult( | 250 video_capturer_->OnCaptureResult( |
| 251 webrtc::DesktopCapturer::Result::ERROR_PERMANENT, nullptr); | 251 webrtc::DesktopCapturer::Result::ERROR_TEMPORARY, nullptr); |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 | 254 |
| 255 void DesktopSessionProxy::SetAudioCapturer( | 255 void DesktopSessionProxy::SetAudioCapturer( |
| 256 const base::WeakPtr<IpcAudioCapturer>& audio_capturer) { | 256 const base::WeakPtr<IpcAudioCapturer>& audio_capturer) { |
| 257 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); | 257 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); |
| 258 | 258 |
| 259 audio_capturer_ = audio_capturer; | 259 audio_capturer_ = audio_capturer; |
| 260 } | 260 } |
| 261 | 261 |
| 262 void DesktopSessionProxy::CaptureFrame() { | 262 void DesktopSessionProxy::CaptureFrame() { |
| 263 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 263 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 264 | 264 |
| 265 if (desktop_channel_) { | 265 if (desktop_channel_) { |
| 266 ++pending_capture_frame_requests_; | 266 ++pending_capture_frame_requests_; |
| 267 SendToDesktop(new ChromotingNetworkDesktopMsg_CaptureFrame()); | 267 SendToDesktop(new ChromotingNetworkDesktopMsg_CaptureFrame()); |
| 268 } else { | 268 } else { |
| 269 video_capturer_->OnCaptureResult( | 269 video_capturer_->OnCaptureResult( |
| 270 webrtc::DesktopCapturer::Result::ERROR_PERMANENT, nullptr); | 270 webrtc::DesktopCapturer::Result::ERROR_TEMPORARY, nullptr); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 void DesktopSessionProxy::SetVideoCapturer( | 274 void DesktopSessionProxy::SetVideoCapturer( |
| 275 const base::WeakPtr<IpcVideoFrameCapturer> video_capturer) { | 275 const base::WeakPtr<IpcVideoFrameCapturer> video_capturer) { |
| 276 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 276 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 277 | 277 |
| 278 video_capturer_ = video_capturer; | 278 video_capturer_ = video_capturer; |
| 279 } | 279 } |
| 280 | 280 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 } | 527 } |
| 528 | 528 |
| 529 // static | 529 // static |
| 530 void DesktopSessionProxyTraits::Destruct( | 530 void DesktopSessionProxyTraits::Destruct( |
| 531 const DesktopSessionProxy* desktop_session_proxy) { | 531 const DesktopSessionProxy* desktop_session_proxy) { |
| 532 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, | 532 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, |
| 533 desktop_session_proxy); | 533 desktop_session_proxy); |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace remoting | 536 } // namespace remoting |
| OLD | NEW |