OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/host_extension_session_manager.h" | 5 #include "remoting/host/host_extension_session_manager.h" |
6 | 6 |
7 #include "remoting/base/capabilities.h" | 7 #include "remoting/base/capabilities.h" |
8 #include "remoting/codec/video_encoder.h" | 8 #include "remoting/codec/video_encoder.h" |
9 #include "remoting/host/client_session_control.h" | 9 #include "remoting/host/client_session_control.h" |
10 #include "remoting/host/host_extension.h" | 10 #include "remoting/host/host_extension.h" |
11 #include "remoting/host/host_extension_session.h" | 11 #include "remoting/host/host_extension_session.h" |
12 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
15 HostExtensionSessionManager::HostExtensionSessionManager( | 15 HostExtensionSessionManager::HostExtensionSessionManager( |
16 const std::vector<HostExtension*>& extensions, | 16 const std::vector<HostExtension*>& extensions, |
17 ClientSessionControl* client_session_control) | 17 ClientSessionControl* client_session_control) |
18 : client_session_control_(client_session_control), | 18 : client_session_control_(client_session_control), |
19 client_stub_(NULL), | 19 client_stub_(NULL), |
20 extensions_(extensions) { | 20 extensions_(extensions) { |
21 } | 21 } |
22 | 22 |
23 HostExtensionSessionManager::~HostExtensionSessionManager() { | 23 HostExtensionSessionManager::~HostExtensionSessionManager() { |
24 } | 24 } |
25 | 25 |
26 std::string HostExtensionSessionManager::GetCapabilities() { | 26 std::string HostExtensionSessionManager::GetCapabilities() { |
27 std::string capabilities; | 27 std::string capabilities; |
28 for (HostExtensionList::const_iterator extension = extensions_.begin(); | 28 for (HostExtensionList::const_iterator extension = extensions_.begin(); |
29 extension != extensions_.end(); ++extension) { | 29 extension != extensions_.end(); ++extension) { |
30 std::string capability = (*extension)->capability(); | 30 std::string capability = (*extension)->capability(); |
31 if (capability.empty()) { | 31 if (capability.empty()) { |
32 continue; | 32 continue; |
33 } | 33 } |
34 if (!capabilities.empty()) { | 34 if (!capabilities.empty()) { |
35 capabilities.append(" "); | 35 capabilities.append(" "); |
36 } | 36 } |
37 capabilities.append(capability); | 37 capabilities.append(capability); |
38 } | 38 } |
39 return capabilities; | 39 return capabilities; |
40 } | 40 } |
41 | 41 |
42 scoped_ptr<webrtc::ScreenCapturer> | 42 scoped_ptr<webrtc::DesktopCapturer> |
43 HostExtensionSessionManager::OnCreateVideoCapturer( | 43 HostExtensionSessionManager::OnCreateVideoCapturer( |
44 scoped_ptr<webrtc::ScreenCapturer> capturer) { | 44 scoped_ptr<webrtc::DesktopCapturer> capturer) { |
45 for(HostExtensionSessionList::const_iterator it = extension_sessions_.begin(); | 45 for(HostExtensionSessionList::const_iterator it = extension_sessions_.begin(); |
46 it != extension_sessions_.end(); ++it) { | 46 it != extension_sessions_.end(); ++it) { |
47 if ((*it)->ModifiesVideoPipeline()) { | 47 if ((*it)->ModifiesVideoPipeline()) { |
48 capturer = (*it)->OnCreateVideoCapturer(capturer.Pass()); | 48 capturer = (*it)->OnCreateVideoCapturer(capturer.Pass()); |
49 } | 49 } |
50 } | 50 } |
51 return capturer.Pass(); | 51 return capturer.Pass(); |
52 } | 52 } |
53 | 53 |
54 scoped_ptr<VideoEncoder> HostExtensionSessionManager::OnCreateVideoEncoder( | 54 scoped_ptr<VideoEncoder> HostExtensionSessionManager::OnCreateVideoEncoder( |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 it != extension_sessions_.end(); ++it) { | 105 it != extension_sessions_.end(); ++it) { |
106 if ((*it)->OnExtensionMessage( | 106 if ((*it)->OnExtensionMessage( |
107 client_session_control_, client_stub_, message)) { | 107 client_session_control_, client_stub_, message)) { |
108 return true; | 108 return true; |
109 } | 109 } |
110 } | 110 } |
111 return false; | 111 return false; |
112 } | 112 } |
113 | 113 |
114 } // namespace remoting | 114 } // namespace remoting |
OLD | NEW |