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

Unified Diff: remoting/protocol/rtp_video_reader.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
« no previous file with comments | « remoting/protocol/rtp_video_reader.h ('k') | remoting/protocol/rtp_video_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/rtp_video_reader.cc
diff --git a/remoting/protocol/rtp_video_reader.cc b/remoting/protocol/rtp_video_reader.cc
index 9b979610808f65e158e875749a46f48f4447825b..19bf2fbdc9f239865499b184c5dddd0385b12dea 100644
--- a/remoting/protocol/rtp_video_reader.cc
+++ b/remoting/protocol/rtp_video_reader.cc
@@ -41,14 +41,15 @@ void RtpVideoReader::Init(protocol::Session* session,
session->CreateDatagramChannel(
kVideoRtpChannelName,
- base::Bind(&RtpVideoReader::OnChannelReady, base::Unretained(this)));
+ base::Bind(&RtpVideoReader::OnChannelReady,
+ base::Unretained(this), true));
session->CreateDatagramChannel(
kVideoRtcpChannelName,
- base::Bind(&RtpVideoReader::OnChannelReady, base::Unretained(this)));
+ base::Bind(&RtpVideoReader::OnChannelReady,
+ base::Unretained(this), false));
}
-void RtpVideoReader::OnChannelReady(const std::string& name,
- net::Socket* socket) {
+void RtpVideoReader::OnChannelReady(bool rtp, net::Socket* socket) {
Wez 2011/08/09 23:42:35 Why have an |rtp| bool here, rather than the conta
Sergey Ulanov 2011/08/10 00:00:43 because we also need to initialized |rtp_reader_|
Wez 2011/08/10 00:37:13 Yes, but that could be managed with: if (socket
if (!socket) {
if (!initialized_) {
initialized_ = true;
@@ -57,16 +58,14 @@ void RtpVideoReader::OnChannelReady(const std::string& name,
return;
}
- if (name == kVideoRtpChannelName) {
+ if (rtp) {
DCHECK(!rtp_channel_.get());
rtp_channel_.reset(socket);
rtp_reader_.Init(socket, NewCallback(this, &RtpVideoReader::OnRtpPacket));
- } else if (name == kVideoRtcpChannelName) {
+ } else {
DCHECK(!rtcp_channel_.get());
rtcp_channel_.reset(socket);
rtcp_writer_.Init(socket);
- } else {
- NOTREACHED();
}
if (rtp_channel_.get() && rtcp_channel_.get()) {
« no previous file with comments | « remoting/protocol/rtp_video_reader.h ('k') | remoting/protocol/rtp_video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698