| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Tracks information about an FEC group, including the packets | 5 // Tracks information about an FEC group, including the packets |
| 6 // that have been seen, and the running parity. Provided the ability | 6 // that have been seen, and the running parity. Provided the ability |
| 7 // to revive a dropped packet. | 7 // to revive a dropped packet. |
| 8 | 8 |
| 9 #ifndef NET_QUIC_QUIC_FEC_GROUP_H_ | 9 #ifndef NET_QUIC_QUIC_FEC_GROUP_H_ |
| 10 #define NET_QUIC_QUIC_FEC_GROUP_H_ | 10 #define NET_QUIC_QUIC_FEC_GROUP_H_ |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool ProtectsPacketsBefore(QuicPacketSequenceNumber num) const; | 53 bool ProtectsPacketsBefore(QuicPacketSequenceNumber num) const; |
| 54 | 54 |
| 55 const base::StringPiece payload_parity() const { | 55 const base::StringPiece payload_parity() const { |
| 56 return base::StringPiece(payload_parity_, payload_parity_len_); | 56 return base::StringPiece(payload_parity_, payload_parity_len_); |
| 57 } | 57 } |
| 58 | 58 |
| 59 QuicPacketSequenceNumber min_protected_packet() const { | 59 QuicPacketSequenceNumber min_protected_packet() const { |
| 60 return min_protected_packet_; | 60 return min_protected_packet_; |
| 61 } | 61 } |
| 62 | 62 |
| 63 size_t NumReceivedPackets() const { | 63 size_t NumReceivedPackets() const { return received_packets_.size(); } |
| 64 return received_packets_.size(); | |
| 65 } | |
| 66 | 64 |
| 67 private: | 65 private: |
| 68 bool UpdateParity(base::StringPiece payload); | 66 bool UpdateParity(base::StringPiece payload); |
| 69 // Returns the number of missing packets, or size_t max if the number | 67 // Returns the number of missing packets, or size_t max if the number |
| 70 // of missing packets is not known. | 68 // of missing packets is not known. |
| 71 size_t NumMissingPackets() const; | 69 size_t NumMissingPackets() const; |
| 72 | 70 |
| 73 // Set of packets that we have recevied. | 71 // Set of packets that we have recevied. |
| 74 SequenceNumberSet received_packets_; | 72 SequenceNumberSet received_packets_; |
| 75 // Sequence number of the first protected packet in this group (the one | 73 // Sequence number of the first protected packet in this group (the one |
| 76 // with the lowest packet sequence number). Will only be set once the FEC | 74 // with the lowest packet sequence number). Will only be set once the FEC |
| 77 // packet has been seen. | 75 // packet has been seen. |
| 78 QuicPacketSequenceNumber min_protected_packet_; | 76 QuicPacketSequenceNumber min_protected_packet_; |
| 79 // Sequence number of the last protected packet in this group (the one | 77 // Sequence number of the last protected packet in this group (the one |
| 80 // with the highest packet sequence number). Will only be set once the FEC | 78 // with the highest packet sequence number). Will only be set once the FEC |
| 81 // packet has been seen. | 79 // packet has been seen. |
| 82 QuicPacketSequenceNumber max_protected_packet_; | 80 QuicPacketSequenceNumber max_protected_packet_; |
| 83 // The cumulative parity calculation of all received packets. | 81 // The cumulative parity calculation of all received packets. |
| 84 char payload_parity_[kMaxPacketSize]; | 82 char payload_parity_[kMaxPacketSize]; |
| 85 size_t payload_parity_len_; | 83 size_t payload_parity_len_; |
| 86 | 84 |
| 87 DISALLOW_COPY_AND_ASSIGN(QuicFecGroup); | 85 DISALLOW_COPY_AND_ASSIGN(QuicFecGroup); |
| 88 }; | 86 }; |
| 89 | 87 |
| 90 } // namespace net | 88 } // namespace net |
| 91 | 89 |
| 92 #endif // NET_QUIC_QUIC_FEC_GROUP_H_ | 90 #endif // NET_QUIC_QUIC_FEC_GROUP_H_ |
| OLD | NEW |