OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/task.h" | 7 #include "base/task.h" |
8 #include "remoting/proto/video.pb.h" | 8 #include "remoting/proto/video.pb.h" |
9 #include "remoting/protocol/session.h" | 9 #include "remoting/protocol/session.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 ResetQueue(); | 29 ResetQueue(); |
30 } | 30 } |
31 | 31 |
32 void RtpVideoReader::Init(protocol::Session* session, VideoStub* video_stub) { | 32 void RtpVideoReader::Init(protocol::Session* session, VideoStub* video_stub) { |
33 rtp_reader_.Init(session->video_rtp_channel(), | 33 rtp_reader_.Init(session->video_rtp_channel(), |
34 NewCallback(this, &RtpVideoReader::OnRtpPacket)); | 34 NewCallback(this, &RtpVideoReader::OnRtpPacket)); |
35 rtcp_writer_.Init(session->video_rtcp_channel()); | 35 rtcp_writer_.Init(session->video_rtcp_channel()); |
36 video_stub_ = video_stub; | 36 video_stub_ = video_stub; |
37 } | 37 } |
38 | 38 |
39 void RtpVideoReader::Close() { | |
40 rtp_reader_.Close(); | |
41 } | |
42 | |
43 void RtpVideoReader::ResetQueue() { | 39 void RtpVideoReader::ResetQueue() { |
44 for (PacketsQueue::iterator it = packets_queue_.begin(); | 40 for (PacketsQueue::iterator it = packets_queue_.begin(); |
45 it != packets_queue_.end(); ++it) { | 41 it != packets_queue_.end(); ++it) { |
46 delete it->packet; | 42 delete it->packet; |
47 } | 43 } |
48 packets_queue_.assign(kMaxPacketsInQueue, PacketsQueueEntry()); | 44 packets_queue_.assign(kMaxPacketsInQueue, PacketsQueueEntry()); |
49 } | 45 } |
50 | 46 |
51 void RtpVideoReader::OnRtpPacket(const RtpPacket* rtp_packet) { | 47 void RtpVideoReader::OnRtpPacket(const RtpPacket* rtp_packet) { |
52 uint32 sequence_number = rtp_packet->extended_sequence_number(); | 48 uint32 sequence_number = rtp_packet->extended_sequence_number(); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 RtcpReceiverReport report; | 180 RtcpReceiverReport report; |
185 rtp_reader_.GetReceiverReport(&report); | 181 rtp_reader_.GetReceiverReport(&report); |
186 rtcp_writer_.SendReport(report); | 182 rtcp_writer_.SendReport(report); |
187 | 183 |
188 last_receiver_report_ = now; | 184 last_receiver_report_ = now; |
189 } | 185 } |
190 } | 186 } |
191 | 187 |
192 } // namespace protocol | 188 } // namespace protocol |
193 } // namespace remoting | 189 } // namespace remoting |
OLD | NEW |