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

Side by Side Diff: remoting/protocol/rtp_video_reader.cc

Issue 6277003: Simplified MessageReader and MessageDecoder classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/rtp_video_reader.h ('k') | remoting/protocol/socket_reader_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/protocol/rtp_video_reader.h ('k') | remoting/protocol/socket_reader_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698