| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 // Produce FEC over at most |params_.max_fec_frames| frames, or as soon as: | 151 // Produce FEC over at most |params_.max_fec_frames| frames, or as soon as: |
| 152 // (1) the excess overhead (actual overhead - requested/target overhead) is | 152 // (1) the excess overhead (actual overhead - requested/target overhead) is |
| 153 // less than |kMaxExcessOverhead|, and | 153 // less than |kMaxExcessOverhead|, and |
| 154 // (2) at least |minimum_media_packets_fec_| media packets is reached. | 154 // (2) at least |minimum_media_packets_fec_| media packets is reached. |
| 155 if (complete_frame && | 155 if (complete_frame && |
| 156 (num_frames_ == params_.max_fec_frames || | 156 (num_frames_ == params_.max_fec_frames || |
| 157 (ExcessOverheadBelowMax() && MinimumMediaPacketsReached()))) { | 157 (ExcessOverheadBelowMax() && MinimumMediaPacketsReached()))) { |
| 158 assert(num_first_partition_ <= | 158 assert(num_first_partition_ <= |
| 159 static_cast<int>(ForwardErrorCorrection::kMaxMediaPackets)); | 159 static_cast<int>(ForwardErrorCorrection::kMaxMediaPackets)); |
| 160 int ret = fec_->GenerateFEC(media_packets_fec_, | 160 // TODO(pbos): Consider whether unequal protection should be enabled or not, |
| 161 params_.fec_rate, | 161 // it is currently always disabled. |
| 162 num_first_partition_, | 162 int ret = fec_->GenerateFEC(media_packets_fec_, params_.fec_rate, |
| 163 params_.use_uep_protection, | 163 num_first_partition_, false, |
| 164 params_.fec_mask_type, | 164 params_.fec_mask_type, &fec_packets_); |
| 165 &fec_packets_); | |
| 166 if (fec_packets_.empty()) { | 165 if (fec_packets_.empty()) { |
| 167 num_frames_ = 0; | 166 num_frames_ = 0; |
| 168 DeletePackets(); | 167 DeletePackets(); |
| 169 } | 168 } |
| 170 return ret; | 169 return ret; |
| 171 } | 170 } |
| 172 return 0; | 171 return 0; |
| 173 } | 172 } |
| 174 | 173 |
| 175 // Returns true if the excess overhead (actual - target) for the FEC is below | 174 // Returns true if the excess overhead (actual - target) for the FEC is below |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 251 |
| 253 void ProducerFec::DeletePackets() { | 252 void ProducerFec::DeletePackets() { |
| 254 while (!media_packets_fec_.empty()) { | 253 while (!media_packets_fec_.empty()) { |
| 255 delete media_packets_fec_.front(); | 254 delete media_packets_fec_.front(); |
| 256 media_packets_fec_.pop_front(); | 255 media_packets_fec_.pop_front(); |
| 257 } | 256 } |
| 258 assert(media_packets_fec_.empty()); | 257 assert(media_packets_fec_.empty()); |
| 259 } | 258 } |
| 260 | 259 |
| 261 } // namespace webrtc | 260 } // namespace webrtc |
| OLD | NEW |