OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/rtp_video_reader.h" | 5 #include "remoting/protocol/rtp_video_reader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/proto/video.pb.h" | 10 #include "remoting/proto/video.pb.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 session_->CreateDatagramChannel( | 49 session_->CreateDatagramChannel( |
50 kVideoRtpChannelName, | 50 kVideoRtpChannelName, |
51 base::Bind(&RtpVideoReader::OnChannelReady, | 51 base::Bind(&RtpVideoReader::OnChannelReady, |
52 base::Unretained(this), true)); | 52 base::Unretained(this), true)); |
53 session_->CreateDatagramChannel( | 53 session_->CreateDatagramChannel( |
54 kVideoRtcpChannelName, | 54 kVideoRtcpChannelName, |
55 base::Bind(&RtpVideoReader::OnChannelReady, | 55 base::Bind(&RtpVideoReader::OnChannelReady, |
56 base::Unretained(this), false)); | 56 base::Unretained(this), false)); |
57 } | 57 } |
58 | 58 |
| 59 bool RtpVideoReader::is_connected() { |
| 60 return rtp_channel_.get() && rtcp_channel_.get(); |
| 61 } |
| 62 |
59 void RtpVideoReader::OnChannelReady(bool rtp, net::Socket* socket) { | 63 void RtpVideoReader::OnChannelReady(bool rtp, net::Socket* socket) { |
60 if (!socket) { | 64 if (!socket) { |
61 if (!initialized_) { | 65 if (!initialized_) { |
62 initialized_ = true; | 66 initialized_ = true; |
63 initialized_callback_.Run(false); | 67 initialized_callback_.Run(false); |
64 } | 68 } |
65 return; | 69 return; |
66 } | 70 } |
67 | 71 |
68 if (rtp) { | 72 if (rtp) { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 RtcpReceiverReport report; | 232 RtcpReceiverReport report; |
229 rtp_reader_.GetReceiverReport(&report); | 233 rtp_reader_.GetReceiverReport(&report); |
230 rtcp_writer_.SendReport(report); | 234 rtcp_writer_.SendReport(report); |
231 | 235 |
232 last_receiver_report_ = now; | 236 last_receiver_report_ = now; |
233 } | 237 } |
234 } | 238 } |
235 | 239 |
236 } // namespace protocol | 240 } // namespace protocol |
237 } // namespace remoting | 241 } // namespace remoting |
OLD | NEW |