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

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

Issue 7633009: Use MessageLoopProxy for network message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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_writer.h ('k') | remoting/protocol/video_reader.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_writer.h" 5 #include "remoting/protocol/rtp_writer.h"
6 6
7 #include "net/base/io_buffer.h" 7 #include "net/base/io_buffer.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "remoting/base/compound_buffer.h" 9 #include "remoting/base/compound_buffer.h"
10 #include "remoting/protocol/rtp_utils.h" 10 #include "remoting/protocol/rtp_utils.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 namespace protocol { 13 namespace protocol {
14 14
15 namespace { 15 namespace {
16 const uint8 kRtpPayloadTypePrivate = 96; 16 const uint8 kRtpPayloadTypePrivate = 96;
17 } // namespace 17 } // namespace
18 18
19 RtpWriter::RtpWriter() 19 RtpWriter::RtpWriter(base::MessageLoopProxy* message_loop)
20 : last_packet_number_(0) { 20 : last_packet_number_(0),
21 buffered_rtp_writer_(new BufferedDatagramWriter(message_loop)) {
21 } 22 }
22 23
23 RtpWriter::~RtpWriter() { } 24 RtpWriter::~RtpWriter() { }
24 25
25 // Initializes the writer. Must be called on the thread the sockets belong 26 // Initializes the writer. Must be called on the thread the sockets belong
26 // to. 27 // to.
27 void RtpWriter::Init(net::Socket* rtp_socket) { 28 void RtpWriter::Init(net::Socket* rtp_socket) {
28 buffered_rtp_writer_ = new BufferedDatagramWriter();
29 buffered_rtp_writer_->Init(rtp_socket, NULL); 29 buffered_rtp_writer_->Init(rtp_socket, NULL);
30 } 30 }
31 31
32 void RtpWriter::Close() { 32 void RtpWriter::Close() {
33 buffered_rtp_writer_->Close(); 33 buffered_rtp_writer_->Close();
34 } 34 }
35 35
36 void RtpWriter::SendPacket(uint32 timestamp, bool marker, 36 void RtpWriter::SendPacket(uint32 timestamp, bool marker,
37 const Vp8Descriptor& vp8_descriptor, 37 const Vp8Descriptor& vp8_descriptor,
38 const CompoundBuffer& payload) { 38 const CompoundBuffer& payload) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // And write the packet. 75 // And write the packet.
76 buffered_rtp_writer_->Write(buffer, NULL); 76 buffered_rtp_writer_->Write(buffer, NULL);
77 } 77 }
78 78
79 int RtpWriter::GetPendingPackets() { 79 int RtpWriter::GetPendingPackets() {
80 return buffered_rtp_writer_->GetBufferChunks(); 80 return buffered_rtp_writer_->GetBufferChunks();
81 } 81 }
82 82
83 } // namespace protocol 83 } // namespace protocol
84 } // namespace remoting 84 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rtp_writer.h ('k') | remoting/protocol/video_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698