// 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/logging.h" #include "media/video/capture/screen/screen_capturer.h" #include "remoting/host/audio_capturer.h" #include "remoting/host/event_executor.h" namespace remoting { BasicDesktopEnvironment::BasicDesktopEnvironment(bool use_x_damage) : use_x_damage_(use_x_damage) { } BasicDesktopEnvironment::~BasicDesktopEnvironment() { DCHECK(CalledOnValidThread()); } scoped_ptr BasicDesktopEnvironment::CreateAudioCapturer( scoped_refptr audio_task_runner) { DCHECK(CalledOnValidThread()); return AudioCapturer::Create(); } scoped_ptr BasicDesktopEnvironment::CreateEventExecutor( scoped_refptr input_task_runner, scoped_refptr ui_task_runner) { DCHECK(CalledOnValidThread()); return EventExecutor::Create(input_task_runner, ui_task_runner); } scoped_ptr BasicDesktopEnvironment::CreateVideoCapturer( scoped_refptr capture_task_runner, scoped_refptr encode_task_runner) { DCHECK(CalledOnValidThread()); #if defined(OS_LINUX) return media::ScreenCapturer::CreateWithXDamage(use_x_damage_); #else // !defined(OS_LINUX) return media::ScreenCapturer::Create(); #endif // !defined(OS_LINUX) } BasicDesktopEnvironmentFactory::BasicDesktopEnvironmentFactory( bool use_x_damage) : use_x_damage_(use_x_damage) { } BasicDesktopEnvironmentFactory::~BasicDesktopEnvironmentFactory() { } scoped_ptr BasicDesktopEnvironmentFactory::Create( const std::string& client_jid, const base::Closure& disconnect_callback) { return scoped_ptr( new BasicDesktopEnvironment(use_x_damage_)); } bool BasicDesktopEnvironmentFactory::SupportsAudioCapture() const { return AudioCapturer::IsSupported(); } } // namespace remoting