diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-16 17:23:53 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-16 17:23:53 +0000 |
commit | ce404cae8c35d9c39b328e2f7207b852f482a15f (patch) | |
tree | 99624ecd8daa98c28eb35323aa465ca8819fd480 /remoting/host/host_mock_objects.cc | |
parent | e921967a10108d9751709ff4f35abd67b49103f8 (diff) | |
download | chromium_src-ce404cae8c35d9c39b328e2f7207b852f482a15f.zip chromium_src-ce404cae8c35d9c39b328e2f7207b852f482a15f.tar.gz chromium_src-ce404cae8c35d9c39b328e2f7207b852f482a15f.tar.bz2 |
Making DesktopEnvironment a factory class used by ClientSession to create audio/video capturers and event executor for a pacticular desktop environment.
Other related changes:
- AudioCapturer and VideoFrameCapturer are owned by AudioScheduler and VideoScheduler correspondingly.
- Both AudioScheduler and VideoScheduler can now be stopped completely asynchronously.
- AudioScheduler::SetEnabled() changed to Pause() to match the corresponding method provided by VideoScheduler.
- ClientSession::Stop() is synchronous now.
BUG=104544
Review URL: https://chromiumcodereview.appspot.com/11778049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/host_mock_objects.cc')
-rw-r--r-- | remoting/host/host_mock_objects.cc | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/remoting/host/host_mock_objects.cc b/remoting/host/host_mock_objects.cc index f9b6c52..2fa3d8f 100644 --- a/remoting/host/host_mock_objects.cc +++ b/remoting/host/host_mock_objects.cc @@ -5,20 +5,49 @@ #include "remoting/host/host_mock_objects.h" #include "base/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" #include "net/base/ip_endpoint.h" #include "remoting/base/auto_thread_task_runner.h" +#include "remoting/capturer/video_frame_capturer.h" +#include "remoting/codec/audio_encoder.h" +#include "remoting/codec/video_encoder.h" +#include "remoting/host/audio_capturer.h" +#include "remoting/host/event_executor.h" #include "remoting/proto/event.pb.h" #include "remoting/protocol/transport.h" namespace remoting { -MockDesktopEnvironmentFactory::MockDesktopEnvironmentFactory() - : DesktopEnvironmentFactory(NULL, NULL) { +MockDesktopEnvironment::MockDesktopEnvironment() {} + +MockDesktopEnvironment::~MockDesktopEnvironment() {} + +scoped_ptr<AudioCapturer> MockDesktopEnvironment::CreateAudioCapturer( + scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) { + return scoped_ptr<AudioCapturer>(CreateAudioCapturerPtr(audio_task_runner)); +} + +scoped_ptr<EventExecutor> MockDesktopEnvironment::CreateEventExecutor( + scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { + return scoped_ptr<EventExecutor>(CreateEventExecutorPtr(input_task_runner, + ui_task_runner)); } +scoped_ptr<VideoFrameCapturer> MockDesktopEnvironment::CreateVideoCapturer( + scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) { + return scoped_ptr<VideoFrameCapturer>(CreateVideoCapturerPtr( + capture_task_runner, encode_task_runner)); +} + +MockDesktopEnvironmentFactory::MockDesktopEnvironmentFactory() {} + MockDesktopEnvironmentFactory::~MockDesktopEnvironmentFactory() {} -scoped_ptr<DesktopEnvironment> MockDesktopEnvironmentFactory::Create() { +scoped_ptr<DesktopEnvironment> MockDesktopEnvironmentFactory::Create( + const std::string& client_jid, + const base::Closure& disconnect_callback) { return scoped_ptr<DesktopEnvironment>(CreatePtr()); } |