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 // ChromotingClient is the controller for the Client implementation. | 5 // ChromotingClient is the controller for the Client implementation. |
6 | 6 |
7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 namespace remoting { | 30 namespace remoting { |
31 | 31 |
32 namespace protocol { | 32 namespace protocol { |
33 class CandidateSessionConfig; | 33 class CandidateSessionConfig; |
34 class SessionManager; | 34 class SessionManager; |
35 class TransportContext; | 35 class TransportContext; |
36 class VideoRenderer; | 36 class VideoRenderer; |
37 } // namespace protocol | 37 } // namespace protocol |
38 | 38 |
39 class AudioConsumer; | |
39 class AudioDecodeScheduler; | 40 class AudioDecodeScheduler; |
40 class AudioPlayer; | |
41 class ClientContext; | 41 class ClientContext; |
42 class ClientUserInterface; | 42 class ClientUserInterface; |
43 class FrameConsumerProxy; | 43 class FrameConsumerProxy; |
44 | 44 |
45 class ChromotingClient : public SignalStrategy::Listener, | 45 class ChromotingClient : public SignalStrategy::Listener, |
46 public protocol::ConnectionToHost::HostEventCallback, | 46 public protocol::ConnectionToHost::HostEventCallback, |
47 public protocol::ClientStub { | 47 public protocol::ClientStub { |
48 public: | 48 public: |
49 // |client_context|, |user_interface| and |video_renderer| must outlive the | 49 // |client_context|, |user_interface| and |video_renderer| must outlive the |
50 // client. |audio_player| may be null, in which case audio will not be | 50 // client. |audio_consumer| may be null, in which case audio will not be |
51 // requested. | 51 // requested. |
52 ChromotingClient(ClientContext* client_context, | 52 ChromotingClient(ClientContext* client_context, |
53 ClientUserInterface* user_interface, | 53 ClientUserInterface* user_interface, |
54 protocol::VideoRenderer* video_renderer, | 54 protocol::VideoRenderer* video_renderer, |
55 std::unique_ptr<AudioPlayer> audio_player); | 55 AudioConsumer* audio_consumer); |
Sergey Ulanov
2016/06/09 20:23:45
pass ownership of the consumer here?
nicholss
2016/06/09 20:57:08
It does not work for how I plan to use this for iO
| |
56 | 56 |
57 ~ChromotingClient() override; | 57 ~ChromotingClient() override; |
58 | 58 |
59 void set_protocol_config( | 59 void set_protocol_config( |
60 std::unique_ptr<protocol::CandidateSessionConfig> config); | 60 std::unique_ptr<protocol::CandidateSessionConfig> config); |
61 | 61 |
62 // Used to set fake/mock objects for tests which use the ChromotingClient. | 62 // Used to set fake/mock objects for tests which use the ChromotingClient. |
63 void SetConnectionToHostForTests( | 63 void SetConnectionToHostForTests( |
64 std::unique_ptr<protocol::ConnectionToHost> connection_to_host); | 64 std::unique_ptr<protocol::ConnectionToHost> connection_to_host); |
65 | 65 |
(...skipping 29 matching lines...) Expand all Loading... | |
95 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; | 95 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; |
96 | 96 |
97 // ConnectionToHost::HostEventCallback implementation. | 97 // ConnectionToHost::HostEventCallback implementation. |
98 void OnConnectionState(protocol::ConnectionToHost::State state, | 98 void OnConnectionState(protocol::ConnectionToHost::State state, |
99 protocol::ErrorCode error) override; | 99 protocol::ErrorCode error) override; |
100 void OnConnectionReady(bool ready) override; | 100 void OnConnectionReady(bool ready) override; |
101 void OnRouteChanged(const std::string& channel_name, | 101 void OnRouteChanged(const std::string& channel_name, |
102 const protocol::TransportRoute& route) override; | 102 const protocol::TransportRoute& route) override; |
103 | 103 |
104 private: | 104 private: |
105 // SignalStrategy::StatusObserver interface. | 105 // SignalStrategy::StatusObserver interface. |
106 void OnSignalStrategyStateChange(SignalStrategy::State state) override; | 106 void OnSignalStrategyStateChange(SignalStrategy::State state) override; |
107 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; | 107 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; |
108 | 108 |
109 // Starts connection once |signal_strategy_| is connected. | 109 // Starts connection once |signal_strategy_| is connected. |
110 void StartConnection(); | 110 void StartConnection(); |
111 | 111 |
112 // Called when the connection is authenticated. | 112 // Called when the connection is authenticated. |
113 void OnAuthenticated(); | 113 void OnAuthenticated(); |
114 | 114 |
115 // Called when all channels are connected. | 115 // Called when all channels are connected. |
(...skipping 29 matching lines...) Expand all Loading... | |
145 | 145 |
146 // Record the statistics of the connection. | 146 // Record the statistics of the connection. |
147 protocol::PerformanceTracker perf_tracker_; | 147 protocol::PerformanceTracker perf_tracker_; |
148 | 148 |
149 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 149 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace remoting | 152 } // namespace remoting |
153 | 153 |
154 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 154 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |