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

Unified Diff: remoting/protocol/rtp_video_writer.cc

Issue 7605018: Simplify channel creation callbacks in remoting::Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/protocol/rtp_video_writer.cc
diff --git a/remoting/protocol/rtp_video_writer.cc b/remoting/protocol/rtp_video_writer.cc
index 2a0f950e95b19165d5d216acee8ace843a64270e..54b3ff0f366896e8520179f8d76aa1757fa4aff8 100644
--- a/remoting/protocol/rtp_video_writer.cc
+++ b/remoting/protocol/rtp_video_writer.cc
@@ -33,14 +33,15 @@ void RtpVideoWriter::Init(protocol::Session* session,
initialized_callback_ = callback;
session->CreateDatagramChannel(
kVideoRtpChannelName,
- base::Bind(&RtpVideoWriter::OnChannelReady, base::Unretained(this)));
+ base::Bind(&RtpVideoWriter::OnChannelReady,
+ base::Unretained(this), true));
session->CreateDatagramChannel(
kVideoRtcpChannelName,
- base::Bind(&RtpVideoWriter::OnChannelReady, base::Unretained(this)));
+ base::Bind(&RtpVideoWriter::OnChannelReady,
+ base::Unretained(this), false));
}
-void RtpVideoWriter::OnChannelReady(const std::string& name,
- net::Socket* socket) {
+void RtpVideoWriter::OnChannelReady(bool rtp, net::Socket* socket) {
if (!socket) {
if (!initialized_) {
initialized_ = true;
@@ -49,11 +50,11 @@ void RtpVideoWriter::OnChannelReady(const std::string& name,
return;
}
- if (name == kVideoRtpChannelName) {
+ if (rtp) {
DCHECK(!rtp_channel_.get());
rtp_channel_.reset(socket);
rtp_writer_.Init(socket);
- } else if (name == kVideoRtcpChannelName) {
+ } else {
DCHECK(!rtcp_channel_.get());
rtcp_channel_.reset(socket);
// TODO(sergeyu): Use RTCP channel somehow.

Powered by Google App Engine
This is Rietveld 408576698