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/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
| 11 #include "remoting/base/logging.h" |
11 #include "remoting/codec/audio_encoder.h" | 12 #include "remoting/codec/audio_encoder.h" |
12 #include "remoting/codec/audio_encoder_opus.h" | 13 #include "remoting/codec/audio_encoder_opus.h" |
13 #include "remoting/codec/audio_encoder_verbatim.h" | 14 #include "remoting/codec/audio_encoder_verbatim.h" |
14 #include "remoting/codec/video_encoder.h" | 15 #include "remoting/codec/video_encoder.h" |
15 #include "remoting/codec/video_encoder_verbatim.h" | 16 #include "remoting/codec/video_encoder_verbatim.h" |
16 #include "remoting/codec/video_encoder_vpx.h" | 17 #include "remoting/codec/video_encoder_vpx.h" |
17 #include "remoting/host/audio_capturer.h" | 18 #include "remoting/host/audio_capturer.h" |
18 #include "remoting/host/audio_scheduler.h" | 19 #include "remoting/host/audio_scheduler.h" |
19 #include "remoting/host/desktop_environment.h" | 20 #include "remoting/host/desktop_environment.h" |
20 #include "remoting/host/input_injector.h" | 21 #include "remoting/host/input_injector.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (message.type() == "test-echo") { | 193 if (message.type() == "test-echo") { |
193 protocol::ExtensionMessage reply; | 194 protocol::ExtensionMessage reply; |
194 reply.set_type("test-echo-reply"); | 195 reply.set_type("test-echo-reply"); |
195 if (message.has_data()) | 196 if (message.has_data()) |
196 reply.set_data(message.data().substr(0, 16)); | 197 reply.set_data(message.data().substr(0, 16)); |
197 connection_->client_stub()->DeliverHostMessage(reply); | 198 connection_->client_stub()->DeliverHostMessage(reply); |
198 return; | 199 return; |
199 } | 200 } |
200 } | 201 } |
201 // No messages are currently supported. | 202 // No messages are currently supported. |
202 LOG(INFO) << "Unexpected message received: " | 203 LOG_INFO << "Unexpected message received: " |
203 << message.type() << ": " << message.data(); | 204 << message.type() << ": " << message.data(); |
204 } | 205 } |
205 | 206 |
206 void ClientSession::OnConnectionAuthenticated( | 207 void ClientSession::OnConnectionAuthenticated( |
207 protocol::ConnectionToClient* connection) { | 208 protocol::ConnectionToClient* connection) { |
208 DCHECK(CalledOnValidThread()); | 209 DCHECK(CalledOnValidThread()); |
209 DCHECK_EQ(connection_.get(), connection); | 210 DCHECK_EQ(connection_.get(), connection); |
210 DCHECK(!audio_scheduler_.get()); | 211 DCHECK(!audio_scheduler_.get()); |
211 DCHECK(!desktop_environment_); | 212 DCHECK(!desktop_environment_); |
212 DCHECK(!input_injector_); | 213 DCHECK(!input_injector_); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 444 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
444 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 445 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
445 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 446 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
446 } | 447 } |
447 | 448 |
448 NOTREACHED(); | 449 NOTREACHED(); |
449 return scoped_ptr<AudioEncoder>(); | 450 return scoped_ptr<AudioEncoder>(); |
450 } | 451 } |
451 | 452 |
452 } // namespace remoting | 453 } // namespace remoting |
OLD | NEW |