| 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_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "remoting/codec/audio_encoder.h" | 10 #include "remoting/codec/audio_encoder.h" |
| 11 #include "remoting/codec/audio_encoder_opus.h" |
| 11 #include "remoting/codec/audio_encoder_speex.h" | 12 #include "remoting/codec/audio_encoder_speex.h" |
| 12 #include "remoting/codec/audio_encoder_verbatim.h" | 13 #include "remoting/codec/audio_encoder_verbatim.h" |
| 13 #include "remoting/codec/video_encoder.h" | 14 #include "remoting/codec/video_encoder.h" |
| 14 #include "remoting/codec/video_encoder_verbatim.h" | 15 #include "remoting/codec/video_encoder_verbatim.h" |
| 15 #include "remoting/codec/video_encoder_vp8.h" | 16 #include "remoting/codec/video_encoder_vp8.h" |
| 16 #include "remoting/host/audio_scheduler.h" | 17 #include "remoting/host/audio_scheduler.h" |
| 17 #include "remoting/host/desktop_environment.h" | 18 #include "remoting/host/desktop_environment.h" |
| 18 #include "remoting/host/desktop_environment_factory.h" | 19 #include "remoting/host/desktop_environment_factory.h" |
| 19 #include "remoting/host/event_executor.h" | 20 #include "remoting/host/event_executor.h" |
| 20 #include "remoting/host/screen_recorder.h" | 21 #include "remoting/host/screen_recorder.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 297 |
| 297 // static | 298 // static |
| 298 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( | 299 scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder( |
| 299 const protocol::SessionConfig& config) { | 300 const protocol::SessionConfig& config) { |
| 300 const protocol::ChannelConfig& audio_config = config.audio_config(); | 301 const protocol::ChannelConfig& audio_config = config.audio_config(); |
| 301 | 302 |
| 302 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 303 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
| 303 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 304 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
| 304 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_SPEEX) { | 305 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_SPEEX) { |
| 305 return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex()); | 306 return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex()); |
| 307 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
| 308 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
| 306 } | 309 } |
| 307 | 310 |
| 308 NOTIMPLEMENTED(); | 311 NOTIMPLEMENTED(); |
| 309 return scoped_ptr<AudioEncoder>(NULL); | 312 return scoped_ptr<AudioEncoder>(NULL); |
| 310 } | 313 } |
| 311 | 314 |
| 312 // static | 315 // static |
| 313 void ClientSessionTraits::Destruct(const ClientSession* client) { | 316 void ClientSessionTraits::Destruct(const ClientSession* client) { |
| 314 client->network_task_runner_->DeleteSoon(FROM_HERE, client); | 317 client->network_task_runner_->DeleteSoon(FROM_HERE, client); |
| 315 } | 318 } |
| 316 | 319 |
| 317 } // namespace remoting | 320 } // namespace remoting |
| OLD | NEW |