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