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

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

Issue 4779001: Added CompoundBuffer that will be used to store data in the encoding/decoding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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_writer.cc ('k') | remoting/protocol/rtp_writer.cc » ('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 #ifndef REMOTING_PROTOCOL_RTP_WRITER_H_ 5 #ifndef REMOTING_PROTOCOL_RTP_WRITER_H_
6 #define REMOTING_PROTOCOL_RTP_WRITER_H_ 6 #define REMOTING_PROTOCOL_RTP_WRITER_H_
7 7
8 #include "net/socket/socket.h" 8 #include "net/socket/socket.h"
9 #include "remoting/protocol/buffered_socket_writer.h" 9 #include "remoting/protocol/buffered_socket_writer.h"
10 10
11 namespace remoting { 11 namespace remoting {
12
13 class CompoundBuffer;
14
12 namespace protocol { 15 namespace protocol {
13 16
14 class RtpWriter { 17 class RtpWriter {
15 public: 18 public:
16 RtpWriter(); 19 RtpWriter();
17 virtual ~RtpWriter(); 20 virtual ~RtpWriter();
18 21
19 // Initializes the writer. Must be called on the thread the sockets belong 22 // Initializes the writer. Must be called on the thread the sockets belong
20 // to. 23 // to.
21 void Init(net::Socket* rtp_socket, net::Socket* rtcp_socket); 24 void Init(net::Socket* rtp_socket, net::Socket* rtcp_socket);
22 25
23 // Sends next packet. 26 // Sends next packet.
24 void SendPacket(const char* payload, int payload_size, uint32 timestamp); 27 void SendPacket(const CompoundBuffer& payload, uint32 timestamp);
25 28
26 // Returns number of packets queued in the buffer. 29 // Returns number of packets queued in the buffer.
27 int GetPendingPackets(); 30 int GetPendingPackets();
28 31
29 // Stop writing and drop pending data. Must be called from the same thread as 32 // Stop writing and drop pending data. Must be called from the same thread as
30 // Init(). 33 // Init().
31 void Close(); 34 void Close();
32 35
33 private: 36 private:
34 net::Socket* rtp_socket_; 37 net::Socket* rtp_socket_;
35 net::Socket* rtcp_socket_; 38 net::Socket* rtcp_socket_;
36 39
37 uint32 last_packet_number_; 40 uint32 last_packet_number_;
38 41
39 scoped_refptr<BufferedDatagramWriter> buffered_rtp_writer_; 42 scoped_refptr<BufferedDatagramWriter> buffered_rtp_writer_;
40 }; 43 };
41 44
42 } // namespace protocol 45 } // namespace protocol
43 } // namespace remoting 46 } // namespace remoting
44 47
45 #endif // REMOTING_PROTOCOL_RTP_WRITER_H_ 48 #endif // REMOTING_PROTOCOL_RTP_WRITER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/rtp_video_writer.cc ('k') | remoting/protocol/rtp_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698