| OLD | NEW |
| 1 // Copyright (c) 2011 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_RTP_READER_H_ | 5 #ifndef REMOTING_PROTOCOL_RTP_READER_H_ |
| 6 #define REMOTING_PROTOCOL_RTP_READER_H_ | 6 #define REMOTING_PROTOCOL_RTP_READER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "remoting/base/compound_buffer.h" | 9 #include "remoting/base/compound_buffer.h" |
| 10 #include "remoting/protocol/rtp_utils.h" | 10 #include "remoting/protocol/rtp_utils.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 uint32 extended_sequence_number_; | 41 uint32 extended_sequence_number_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // RtpReader implements and RTP receiver. It reads packets from RTP | 44 // RtpReader implements and RTP receiver. It reads packets from RTP |
| 45 // socket, parses them, calculates extended sequence number and then | 45 // socket, parses them, calculates extended sequence number and then |
| 46 // passes them to a callback. It also collects statistics for RTCP | 46 // passes them to a callback. It also collects statistics for RTCP |
| 47 // receiver reports, but doesn't send any RTCP packets itself. | 47 // receiver reports, but doesn't send any RTCP packets itself. |
| 48 class RtpReader : public SocketReaderBase { | 48 class RtpReader : public SocketReaderBase { |
| 49 public: | 49 public: |
| 50 RtpReader(); | 50 RtpReader(); |
| 51 ~RtpReader(); | 51 virtual ~RtpReader(); |
| 52 | 52 |
| 53 // The OnMessageCallback is called whenever a new message is received. | 53 // The OnMessageCallback is called whenever a new message is received. |
| 54 // Ownership of the message is passed the callback. | 54 // Ownership of the message is passed the callback. |
| 55 typedef Callback1<const RtpPacket*>::Type OnMessageCallback; | 55 typedef Callback1<const RtpPacket*>::Type OnMessageCallback; |
| 56 | 56 |
| 57 // Initialize the reader and start reading. Must be called on the thread | 57 // Initialize the reader and start reading. Must be called on the thread |
| 58 // |socket| belongs to. The callback will be called when a new message is | 58 // |socket| belongs to. The callback will be called when a new message is |
| 59 // received. RtpReader owns |on_message_callback|, doesn't own | 59 // received. RtpReader owns |on_message_callback|, doesn't own |
| 60 // |socket|. | 60 // |socket|. |
| 61 void Init(net::Socket* socket, OnMessageCallback* on_message_callback); | 61 void Init(net::Socket* socket, OnMessageCallback* on_message_callback); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 76 int total_packets_received_; | 76 int total_packets_received_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(RtpReader); | 78 DISALLOW_COPY_AND_ASSIGN(RtpReader); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace protocol | 81 } // namespace protocol |
| 82 } // namespace remoting | 82 } // namespace remoting |
| 83 | 83 |
| 84 | 84 |
| 85 #endif // REMOTING_PROTOCOL_RTP_READER_H_ | 85 #endif // REMOTING_PROTOCOL_RTP_READER_H_ |
| OLD | NEW |