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 #include "remoting/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "remoting/base/capabilities.h" | 8 #include "remoting/base/capabilities.h" |
9 #include "remoting/client/audio_decode_scheduler.h" | 9 #include "remoting/client/audio_decode_scheduler.h" |
10 #include "remoting/client/audio_player.h" | 10 #include "remoting/client/audio_player.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 void ChromotingClient::OnAuthenticated() { | 146 void ChromotingClient::OnAuthenticated() { |
147 DCHECK(task_runner_->BelongsToCurrentThread()); | 147 DCHECK(task_runner_->BelongsToCurrentThread()); |
148 | 148 |
149 // Initialize the decoder. | 149 // Initialize the decoder. |
150 video_renderer_->Initialize(connection_.config()); | 150 video_renderer_->Initialize(connection_.config()); |
151 if (connection_.config().is_audio_enabled()) | 151 if (connection_.config().is_audio_enabled()) |
152 audio_decode_scheduler_->Initialize(connection_.config()); | 152 audio_decode_scheduler_->Initialize(connection_.config()); |
153 | 153 |
154 // Do not negotiate capabilities with the host if the host does not support | |
155 // them. | |
156 if (!connection_.config().SupportsCapabilities()) { | |
157 VLOG(1) << "The host does not support any capabilities."; | |
158 | |
159 host_capabilities_received_ = true; | |
160 user_interface_->SetCapabilities(host_capabilities_); | |
161 } | |
162 } | 154 } |
163 | 155 |
164 void ChromotingClient::OnChannelsConnected() { | 156 void ChromotingClient::OnChannelsConnected() { |
165 DCHECK(task_runner_->BelongsToCurrentThread()); | 157 DCHECK(task_runner_->BelongsToCurrentThread()); |
166 | 158 |
167 // Negotiate capabilities with the host. | 159 // Negotiate capabilities with the host. |
168 if (connection_.config().SupportsCapabilities()) { | 160 VLOG(1) << "Client capabilities: " << local_capabilities_; |
169 VLOG(1) << "Client capabilities: " << local_capabilities_; | |
170 | 161 |
171 protocol::Capabilities capabilities; | 162 protocol::Capabilities capabilities; |
172 capabilities.set_capabilities(local_capabilities_); | 163 capabilities.set_capabilities(local_capabilities_); |
173 connection_.host_stub()->SetCapabilities(capabilities); | 164 connection_.host_stub()->SetCapabilities(capabilities); |
174 } | |
175 } | 165 } |
176 | 166 |
177 } // namespace remoting | 167 } // namespace remoting |
OLD | NEW |