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> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Returns the connection in use. | 75 // Returns the connection in use. |
76 virtual Session* session(); | 76 virtual Session* session(); |
77 | 77 |
78 // Disconnect the client connection. | 78 // Disconnect the client connection. |
79 virtual void Disconnect(); | 79 virtual void Disconnect(); |
80 | 80 |
81 // Update the sequence number when received from the client. EventHandler | 81 // Update the sequence number when received from the client. EventHandler |
82 // will be called. | 82 // will be called. |
83 virtual void UpdateSequenceNumber(int64 sequence_number); | 83 virtual void UpdateSequenceNumber(int64 sequence_number); |
84 | 84 |
85 // Send encoded update stream data to the viewer. | 85 // Get the stubs used by the host to transmit messages to the client. |
| 86 // Note that the audio stub will be NULL if audio is not enabled. |
86 virtual VideoStub* video_stub(); | 87 virtual VideoStub* video_stub(); |
87 | |
88 // Send audio stream data to the viewer. | |
89 // Returns NULL if audio is not enabled. | |
90 virtual AudioStub* audio_stub(); | 88 virtual AudioStub* audio_stub(); |
91 | |
92 // Send control data to the viewer/client. | |
93 virtual ClientStub* client_stub(); | 89 virtual ClientStub* client_stub(); |
94 | 90 |
95 // Stubs for receiving data from the client. | 91 // Set/get the stubs which will handle messages we receive from the client. |
96 // These three setters should be called before Init(). | 92 // All stubs MUST be set before the session's channels become connected. |
97 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); | 93 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); |
| 94 virtual ClipboardStub* clipboard_stub(); |
98 virtual void set_host_stub(HostStub* host_stub); | 95 virtual void set_host_stub(HostStub* host_stub); |
| 96 virtual HostStub* host_stub(); |
99 virtual void set_input_stub(InputStub* input_stub); | 97 virtual void set_input_stub(InputStub* input_stub); |
| 98 virtual InputStub* input_stub(); |
100 | 99 |
101 // Session::EventHandler interface. | 100 // Session::EventHandler interface. |
102 virtual void OnSessionStateChange(Session::State state) OVERRIDE; | 101 virtual void OnSessionStateChange(Session::State state) OVERRIDE; |
103 virtual void OnSessionRouteChange(const std::string& channel_name, | 102 virtual void OnSessionRouteChange(const std::string& channel_name, |
104 const TransportRoute& route) OVERRIDE; | 103 const TransportRoute& route) OVERRIDE; |
105 | 104 |
106 private: | 105 private: |
107 // Callback for channel initialization. | 106 // Callback for channel initialization. |
108 void OnChannelInitialized(bool successful); | 107 void OnChannelInitialized(bool successful); |
109 | 108 |
(...skipping 20 matching lines...) Expand all Loading... |
130 scoped_ptr<VideoWriter> video_writer_; | 129 scoped_ptr<VideoWriter> video_writer_; |
131 scoped_ptr<AudioWriter> audio_writer_; | 130 scoped_ptr<AudioWriter> audio_writer_; |
132 | 131 |
133 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 132 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
134 }; | 133 }; |
135 | 134 |
136 } // namespace protocol | 135 } // namespace protocol |
137 } // namespace remoting | 136 } // namespace remoting |
138 | 137 |
139 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 138 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
OLD | NEW |