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 #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 #include "remoting/protocol/rtp_utils.h" | 10 #include "remoting/protocol/rtp_utils.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 class CompoundBuffer; | 14 class CompoundBuffer; |
15 | 15 |
16 namespace protocol { | 16 namespace protocol { |
17 | 17 |
18 class RtpWriter { | 18 class RtpWriter { |
19 public: | 19 public: |
20 RtpWriter(); | 20 RtpWriter(base::MessageLoopProxy* message_loop); |
21 virtual ~RtpWriter(); | 21 virtual ~RtpWriter(); |
22 | 22 |
23 // Initializes the writer. Must be called on the thread the socket | 23 // Initializes the writer. Must be called on the thread the socket |
24 // belongs to. | 24 // belongs to. |
25 void Init(net::Socket* socket); | 25 void Init(net::Socket* socket); |
26 void Close(); | 26 void Close(); |
27 | 27 |
28 // Sends next packet. The packet is mutated by | 28 // Sends next packet. The packet is mutated by |
29 void SendPacket(uint32 timestamp, bool marker, | 29 void SendPacket(uint32 timestamp, bool marker, |
30 const Vp8Descriptor& vp8_descriptor, | 30 const Vp8Descriptor& vp8_descriptor, |
31 const CompoundBuffer& payload); | 31 const CompoundBuffer& payload); |
32 | 32 |
33 // Returns number of packets queued in the buffer. | 33 // Returns number of packets queued in the buffer. |
34 int GetPendingPackets(); | 34 int GetPendingPackets(); |
35 | 35 |
36 private: | 36 private: |
37 uint32 last_packet_number_; | 37 uint32 last_packet_number_; |
38 | 38 |
39 scoped_refptr<BufferedDatagramWriter> buffered_rtp_writer_; | 39 scoped_refptr<BufferedDatagramWriter> buffered_rtp_writer_; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace protocol | 42 } // namespace protocol |
43 } // namespace remoting | 43 } // namespace remoting |
44 | 44 |
45 #endif // REMOTING_PROTOCOL_RTP_WRITER_H_ | 45 #endif // REMOTING_PROTOCOL_RTP_WRITER_H_ |
OLD | NEW |