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

Unified Diff: remoting/protocol/connection_to_client.cc

Issue 10532211: Added piping for sending audio packets from host to client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unittests Created 8 years, 6 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/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_client.cc
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index 03ee1fec34bf4da5915c2a05a5a0451352f64e6e..3441f4991231082dbffa492b8afaf092d34e2172 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -68,6 +68,11 @@ VideoStub* ConnectionToClient::video_stub() {
return video_writer_.get();
}
+AudioStub* ConnectionToClient::audio_stub() {
+ DCHECK(CalledOnValidThread());
+ return audio_writer_.get();
+}
+
// Return pointer to ClientStub.
ClientStub* ConnectionToClient::client_stub() {
DCHECK(CalledOnValidThread());
@@ -120,6 +125,12 @@ void ConnectionToClient::OnSessionStateChange(Session::State state) {
video_writer_->Init(session_.get(), base::Bind(
&ConnectionToClient::OnChannelInitialized, base::Unretained(this)));
+ audio_writer_ = AudioWriter::Create(session_->config());
+ if (audio_writer_.get()) {
+ audio_writer_->Init(session_.get(), base::Bind(
+ &ConnectionToClient::OnChannelInitialized, base::Unretained(this)));
+ }
+
// Notify the handler after initializing the channels, so that
// ClientSession can get a client clipboard stub.
handler_->OnConnectionAuthenticated(this);
@@ -156,11 +167,17 @@ void ConnectionToClient::OnChannelInitialized(bool successful) {
void ConnectionToClient::NotifyIfChannelsReady() {
DCHECK(CalledOnValidThread());
- if (control_dispatcher_.get() && control_dispatcher_->is_connected() &&
- event_dispatcher_.get() && event_dispatcher_->is_connected() &&
- video_writer_.get() && video_writer_->is_connected()) {
- handler_->OnConnectionChannelsConnected(this);
+ if (!control_dispatcher_.get() || !control_dispatcher_->is_connected())
+ return;
+ if (!event_dispatcher_.get() || !event_dispatcher_->is_connected())
+ return;
+ if (!video_writer_.get() || !video_writer_->is_connected())
+ return;
+ if ((!audio_writer_.get() || !audio_writer_->is_connected()) &&
+ session_->config().is_audio_enabled()) {
+ return;
}
+ handler_->OnConnectionChannelsConnected(this);
}
void ConnectionToClient::Close(ErrorCode error) {
@@ -172,6 +189,7 @@ void ConnectionToClient::CloseChannels() {
control_dispatcher_.reset();
event_dispatcher_.reset();
video_writer_.reset();
+ audio_writer_.reset();
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698