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