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 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
15 #include "remoting/protocol/audio_writer.h" | 15 #include "remoting/protocol/audio_writer.h" |
16 #include "remoting/protocol/session.h" | 16 #include "remoting/protocol/session.h" |
17 | 17 |
18 namespace remoting { | 18 namespace remoting { |
19 namespace protocol { | 19 namespace protocol { |
20 | 20 |
21 class ClientStub; | 21 class ClientStub; |
22 class ClipboardStub; | 22 class ClipboardStub; |
23 class HostControlDispatcher; | 23 class HostControlDispatcher; |
24 class HostEventDispatcher; | 24 class HostEventDispatcher; |
25 class HostStub; | 25 class HostStub; |
26 class HostVideoDispatcher; | 26 class HostVideoDispatcher; |
27 class InputStub; | 27 class InputStub; |
| 28 class VideoFeedbackStub; |
28 class VideoStub; | 29 class VideoStub; |
29 | 30 |
30 // This class represents a remote viewer connection to the chromoting | 31 // This class represents a remote viewer connection to the chromoting |
31 // host. It sets up all protocol channels and connects them to the | 32 // host. It sets up all protocol channels and connects them to the |
32 // stubs. | 33 // stubs. |
33 class ConnectionToClient : public base::NonThreadSafe, | 34 class ConnectionToClient : public base::NonThreadSafe, |
34 public Session::EventHandler, | 35 public Session::EventHandler, |
35 public ChannelDispatcherBase::EventHandler { | 36 public ChannelDispatcherBase::EventHandler { |
36 public: | 37 public: |
37 class EventHandler { | 38 class EventHandler { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual VideoStub* video_stub(); | 92 virtual VideoStub* video_stub(); |
92 virtual AudioStub* audio_stub(); | 93 virtual AudioStub* audio_stub(); |
93 virtual ClientStub* client_stub(); | 94 virtual ClientStub* client_stub(); |
94 | 95 |
95 // Set the stubs which will handle messages we receive from the client. These | 96 // Set the stubs which will handle messages we receive from the client. These |
96 // must be called in EventHandler::OnConnectionAuthenticated(). | 97 // must be called in EventHandler::OnConnectionAuthenticated(). |
97 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); | 98 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); |
98 virtual void set_host_stub(HostStub* host_stub); | 99 virtual void set_host_stub(HostStub* host_stub); |
99 virtual void set_input_stub(InputStub* input_stub); | 100 virtual void set_input_stub(InputStub* input_stub); |
100 | 101 |
| 102 // Sets video feedback stub. Can be called at any time after connection is |
| 103 // authenticated. |
| 104 virtual void set_video_feedback_stub(VideoFeedbackStub* video_feedback_stub); |
| 105 |
101 // Session::EventHandler interface. | 106 // Session::EventHandler interface. |
102 void OnSessionStateChange(Session::State state) override; | 107 void OnSessionStateChange(Session::State state) override; |
103 void OnSessionRouteChange(const std::string& channel_name, | 108 void OnSessionRouteChange(const std::string& channel_name, |
104 const TransportRoute& route) override; | 109 const TransportRoute& route) override; |
105 | 110 |
106 // ChannelDispatcherBase::EventHandler interface. | 111 // ChannelDispatcherBase::EventHandler interface. |
107 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override; | 112 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override; |
108 void OnChannelError(ChannelDispatcherBase* channel_dispatcher, | 113 void OnChannelError(ChannelDispatcherBase* channel_dispatcher, |
109 ErrorCode error) override; | 114 ErrorCode error) override; |
110 | 115 |
(...skipping 16 matching lines...) Expand all Loading... |
127 scoped_ptr<HostVideoDispatcher> video_dispatcher_; | 132 scoped_ptr<HostVideoDispatcher> video_dispatcher_; |
128 scoped_ptr<AudioWriter> audio_writer_; | 133 scoped_ptr<AudioWriter> audio_writer_; |
129 | 134 |
130 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 135 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
131 }; | 136 }; |
132 | 137 |
133 } // namespace protocol | 138 } // namespace protocol |
134 } // namespace remoting | 139 } // namespace remoting |
135 | 140 |
136 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 141 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
OLD | NEW |