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 #ifndef REMOTING_HOST_HOST_EXTENSION_SESSION_H_ | 5 #ifndef REMOTING_HOST_HOST_EXTENSION_SESSION_H_ |
6 #define REMOTING_HOST_HOST_EXTENSION_SESSION_H_ | 6 #define REMOTING_HOST_HOST_EXTENSION_SESSION_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 | 9 |
10 namespace webrtc { | 10 namespace webrtc { |
11 class DesktopCapturer; | 11 class DesktopCapturer; |
12 } | 12 } |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
16 class ClientSessionControl; | 16 class ClientSessionControl; |
17 class VideoEncoder; | 17 class VideoEncoder; |
18 | 18 |
19 namespace protocol { | 19 namespace protocol { |
20 class ExtensionMessage; | 20 class ExtensionMessage; |
21 class ClientStub; | 21 class ClientStub; |
22 } // namespace protocol | 22 } // namespace protocol |
23 | 23 |
24 // Created by an |HostExtension| to store |ClientSession| specific state, and to | 24 // Created by an |HostExtension| to store |ClientSession| specific state, and to |
25 // handle extension messages. | 25 // handle extension messages. |
26 class HostExtensionSession { | 26 class HostExtensionSession { |
27 public: | 27 public: |
28 virtual ~HostExtensionSession() {} | 28 virtual ~HostExtensionSession() {} |
29 | 29 |
30 // Optional hook functions for HostExtensions which need to wrap or replace | 30 // Hook functions called when the video pipeline is being (re)constructed. |
31 // parts of the video, audio, input, etc pipelines. | 31 // Implementations will receive these calls only if they express the need to |
32 // These are called in response to ResetVideoPipeline(). | 32 // modify the pipeline (see below). They may replace, wrap or take ownership |
Peter Kasting
2014/08/26 20:58:15
Nit: For clarity, I think maybe "take ownership" s
Wez
2014/08/28 00:13:20
Done.
| |
33 virtual scoped_ptr<webrtc::DesktopCapturer> OnCreateVideoCapturer( | 33 // of |capturer| and/or |encoder|, e.g. to filter video frames in some way. |
34 scoped_ptr<webrtc::DesktopCapturer> capturer); | 34 // If either |capturer| or |encoder| are reset then the video pipeline is not |
35 virtual scoped_ptr<VideoEncoder> OnCreateVideoEncoder( | 35 // constructed. |
36 scoped_ptr<VideoEncoder> encoder); | 36 virtual void OnCreateVideoCapturer( |
37 scoped_ptr<webrtc::DesktopCapturer>* capturer); | |
38 virtual void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder); | |
39 | |
40 // Must return true if the HostExtensionSession needs the opportunity to | |
41 // modify the video pipeline. | |
37 virtual bool ModifiesVideoPipeline() const; | 42 virtual bool ModifiesVideoPipeline() const; |
Peter Kasting
2014/08/26 20:58:15
Tiny nit: I wonder if "WantsToModifyVideoPipeline"
Wez
2014/08/28 00:13:20
Acknowledged. I think Modifies* is sufficiently ex
| |
38 | 43 |
39 // Called when the host receives an |ExtensionMessage| for the |ClientSession| | 44 // Called when the host receives an |ExtensionMessage| for the |ClientSession| |
40 // associated with this |HostExtensionSession|. | 45 // associated with this |HostExtensionSession|. |
41 // It returns |true| if the message was handled, and |false| otherwise. | 46 // It returns |true| if the message was handled, and |false| otherwise. |
42 virtual bool OnExtensionMessage( | 47 virtual bool OnExtensionMessage( |
43 ClientSessionControl* client_session_control, | 48 ClientSessionControl* client_session_control, |
44 protocol::ClientStub* client_stub, | 49 protocol::ClientStub* client_stub, |
45 const protocol::ExtensionMessage& message) = 0; | 50 const protocol::ExtensionMessage& message) = 0; |
46 }; | 51 }; |
47 | 52 |
48 } // namespace remoting | 53 } // namespace remoting |
49 | 54 |
50 #endif // REMOTING_HOST_HOST_EXTENSION_SESSION_H_ | 55 #endif // REMOTING_HOST_HOST_EXTENSION_SESSION_H_ |
OLD | NEW |