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/ipc_desktop_environment.h" | 5 #include "remoting/host/ipc_desktop_environment.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "ipc/ipc_channel_proxy.h" | 13 #include "ipc/ipc_channel_proxy.h" |
14 #include "remoting/capturer/video_frame_capturer.h" | 14 #include "media/video/capture/screen/screen_capturer.h" |
15 #include "remoting/host/audio_capturer.h" | 15 #include "remoting/host/audio_capturer.h" |
16 #include "remoting/host/chromoting_messages.h" | 16 #include "remoting/host/chromoting_messages.h" |
17 #include "remoting/host/desktop_session_proxy.h" | 17 #include "remoting/host/desktop_session_proxy.h" |
18 #include "remoting/host/event_executor.h" | 18 #include "remoting/host/event_executor.h" |
19 | 19 |
20 namespace remoting { | 20 namespace remoting { |
21 | 21 |
22 IpcDesktopEnvironment::IpcDesktopEnvironment( | 22 IpcDesktopEnvironment::IpcDesktopEnvironment( |
23 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 23 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
24 const std::string& client_jid, | 24 const std::string& client_jid, |
(...skipping 26 matching lines...) Expand all Loading... |
51 scoped_ptr<EventExecutor> IpcDesktopEnvironment::CreateEventExecutor( | 51 scoped_ptr<EventExecutor> IpcDesktopEnvironment::CreateEventExecutor( |
52 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 52 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
53 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 53 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
54 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 54 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
55 | 55 |
56 ConnectToDesktopSession(); | 56 ConnectToDesktopSession(); |
57 return desktop_session_proxy_->CreateEventExecutor(input_task_runner, | 57 return desktop_session_proxy_->CreateEventExecutor(input_task_runner, |
58 ui_task_runner); | 58 ui_task_runner); |
59 } | 59 } |
60 | 60 |
61 scoped_ptr<VideoFrameCapturer> IpcDesktopEnvironment::CreateVideoCapturer( | 61 scoped_ptr<media::ScreenCapturer> IpcDesktopEnvironment::CreateVideoCapturer( |
62 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 62 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
63 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) { | 63 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) { |
64 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 64 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
65 | 65 |
66 ConnectToDesktopSession(); | 66 ConnectToDesktopSession(); |
67 return desktop_session_proxy_->CreateVideoCapturer(capture_task_runner, | 67 return desktop_session_proxy_->CreateVideoCapturer(capture_task_runner, |
68 encode_task_runner); | 68 encode_task_runner); |
69 } | 69 } |
70 | 70 |
71 void IpcDesktopEnvironment::ConnectToDesktopSession() { | 71 void IpcDesktopEnvironment::ConnectToDesktopSession() { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 if (i != active_connections_.end()) { | 178 if (i != active_connections_.end()) { |
179 scoped_refptr<DesktopSessionProxy> desktop_session_proxy = i->second; | 179 scoped_refptr<DesktopSessionProxy> desktop_session_proxy = i->second; |
180 active_connections_.erase(i); | 180 active_connections_.erase(i); |
181 | 181 |
182 // Disconnect the client session. | 182 // Disconnect the client session. |
183 desktop_session_proxy->DisconnectSession(); | 183 desktop_session_proxy->DisconnectSession(); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 } // namespace remoting | 187 } // namespace remoting |
OLD | NEW |