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

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: Fixed some style issues 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..bdac6d9cfa4cd1bc705d413273073c9847b8f713 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -9,6 +9,8 @@
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "build/build_config.h"
+#include "remoting/base/audio_encoder.h"
+#include "remoting/base/audio_encoder_verbatim.h"
#include "remoting/base/constants.h"
#include "remoting/base/encoder.h"
#include "remoting/base/encoder_row_based.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 =
+ 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