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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 bool ProtectsPacketsBefore(QuicPacketSequenceNumber num) const; | 54 bool ProtectsPacketsBefore(QuicPacketSequenceNumber num) const; |
55 | 55 |
56 const base::StringPiece payload_parity() const { | 56 const base::StringPiece payload_parity() const { |
57 return base::StringPiece(payload_parity_, payload_parity_len_); | 57 return base::StringPiece(payload_parity_, payload_parity_len_); |
58 } | 58 } |
59 | 59 |
60 QuicPacketSequenceNumber min_protected_packet() const { | 60 QuicPacketSequenceNumber min_protected_packet() const { |
61 return min_protected_packet_; | 61 return min_protected_packet_; |
62 } | 62 } |
63 | 63 |
64 size_t NumReceivedPackets() const { | 64 QuicPacketCount NumReceivedPackets() const { |
65 return received_packets_.size(); | 65 return received_packets_.size(); |
66 } | 66 } |
67 | 67 |
68 // Returns the effective encryption level of the FEC group. | 68 // Returns the effective encryption level of the FEC group. |
69 EncryptionLevel effective_encryption_level() const { | 69 EncryptionLevel effective_encryption_level() const { |
70 return effective_encryption_level_; | 70 return effective_encryption_level_; |
71 } | 71 } |
72 | 72 |
73 private: | 73 private: |
74 bool UpdateParity(base::StringPiece payload); | 74 bool UpdateParity(base::StringPiece payload); |
75 // Returns the number of missing packets, or size_t max if the number | 75 // Returns the number of missing packets, or QuicPacketCount max |
76 // of missing packets is not known. | 76 // if the number of missing packets is not known. |
77 size_t NumMissingPackets() const; | 77 QuicPacketCount NumMissingPackets() const; |
78 | 78 |
79 // Set of packets that we have recevied. | 79 // Set of packets that we have recevied. |
80 SequenceNumberSet received_packets_; | 80 SequenceNumberSet received_packets_; |
81 // Sequence number of the first protected packet in this group (the one | 81 // Sequence number of the first protected packet in this group (the one |
82 // with the lowest packet sequence number). Will only be set once the FEC | 82 // with the lowest packet sequence number). Will only be set once the FEC |
83 // packet has been seen. | 83 // packet has been seen. |
84 QuicPacketSequenceNumber min_protected_packet_; | 84 QuicPacketSequenceNumber min_protected_packet_; |
85 // Sequence number of the last protected packet in this group (the one | 85 // Sequence number of the last protected packet in this group (the one |
86 // with the highest packet sequence number). Will only be set once the FEC | 86 // with the highest packet sequence number). Will only be set once the FEC |
87 // packet has been seen. | 87 // packet has been seen. |
88 QuicPacketSequenceNumber max_protected_packet_; | 88 QuicPacketSequenceNumber max_protected_packet_; |
89 // The cumulative parity calculation of all received packets. | 89 // The cumulative parity calculation of all received packets. |
90 char payload_parity_[kMaxPacketSize]; | 90 char payload_parity_[kMaxPacketSize]; |
91 size_t payload_parity_len_; | 91 size_t payload_parity_len_; |
92 // The effective encryption level, which is the lowest encryption level of | 92 // The effective encryption level, which is the lowest encryption level of |
93 // the data and FEC in the group. | 93 // the data and FEC in the group. |
94 EncryptionLevel effective_encryption_level_; | 94 EncryptionLevel effective_encryption_level_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(QuicFecGroup); | 96 DISALLOW_COPY_AND_ASSIGN(QuicFecGroup); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace net | 99 } // namespace net |
100 | 100 |
101 #endif // NET_QUIC_QUIC_FEC_GROUP_H_ | 101 #endif // NET_QUIC_QUIC_FEC_GROUP_H_ |
OLD | NEW |