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" |
11 #include "remoting/protocol/session.h" | 11 #include "remoting/protocol/session.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 namespace protocol { | 14 namespace protocol { |
15 | 15 |
16 namespace { | 16 namespace { |
17 const int kMaxPacketsInQueue = 1024; | 17 const int kMaxPacketsInQueue = 1024; |
18 const int kReceiverReportsIntervalMs = 1000; | 18 const int kReceiverReportsIntervalMs = 1000; |
19 } // namespace | 19 } // namespace |
20 | 20 |
21 RtpVideoReader::PacketsQueueEntry::PacketsQueueEntry() | 21 RtpVideoReader::PacketsQueueEntry::PacketsQueueEntry() |
22 : received(false), | 22 : received(false), |
23 packet(NULL) { | 23 packet(NULL) { |
24 } | 24 } |
25 | 25 |
26 RtpVideoReader::RtpVideoReader() | 26 RtpVideoReader::RtpVideoReader(base::MessageLoopProxy* message_loop) |
27 : initialized_(false), | 27 : initialized_(false), |
| 28 rtcp_writer_(message_loop), |
28 last_sequence_number_(0), | 29 last_sequence_number_(0), |
29 video_stub_(NULL) { | 30 video_stub_(NULL) { |
30 } | 31 } |
31 | 32 |
32 RtpVideoReader::~RtpVideoReader() { | 33 RtpVideoReader::~RtpVideoReader() { |
33 ResetQueue(); | 34 ResetQueue(); |
34 } | 35 } |
35 | 36 |
36 void RtpVideoReader::Init(protocol::Session* session, | 37 void RtpVideoReader::Init(protocol::Session* session, |
37 VideoStub* video_stub, | 38 VideoStub* video_stub, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 RtcpReceiverReport report; | 220 RtcpReceiverReport report; |
220 rtp_reader_.GetReceiverReport(&report); | 221 rtp_reader_.GetReceiverReport(&report); |
221 rtcp_writer_.SendReport(report); | 222 rtcp_writer_.SendReport(report); |
222 | 223 |
223 last_receiver_report_ = now; | 224 last_receiver_report_ = now; |
224 } | 225 } |
225 } | 226 } |
226 | 227 |
227 } // namespace protocol | 228 } // namespace protocol |
228 } // namespace remoting | 229 } // namespace remoting |
OLD | NEW |