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

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 header guards 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
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 7a5516975427840fb005a8b61f49c9f18c128466..4e84aaaecad94fa637046477ba3cd9b2a38ad6a2 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"
@@ -220,10 +222,13 @@ void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) {
desktop_environment_->capturer(),
encoder);
if (client->connection()->session()->config().is_audio_enabled()) {
+ scoped_ptr<AudioEncoder> audio_encoder =
+ CreateAudioEncoder(client->connection()->session()->config());
audio_scheduler_ = new AudioScheduler(
context_->capture_task_runner(),
context_->network_task_runner(),
desktop_environment_->audio_capturer(),
+ audio_encoder.Pass(),
client->connection()->audio_stub());
}
@@ -417,6 +422,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 scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim());
+ }
+
+ NOTIMPLEMENTED();
Wez 2012/08/07 18:07:41 nit: NOTIMPLEMENTED() is for methods that aren't i
+ return scoped_ptr<AudioEncoder>(NULL);
+}
+
void ChromotingHost::StopScreenRecorder() {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
DCHECK(recorder_.get());
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698