OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Input: fec_mask_type The type of packet mask used in the FEC. | 140 // Input: fec_mask_type The type of packet mask used in the FEC. |
141 // Random or bursty type may be selected. The | 141 // Random or bursty type may be selected. The |
142 // bursty type is only defined up to 12 media | 142 // bursty type is only defined up to 12 media |
143 // packets. If the number of media packets is | 143 // packets. If the number of media packets is |
144 // above 12, the packet masks from the random | 144 // above 12, the packet masks from the random |
145 // table will be selected. | 145 // table will be selected. |
146 // Output: fec_packets List of pointers to generated FEC packets, | 146 // Output: fec_packets List of pointers to generated FEC packets, |
147 // of type Packet. Must be empty on entry. | 147 // of type Packet. Must be empty on entry. |
148 // The memory available through the list will | 148 // The memory available through the list will |
149 // be valid until the next call to | 149 // be valid until the next call to |
150 // GenerateFec(). | 150 // EncodeFec(). |
151 // | 151 // |
152 // Returns 0 on success, -1 on failure. | 152 // Returns 0 on success, -1 on failure. |
153 // | 153 // |
154 int GenerateFec(const PacketList& media_packets, | 154 int EncodeFec(const PacketList& media_packets, |
155 uint8_t protection_factor, int num_important_packets, | 155 uint8_t protection_factor, |
156 bool use_unequal_protection, FecMaskType fec_mask_type, | 156 int num_important_packets, |
157 std::list<Packet*>* fec_packets); | 157 bool use_unequal_protection, |
| 158 FecMaskType fec_mask_type, |
| 159 std::list<Packet*>* fec_packets); |
158 | 160 |
159 // | 161 // |
160 // Decodes a list of received media and FEC packets. It will parse the | 162 // Decodes a list of received media and FEC packets. It will parse the |
161 // |received_packets|, storing FEC packets internally, and move | 163 // |received_packets|, storing FEC packets internally, and move |
162 // media packets to |recovered_packets|. The recovered list will be | 164 // media packets to |recovered_packets|. The recovered list will be |
163 // sorted by ascending sequence number and have duplicates removed. | 165 // sorted by ascending sequence number and have duplicates removed. |
164 // The function should be called as new packets arrive, and | 166 // The function should be called as new packets arrive, and |
165 // |recovered_packets| will be progressively assembled with each call. | 167 // |recovered_packets| will be progressively assembled with each call. |
166 // When the function returns, |received_packets| will be empty. | 168 // When the function returns, |received_packets| will be empty. |
167 // | 169 // |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 ReceivedFecPacketList received_fec_packets_; | 303 ReceivedFecPacketList received_fec_packets_; |
302 | 304 |
303 // Arrays used to avoid dynamically allocating memory when generating | 305 // Arrays used to avoid dynamically allocating memory when generating |
304 // the packet masks in the ULPFEC headers. | 306 // the packet masks in the ULPFEC headers. |
305 // (There are never more than |kMaxMediaPackets| FEC packets generated.) | 307 // (There are never more than |kMaxMediaPackets| FEC packets generated.) |
306 uint8_t packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet]; | 308 uint8_t packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet]; |
307 uint8_t tmp_packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet]; | 309 uint8_t tmp_packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet]; |
308 }; | 310 }; |
309 } // namespace webrtc | 311 } // namespace webrtc |
310 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FORWARD_ERROR_CORRECTION_H_ | 312 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FORWARD_ERROR_CORRECTION_H_ |
OLD | NEW |