| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 { | 184 { |
| 185 rtc::CritScope cs(&critsect_); | 185 rtc::CritScope cs(&critsect_); |
| 186 int fraction_lost_aggregate = 0; | 186 int fraction_lost_aggregate = 0; |
| 187 int total_number_of_packets = 0; | 187 int total_number_of_packets = 0; |
| 188 | 188 |
| 189 // Compute the a weighted average of the fraction loss from all report | 189 // Compute the a weighted average of the fraction loss from all report |
| 190 // blocks. | 190 // blocks. |
| 191 for (const RTCPReportBlock& report_block : report_blocks) { | 191 for (const RTCPReportBlock& report_block : report_blocks) { |
| 192 std::map<uint32_t, uint32_t>::iterator seq_num_it = | 192 std::map<uint32_t, uint32_t>::iterator seq_num_it = |
| 193 ssrc_to_last_received_extended_high_seq_num_.find( | 193 ssrc_to_last_received_extended_high_seq_num_.find( |
| 194 report_block.sourceSSRC); | 194 report_block.source_ssrc); |
| 195 | 195 |
| 196 int number_of_packets = 0; | 196 int number_of_packets = 0; |
| 197 if (seq_num_it != ssrc_to_last_received_extended_high_seq_num_.end()) { | 197 if (seq_num_it != ssrc_to_last_received_extended_high_seq_num_.end()) { |
| 198 number_of_packets = | 198 number_of_packets = |
| 199 report_block.extendedHighSeqNum - seq_num_it->second; | 199 report_block.extended_highest_sequence_number - seq_num_it->second; |
| 200 } | 200 } |
| 201 | 201 |
| 202 fraction_lost_aggregate += number_of_packets * report_block.fractionLost; | 202 fraction_lost_aggregate += number_of_packets * report_block.fraction_lost; |
| 203 total_number_of_packets += number_of_packets; | 203 total_number_of_packets += number_of_packets; |
| 204 | 204 |
| 205 // Update last received for this SSRC. | 205 // Update last received for this SSRC. |
| 206 ssrc_to_last_received_extended_high_seq_num_[report_block.sourceSSRC] = | 206 ssrc_to_last_received_extended_high_seq_num_[report_block.source_ssrc] = |
| 207 report_block.extendedHighSeqNum; | 207 report_block.extended_highest_sequence_number; |
| 208 } | 208 } |
| 209 if (total_number_of_packets < 0) { | 209 if (total_number_of_packets < 0) { |
| 210 LOG(LS_WARNING) << "Received report block where extended high sequence " | 210 LOG(LS_WARNING) << "Received report block where extended high sequence " |
| 211 "number goes backwards, ignoring."; | 211 "number goes backwards, ignoring."; |
| 212 return; | 212 return; |
| 213 } | 213 } |
| 214 if (total_number_of_packets == 0) | 214 if (total_number_of_packets == 0) |
| 215 fraction_lost_aggregate = 0; | 215 fraction_lost_aggregate = 0; |
| 216 else | 216 else |
| 217 fraction_lost_aggregate = | 217 fraction_lost_aggregate = |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 280 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
| 281 if (bitrate > 0) { | 281 if (bitrate > 0) { |
| 282 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 282 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
| 283 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 283 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
| 284 *bandwidth = bitrate; | 284 *bandwidth = bitrate; |
| 285 return true; | 285 return true; |
| 286 } | 286 } |
| 287 return false; | 287 return false; |
| 288 } | 288 } |
| 289 } // namespace webrtc | 289 } // namespace webrtc |
| OLD | NEW |