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/chromoting_host.h" | 5 #include "remoting/host/chromoting_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "remoting/base/constants.h" | 12 #include "remoting/base/constants.h" |
13 #include "remoting/base/encoder.h" | 13 #include "remoting/base/encoder.h" |
14 #include "remoting/base/encoder_row_based.h" | 14 #include "remoting/base/encoder_row_based.h" |
15 #include "remoting/base/encoder_vp8.h" | 15 #include "remoting/base/encoder_vp8.h" |
16 #include "remoting/codec/audio_encoder.h" | 16 #include "remoting/codec/audio_encoder.h" |
| 17 #include "remoting/codec/audio_encoder_speex.h" |
17 #include "remoting/codec/audio_encoder_verbatim.h" | 18 #include "remoting/codec/audio_encoder_verbatim.h" |
18 #include "remoting/host/audio_scheduler.h" | 19 #include "remoting/host/audio_scheduler.h" |
19 #include "remoting/host/chromoting_host_context.h" | 20 #include "remoting/host/chromoting_host_context.h" |
20 #include "remoting/host/desktop_environment.h" | 21 #include "remoting/host/desktop_environment.h" |
21 #include "remoting/host/event_executor.h" | 22 #include "remoting/host/event_executor.h" |
22 #include "remoting/host/host_config.h" | 23 #include "remoting/host/host_config.h" |
23 #include "remoting/host/screen_recorder.h" | 24 #include "remoting/host/screen_recorder.h" |
24 #include "remoting/protocol/connection_to_client.h" | 25 #include "remoting/protocol/connection_to_client.h" |
25 #include "remoting/protocol/client_stub.h" | 26 #include "remoting/protocol/client_stub.h" |
26 #include "remoting/protocol/host_stub.h" | 27 #include "remoting/protocol/host_stub.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 return NULL; | 427 return NULL; |
427 } | 428 } |
428 | 429 |
429 // static | 430 // static |
430 scoped_ptr<AudioEncoder> ChromotingHost::CreateAudioEncoder( | 431 scoped_ptr<AudioEncoder> ChromotingHost::CreateAudioEncoder( |
431 const protocol::SessionConfig& config) { | 432 const protocol::SessionConfig& config) { |
432 const protocol::ChannelConfig& audio_config = config.audio_config(); | 433 const protocol::ChannelConfig& audio_config = config.audio_config(); |
433 | 434 |
434 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 435 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
435 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 436 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
| 437 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_SPEEX) { |
| 438 return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex()); |
436 } | 439 } |
437 | 440 |
438 NOTIMPLEMENTED(); | 441 NOTIMPLEMENTED(); |
439 return scoped_ptr<AudioEncoder>(NULL); | 442 return scoped_ptr<AudioEncoder>(NULL); |
440 } | 443 } |
441 | 444 |
442 void ChromotingHost::StopScreenRecorder() { | 445 void ChromotingHost::StopScreenRecorder() { |
443 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 446 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
444 DCHECK(recorder_.get()); | 447 DCHECK(recorder_.get()); |
445 | 448 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 OnShutdown()); | 491 OnShutdown()); |
489 | 492 |
490 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); | 493 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); |
491 it != shutdown_tasks_.end(); ++it) { | 494 it != shutdown_tasks_.end(); ++it) { |
492 it->Run(); | 495 it->Run(); |
493 } | 496 } |
494 shutdown_tasks_.clear(); | 497 shutdown_tasks_.clear(); |
495 } | 498 } |
496 | 499 |
497 } // namespace remoting | 500 } // namespace remoting |
OLD | NEW |