| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 // Update protection callback with protection settings. | 124 // Update protection callback with protection settings. |
| 125 uint32_t sent_video_rate_bps = 0; | 125 uint32_t sent_video_rate_bps = 0; |
| 126 uint32_t sent_nack_rate_bps = 0; | 126 uint32_t sent_nack_rate_bps = 0; |
| 127 uint32_t sent_fec_rate_bps = 0; | 127 uint32_t sent_fec_rate_bps = 0; |
| 128 // Rate cost of the protection methods. | 128 // Rate cost of the protection methods. |
| 129 float protection_overhead_rate = 0.0f; | 129 float protection_overhead_rate = 0.0f; |
| 130 | 130 |
| 131 // TODO(Marco): Pass FEC protection values per layer. | 131 // TODO(Marco): Pass FEC protection values per layer. |
| 132 protection_callback_->ProtectionRequest( | 132 protection_callback_->ProtectionRequest( |
| 133 &delta_fec_params, &key_fec_params, &sent_video_rate_bps, | 133 delta_fec_params, key_fec_params, &sent_video_rate_bps, |
| 134 &sent_nack_rate_bps, &sent_fec_rate_bps); | 134 &sent_nack_rate_bps, &sent_fec_rate_bps); |
| 135 | 135 |
| 136 uint32_t sent_total_rate_bps = | 136 uint32_t sent_total_rate_bps = |
| 137 sent_video_rate_bps + sent_nack_rate_bps + sent_fec_rate_bps; | 137 sent_video_rate_bps + sent_nack_rate_bps + sent_fec_rate_bps; |
| 138 // Estimate the overhead costs of the next second as staying the same | 138 // Estimate the overhead costs of the next second as staying the same |
| 139 // wrt the source bitrate. | 139 // wrt the source bitrate. |
| 140 if (sent_total_rate_bps > 0) { | 140 if (sent_total_rate_bps > 0) { |
| 141 protection_overhead_rate = | 141 protection_overhead_rate = |
| 142 static_cast<float>(sent_nack_rate_bps + sent_fec_rate_bps) / | 142 static_cast<float>(sent_nack_rate_bps + sent_fec_rate_bps) / |
| 143 sent_total_rate_bps; | 143 sent_total_rate_bps; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 min_packets_per_frame, clock_->TimeInMilliseconds()); | 182 min_packets_per_frame, clock_->TimeInMilliseconds()); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 if (!delta_frame && encoded_length > 0) { | 185 if (!delta_frame && encoded_length > 0) { |
| 186 loss_prot_logic_->UpdateKeyFrameSize(static_cast<float>(encoded_length)); | 186 loss_prot_logic_->UpdateKeyFrameSize(static_cast<float>(encoded_length)); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace webrtc | 191 } // namespace webrtc |
| OLD | NEW |