OLD | NEW |
1 // Copyright (c) 2010 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 #ifndef REMOTING_PROTOCOL_RTCP_WRITER_H_ | 5 #ifndef REMOTING_PROTOCOL_RTCP_WRITER_H_ |
6 #define REMOTING_PROTOCOL_RTCP_WRITER_H_ | 6 #define REMOTING_PROTOCOL_RTCP_WRITER_H_ |
7 | 7 |
8 #include "net/socket/socket.h" | 8 #include "net/socket/socket.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 class MessageLoopProxy; | 11 class MessageLoopProxy; |
12 } // namespace base | 12 } // namespace base |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
16 class CompoundBuffer; | |
17 | |
18 namespace protocol { | 16 namespace protocol { |
19 | 17 |
20 class BufferedDatagramWriter; | 18 class BufferedDatagramWriter; |
21 struct RtcpReceiverReport; | 19 struct RtcpReceiverReport; |
22 | 20 |
23 class RtcpWriter { | 21 class RtcpWriter { |
24 public: | 22 public: |
25 RtcpWriter(base::MessageLoopProxy* message_loop); | 23 explicit RtcpWriter(base::MessageLoopProxy* message_loop); |
26 virtual ~RtcpWriter(); | 24 virtual ~RtcpWriter(); |
27 | 25 |
28 // Initializes the writer. Must be called on the thread the socket | 26 // Initializes the writer. Must be called on the thread the socket |
29 // belongs to. | 27 // belongs to. |
30 void Init(net::Socket* socket); | 28 void Init(net::Socket* socket); |
31 void Close(); | 29 void Close(); |
32 | 30 |
33 // Sends next packet. The packet is mutated by | 31 // Sends next packet. The packet is mutated by |
34 void SendReport(const RtcpReceiverReport& report); | 32 void SendReport(const RtcpReceiverReport& report); |
35 | 33 |
36 // Returns number of packets queued in the buffer. | 34 // Returns number of packets queued in the buffer. |
37 int GetPendingPackets(); | 35 int GetPendingPackets(); |
38 | 36 |
39 private: | 37 private: |
40 scoped_refptr<BufferedDatagramWriter> buffered_rtcp_writer_; | 38 scoped_refptr<BufferedDatagramWriter> buffered_rtcp_writer_; |
41 | 39 |
42 DISALLOW_COPY_AND_ASSIGN(RtcpWriter); | 40 DISALLOW_COPY_AND_ASSIGN(RtcpWriter); |
43 }; | 41 }; |
44 | 42 |
45 } // namespace protocol | 43 } // namespace protocol |
46 } // namespace remoting | 44 } // namespace remoting |
47 | 45 |
48 #endif // REMOTING_PROTOCOL_RTCP_WRITER_H_ | 46 #endif // REMOTING_PROTOCOL_RTCP_WRITER_H_ |
OLD | NEW |