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 409 matching lines...) Loading... |
436 return NULL; | 437 return NULL; |
437 } | 438 } |
438 | 439 |
439 // static | 440 // static |
440 scoped_ptr<AudioEncoder> ChromotingHost::CreateAudioEncoder( | 441 scoped_ptr<AudioEncoder> ChromotingHost::CreateAudioEncoder( |
441 const protocol::SessionConfig& config) { | 442 const protocol::SessionConfig& config) { |
442 const protocol::ChannelConfig& audio_config = config.audio_config(); | 443 const protocol::ChannelConfig& audio_config = config.audio_config(); |
443 | 444 |
444 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { | 445 if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
445 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 446 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
| 447 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_SPEEX) { |
| 448 return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex()); |
446 } | 449 } |
447 | 450 |
448 NOTIMPLEMENTED(); | 451 NOTIMPLEMENTED(); |
449 return scoped_ptr<AudioEncoder>(NULL); | 452 return scoped_ptr<AudioEncoder>(NULL); |
450 } | 453 } |
451 | 454 |
452 void ChromotingHost::StopScreenRecorder() { | 455 void ChromotingHost::StopScreenRecorder() { |
453 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 456 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
454 DCHECK(recorder_.get()); | 457 DCHECK(recorder_.get()); |
455 | 458 |
(...skipping 42 matching lines...) Loading... |
498 OnShutdown()); | 501 OnShutdown()); |
499 | 502 |
500 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); | 503 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); |
501 it != shutdown_tasks_.end(); ++it) { | 504 it != shutdown_tasks_.end(); ++it) { |
502 it->Run(); | 505 it->Run(); |
503 } | 506 } |
504 shutdown_tasks_.clear(); | 507 shutdown_tasks_.clear(); |
505 } | 508 } |
506 | 509 |
507 } // namespace remoting | 510 } // namespace remoting |
OLD | NEW |