Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: remoting/host/chromoting_host.cc

Issue 10836017: Piping for audio encoding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorganized code Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698