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_writer.h" | 5 #include "remoting/protocol/rtp_video_writer.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 "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
10 #include "remoting/base/compound_buffer.h" | 10 #include "remoting/base/compound_buffer.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 rtp_writer_.Close(); | 74 rtp_writer_.Close(); |
75 rtp_channel_.reset(); | 75 rtp_channel_.reset(); |
76 rtcp_channel_.reset(); | 76 rtcp_channel_.reset(); |
77 if (session_) { | 77 if (session_) { |
78 session_->CancelChannelCreation(kVideoRtpChannelName); | 78 session_->CancelChannelCreation(kVideoRtpChannelName); |
79 session_->CancelChannelCreation(kVideoRtcpChannelName); | 79 session_->CancelChannelCreation(kVideoRtcpChannelName); |
80 session_ = NULL; | 80 session_ = NULL; |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
| 84 bool RtpVideoWriter::is_connected() { |
| 85 return rtp_channel_.get() && rtcp_channel_.get(); |
| 86 } |
| 87 |
84 void RtpVideoWriter::ProcessVideoPacket(const VideoPacket* packet, | 88 void RtpVideoWriter::ProcessVideoPacket(const VideoPacket* packet, |
85 const base::Closure& done) { | 89 const base::Closure& done) { |
86 CHECK(packet->format().encoding() == VideoPacketFormat::ENCODING_VP8) | 90 CHECK(packet->format().encoding() == VideoPacketFormat::ENCODING_VP8) |
87 << "Only VP8 is supported in RTP."; | 91 << "Only VP8 is supported in RTP."; |
88 | 92 |
89 CompoundBuffer payload; | 93 CompoundBuffer payload; |
90 // TODO(sergeyu): This copy would not be necessary CompoundBuffer was used | 94 // TODO(sergeyu): This copy would not be necessary CompoundBuffer was used |
91 // inside of VideoPacket. | 95 // inside of VideoPacket. |
92 payload.AppendCopyOf(packet->data().data(), packet->data().size()); | 96 payload.AppendCopyOf(packet->data().data(), packet->data().size()); |
93 | 97 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 142 |
139 done.Run(); | 143 done.Run(); |
140 } | 144 } |
141 | 145 |
142 int RtpVideoWriter::GetPendingPackets() { | 146 int RtpVideoWriter::GetPendingPackets() { |
143 return rtp_writer_.GetPendingPackets(); | 147 return rtp_writer_.GetPendingPackets(); |
144 } | 148 } |
145 | 149 |
146 } // namespace protocol | 150 } // namespace protocol |
147 } // namespace remoting | 151 } // namespace remoting |
OLD | NEW |