| 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/basic_desktop_environment.h" | 5 #include "remoting/host/basic_desktop_environment.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "media/video/capture/screen/screen_capturer.h" | |
| 11 #include "remoting/host/audio_capturer.h" | 10 #include "remoting/host/audio_capturer.h" |
| 12 #include "remoting/host/client_session_control.h" | 11 #include "remoting/host/client_session_control.h" |
| 13 #include "remoting/host/input_injector.h" | 12 #include "remoting/host/input_injector.h" |
| 14 #include "remoting/host/screen_controls.h" | 13 #include "remoting/host/screen_controls.h" |
| 14 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 | 17 |
| 18 BasicDesktopEnvironment::~BasicDesktopEnvironment() { | 18 BasicDesktopEnvironment::~BasicDesktopEnvironment() { |
| 19 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 19 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 scoped_ptr<AudioCapturer> BasicDesktopEnvironment::CreateAudioCapturer() { | 22 scoped_ptr<AudioCapturer> BasicDesktopEnvironment::CreateAudioCapturer() { |
| 23 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 23 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 24 | 24 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 return scoped_ptr<ScreenControls>(); | 37 return scoped_ptr<ScreenControls>(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 std::string BasicDesktopEnvironment::GetCapabilities() const { | 40 std::string BasicDesktopEnvironment::GetCapabilities() const { |
| 41 return std::string(); | 41 return std::string(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void BasicDesktopEnvironment::SetCapabilities(const std::string& capabilities) { | 44 void BasicDesktopEnvironment::SetCapabilities(const std::string& capabilities) { |
| 45 } | 45 } |
| 46 | 46 |
| 47 scoped_ptr<media::ScreenCapturer> | 47 scoped_ptr<webrtc::ScreenCapturer> |
| 48 BasicDesktopEnvironment::CreateVideoCapturer() { | 48 BasicDesktopEnvironment::CreateVideoCapturer() { |
| 49 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 49 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 50 | 50 |
| 51 // The basic desktop environment does not use X DAMAGE, since it is | 51 // The basic desktop environment does not use X DAMAGE, since it is |
| 52 // broken on many systems - see http://crbug.com/73423. | 52 // broken on many systems - see http://crbug.com/73423. |
| 53 return media::ScreenCapturer::Create(); | 53 return scoped_ptr<webrtc::ScreenCapturer>(webrtc::ScreenCapturer::Create()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 BasicDesktopEnvironment::BasicDesktopEnvironment( | 56 BasicDesktopEnvironment::BasicDesktopEnvironment( |
| 57 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 57 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 58 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 58 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) | 59 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) |
| 60 : caller_task_runner_(caller_task_runner), | 60 : caller_task_runner_(caller_task_runner), |
| 61 input_task_runner_(input_task_runner), | 61 input_task_runner_(input_task_runner), |
| 62 ui_task_runner_(ui_task_runner) { | 62 ui_task_runner_(ui_task_runner) { |
| 63 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 63 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 77 BasicDesktopEnvironmentFactory::~BasicDesktopEnvironmentFactory() { | 77 BasicDesktopEnvironmentFactory::~BasicDesktopEnvironmentFactory() { |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool BasicDesktopEnvironmentFactory::SupportsAudioCapture() const { | 80 bool BasicDesktopEnvironmentFactory::SupportsAudioCapture() const { |
| 81 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 81 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 82 | 82 |
| 83 return AudioCapturer::IsSupported(); | 83 return AudioCapturer::IsSupported(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace remoting | 86 } // namespace remoting |
| OLD | NEW |