| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 owner_->OnReceivedRtcpReceiverReport(fraction_lost_aggregate, rtt, | 82 owner_->OnReceivedRtcpReceiverReport(fraction_lost_aggregate, rtt, |
| 83 total_number_of_packets, now_ms); | 83 total_number_of_packets, now_ms); |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 std::map<uint32_t, uint32_t> ssrc_to_last_received_extended_high_seq_num_; | 87 std::map<uint32_t, uint32_t> ssrc_to_last_received_extended_high_seq_num_; |
| 88 BitrateControllerImpl* owner_; | 88 BitrateControllerImpl* owner_; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 BitrateController* BitrateController::CreateBitrateController( | 91 BitrateController* BitrateController::CreateBitrateController( |
| 92 Clock* clock, | 92 const Clock* clock, |
| 93 BitrateObserver* observer, | 93 BitrateObserver* observer, |
| 94 RtcEventLog* event_log) { | 94 RtcEventLog* event_log) { |
| 95 return new BitrateControllerImpl(clock, observer, event_log); | 95 return new BitrateControllerImpl(clock, observer, event_log); |
| 96 } | 96 } |
| 97 | 97 |
| 98 BitrateController* BitrateController::CreateBitrateController( | 98 BitrateController* BitrateController::CreateBitrateController( |
| 99 Clock* clock, | 99 const Clock* clock, |
| 100 RtcEventLog* event_log) { | 100 RtcEventLog* event_log) { |
| 101 return CreateBitrateController(clock, nullptr, event_log); | 101 return CreateBitrateController(clock, nullptr, event_log); |
| 102 } | 102 } |
| 103 | 103 |
| 104 BitrateControllerImpl::BitrateControllerImpl(Clock* clock, | 104 BitrateControllerImpl::BitrateControllerImpl(const Clock* clock, |
| 105 BitrateObserver* observer, | 105 BitrateObserver* observer, |
| 106 RtcEventLog* event_log) | 106 RtcEventLog* event_log) |
| 107 : clock_(clock), | 107 : clock_(clock), |
| 108 observer_(observer), | 108 observer_(observer), |
| 109 last_bitrate_update_ms_(clock_->TimeInMilliseconds()), | 109 last_bitrate_update_ms_(clock_->TimeInMilliseconds()), |
| 110 event_log_(event_log), | 110 event_log_(event_log), |
| 111 bandwidth_estimation_(event_log), | 111 bandwidth_estimation_(event_log), |
| 112 reserved_bitrate_bps_(0), | 112 reserved_bitrate_bps_(0), |
| 113 last_bitrate_bps_(0), | 113 last_bitrate_bps_(0), |
| 114 last_fraction_loss_(0), | 114 last_fraction_loss_(0), |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 284 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
| 285 if (bitrate > 0) { | 285 if (bitrate > 0) { |
| 286 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 286 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
| 287 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 287 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
| 288 *bandwidth = bitrate; | 288 *bandwidth = bitrate; |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 return false; | 291 return false; |
| 292 } | 292 } |
| 293 } // namespace webrtc | 293 } // namespace webrtc |
| OLD | NEW |