// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/basic_desktop_environment.h" #include "base/bind.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" #include "remoting/host/audio_capturer.h" #include "remoting/host/client_session_control.h" #include "remoting/host/input_injector.h" #include "remoting/host/screen_controls.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" namespace remoting { BasicDesktopEnvironment::~BasicDesktopEnvironment() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); } scoped_ptr BasicDesktopEnvironment::CreateAudioCapturer() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); return AudioCapturer::Create(); } scoped_ptr BasicDesktopEnvironment::CreateInputInjector() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); return InputInjector::Create(input_task_runner(), ui_task_runner()); } scoped_ptr BasicDesktopEnvironment::CreateScreenControls() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); return scoped_ptr(); } std::string BasicDesktopEnvironment::GetCapabilities() const { return std::string(); } void BasicDesktopEnvironment::SetCapabilities(const std::string& capabilities) { } scoped_ptr BasicDesktopEnvironment::CreateVideoCapturer() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); // The basic desktop environment does not use X DAMAGE, since it is // broken on many systems - see http://crbug.com/73423. return scoped_ptr(webrtc::ScreenCapturer::Create()); } BasicDesktopEnvironment::BasicDesktopEnvironment( scoped_refptr caller_task_runner, scoped_refptr input_task_runner, scoped_refptr ui_task_runner) : caller_task_runner_(caller_task_runner), input_task_runner_(input_task_runner), ui_task_runner_(ui_task_runner) { DCHECK(caller_task_runner_->BelongsToCurrentThread()); } BasicDesktopEnvironmentFactory::BasicDesktopEnvironmentFactory( scoped_refptr caller_task_runner, scoped_refptr input_task_runner, scoped_refptr ui_task_runner) : caller_task_runner_(caller_task_runner), input_task_runner_(input_task_runner), ui_task_runner_(ui_task_runner) { } BasicDesktopEnvironmentFactory::~BasicDesktopEnvironmentFactory() { } bool BasicDesktopEnvironmentFactory::SupportsAudioCapture() const { DCHECK(caller_task_runner_->BelongsToCurrentThread()); return AudioCapturer::IsSupported(); } } // namespace remoting