| 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 15 matching lines...) Expand all Loading... |
| 26 uint32_t* fec_overhead_rate_bps, | 26 uint32_t* fec_overhead_rate_bps, |
| 27 VCMProtectionCallback* video_protection_callback) { | 27 VCMProtectionCallback* video_protection_callback) { |
| 28 FecProtectionParams delta_fec_params; | 28 FecProtectionParams delta_fec_params; |
| 29 FecProtectionParams key_fec_params; | 29 FecProtectionParams key_fec_params; |
| 30 // Get the FEC code rate for Key frames (set to 0 when NA). | 30 // Get the FEC code rate for Key frames (set to 0 when NA). |
| 31 key_fec_params.fec_rate = selected_method->RequiredProtectionFactorK(); | 31 key_fec_params.fec_rate = selected_method->RequiredProtectionFactorK(); |
| 32 | 32 |
| 33 // Get the FEC code rate for Delta frames (set to 0 when NA). | 33 // Get the FEC code rate for Delta frames (set to 0 when NA). |
| 34 delta_fec_params.fec_rate = selected_method->RequiredProtectionFactorD(); | 34 delta_fec_params.fec_rate = selected_method->RequiredProtectionFactorD(); |
| 35 | 35 |
| 36 // Get the FEC-UEP protection status for Key frames: UEP on/off. | |
| 37 key_fec_params.use_uep_protection = selected_method->RequiredUepProtectionK(); | |
| 38 | |
| 39 // Get the FEC-UEP protection status for Delta frames: UEP on/off. | |
| 40 delta_fec_params.use_uep_protection = | |
| 41 selected_method->RequiredUepProtectionD(); | |
| 42 | |
| 43 // The RTP module currently requires the same |max_fec_frames| for both | 36 // The RTP module currently requires the same |max_fec_frames| for both |
| 44 // key and delta frames. | 37 // key and delta frames. |
| 45 delta_fec_params.max_fec_frames = selected_method->MaxFramesFec(); | 38 delta_fec_params.max_fec_frames = selected_method->MaxFramesFec(); |
| 46 key_fec_params.max_fec_frames = selected_method->MaxFramesFec(); | 39 key_fec_params.max_fec_frames = selected_method->MaxFramesFec(); |
| 47 | 40 |
| 48 // Set the FEC packet mask type. |kFecMaskBursty| is more effective for | 41 // Set the FEC packet mask type. |kFecMaskBursty| is more effective for |
| 49 // consecutive losses and little/no packet re-ordering. As we currently | 42 // consecutive losses and little/no packet re-ordering. As we currently |
| 50 // do not have feedback data on the degree of correlated losses and packet | 43 // do not have feedback data on the degree of correlated losses and packet |
| 51 // re-ordering, we keep default setting to |kFecMaskRandom| for now. | 44 // re-ordering, we keep default setting to |kFecMaskRandom| for now. |
| 52 delta_fec_params.fec_mask_type = kFecMaskRandom; | 45 delta_fec_params.fec_mask_type = kFecMaskRandom; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 215 |
| 223 // For now use the filtered loss for computing the robustness settings. | 216 // For now use the filtered loss for computing the robustness settings. |
| 224 loss_prot_logic_->UpdateFilteredLossPr(packet_loss_enc); | 217 loss_prot_logic_->UpdateFilteredLossPr(packet_loss_enc); |
| 225 | 218 |
| 226 // Rate cost of the protection methods. | 219 // Rate cost of the protection methods. |
| 227 float protection_overhead_rate = 0.0f; | 220 float protection_overhead_rate = 0.0f; |
| 228 | 221 |
| 229 // Update protection settings, when applicable. | 222 // Update protection settings, when applicable. |
| 230 float sent_video_rate_kbps = 0.0f; | 223 float sent_video_rate_kbps = 0.0f; |
| 231 if (loss_prot_logic_->SelectedType() != kNone) { | 224 if (loss_prot_logic_->SelectedType() != kNone) { |
| 232 // Update protection method with content metrics. | |
| 233 selected_method->UpdateContentMetrics(content_->ShortTermAvgData()); | |
| 234 | |
| 235 // Update method will compute the robustness settings for the given | 225 // Update method will compute the robustness settings for the given |
| 236 // protection method and the overhead cost | 226 // protection method and the overhead cost |
| 237 // the protection method is set by the user via SetVideoProtection. | 227 // the protection method is set by the user via SetVideoProtection. |
| 238 loss_prot_logic_->UpdateMethod(); | 228 loss_prot_logic_->UpdateMethod(); |
| 239 | 229 |
| 240 // Update protection callback with protection settings. | 230 // Update protection callback with protection settings. |
| 241 uint32_t sent_video_rate_bps = 0; | 231 uint32_t sent_video_rate_bps = 0; |
| 242 uint32_t sent_nack_rate_bps = 0; | 232 uint32_t sent_nack_rate_bps = 0; |
| 243 uint32_t sent_fec_rate_bps = 0; | 233 uint32_t sent_fec_rate_bps = 0; |
| 244 // Get the bit cost of protection method, based on the amount of | 234 // Get the bit cost of protection method, based on the amount of |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 if (video_target_bitrate_ > | 614 if (video_target_bitrate_ > |
| 625 suspension_threshold_bps_ + suspension_window_bps_) { | 615 suspension_threshold_bps_ + suspension_window_bps_) { |
| 626 video_suspended_ = false; | 616 video_suspended_ = false; |
| 627 } | 617 } |
| 628 } | 618 } |
| 629 } | 619 } |
| 630 } | 620 } |
| 631 | 621 |
| 632 } // namespace media_optimization | 622 } // namespace media_optimization |
| 633 } // namespace webrtc | 623 } // namespace webrtc |
| OLD | NEW |