Chromium Code Reviews| Index: remoting/host/chromoting_host.cc |
| diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc |
| index 7a5516975427840fb005a8b61f49c9f18c128466..769d4b0315b1b4d69b3bb80ff7cb3c8eab12498a 100644 |
| --- a/remoting/host/chromoting_host.cc |
| +++ b/remoting/host/chromoting_host.cc |
| @@ -13,6 +13,8 @@ |
| #include "remoting/base/encoder.h" |
| #include "remoting/base/encoder_row_based.h" |
| #include "remoting/base/encoder_vp8.h" |
| +#include "remoting/codec/audio_encoder.h" |
| +#include "remoting/codec/audio_encoder_verbatim.h" |
| #include "remoting/host/audio_scheduler.h" |
| #include "remoting/host/chromoting_host_context.h" |
| #include "remoting/host/desktop_environment.h" |
| @@ -214,6 +216,9 @@ void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) { |
| // it should run on. |
| Encoder* encoder = CreateEncoder(client->connection()->session()->config()); |
| + scoped_ptr<AudioEncoder> audio_encoder = |
|
Sergey Ulanov
2012/07/31 22:22:17
Move this below, inside the if statement where you
kxing
2012/07/31 23:06:06
Done.
|
| + CreateAudioEncoder(client->connection()->session()->config()); |
| + |
| recorder_ = new ScreenRecorder(context_->capture_task_runner(), |
| context_->encode_task_runner(), |
| context_->network_task_runner(), |
| @@ -224,6 +229,7 @@ void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) { |
| context_->capture_task_runner(), |
| context_->network_task_runner(), |
| desktop_environment_->audio_capturer(), |
| + audio_encoder.Pass(), |
| client->connection()->audio_stub()); |
| } |
| @@ -417,6 +423,19 @@ Encoder* ChromotingHost::CreateEncoder(const protocol::SessionConfig& config) { |
| return NULL; |
| } |
| +// static |
| +scoped_ptr<AudioEncoder> ChromotingHost::CreateAudioEncoder( |
| + const protocol::SessionConfig& config) { |
| + const protocol::ChannelConfig& audio_config = config.audio_config(); |
| + |
| + if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) { |
| + return AudioEncoderVerbatim::CreateVerbatimAudioEncoder(); |
| + } |
| + |
| + NOTIMPLEMENTED(); |
| + return scoped_ptr<AudioEncoder>(NULL); |
| +} |
| + |
| void ChromotingHost::StopScreenRecorder() { |
| DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
| DCHECK(recorder_.get()); |