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
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_HOST_EXTENSION_SESSION_H_
6 #define REMOTING_HOST_HOST_EXTENSION_SESSION_H_
8 #include "base/memory/scoped_ptr.h"
11 class DesktopCapturer
;
16 class ClientSessionControl
;
20 class ExtensionMessage
;
22 } // namespace protocol
24 // Created by an |HostExtension| to store |ClientSession| specific state, and to
25 // handle extension messages.
26 class HostExtensionSession
{
28 virtual ~HostExtensionSession() {}
30 // Optional hook functions for HostExtensions which need to wrap or replace
31 // parts of the video, audio, input, etc pipelines.
32 // These are called in response to ResetVideoPipeline().
33 virtual scoped_ptr
<webrtc::DesktopCapturer
> OnCreateVideoCapturer(
34 scoped_ptr
<webrtc::DesktopCapturer
> capturer
);
35 virtual scoped_ptr
<VideoEncoder
> OnCreateVideoEncoder(
36 scoped_ptr
<VideoEncoder
> encoder
);
37 virtual bool ModifiesVideoPipeline() const;
39 // Called when the host receives an |ExtensionMessage| for the |ClientSession|
40 // associated with this |HostExtensionSession|.
41 // It returns |true| if the message was handled, and |false| otherwise.
42 virtual bool OnExtensionMessage(
43 ClientSessionControl
* client_session_control
,
44 protocol::ClientStub
* client_stub
,
45 const protocol::ExtensionMessage
& message
) = 0;
48 } // namespace remoting
50 #endif // REMOTING_HOST_HOST_EXTENSION_SESSION_H_