blob: 99ddca0ba5a797f3072de2925832d339ca64f191 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
// 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/desktop_resizer.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/resizing_host_observer.h"
namespace remoting {
BasicDesktopEnvironment::BasicDesktopEnvironment(bool use_x_damage)
: use_x_damage_(use_x_damage) {
}
BasicDesktopEnvironment::~BasicDesktopEnvironment() {
DCHECK(CalledOnValidThread());
}
scoped_ptr<AudioCapturer> BasicDesktopEnvironment::CreateAudioCapturer(
scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) {
DCHECK(CalledOnValidThread());
return AudioCapturer::Create();
}
scoped_ptr<EventExecutor> BasicDesktopEnvironment::CreateEventExecutor(
scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
DCHECK(CalledOnValidThread());
return EventExecutor::Create(input_task_runner, ui_task_runner);
}
scoped_ptr<SessionController>
BasicDesktopEnvironment::CreateSessionController() {
DCHECK(CalledOnValidThread());
scoped_ptr<SessionController> session_controller(
new ResizingHostObserver(DesktopResizer::Create()));
return session_controller.Pass();
}
scoped_ptr<media::ScreenCapturer> BasicDesktopEnvironment::CreateVideoCapturer(
scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> 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<DesktopEnvironment> BasicDesktopEnvironmentFactory::Create(
const std::string& client_jid,
const base::Closure& disconnect_callback) {
return scoped_ptr<DesktopEnvironment>(
new BasicDesktopEnvironment(use_x_damage_));
}
bool BasicDesktopEnvironmentFactory::SupportsAudioCapture() const {
return AudioCapturer::IsSupported();
}
} // namespace remoting
|