| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 13 matching lines...) Expand all Loading... |
| 24 const int kFeedbackIntervalMs = 50; | 24 const int kFeedbackIntervalMs = 50; |
| 25 | 25 |
| 26 SendSideBweSender::SendSideBweSender(int kbps, | 26 SendSideBweSender::SendSideBweSender(int kbps, |
| 27 BitrateObserver* observer, | 27 BitrateObserver* observer, |
| 28 Clock* clock) | 28 Clock* clock) |
| 29 : bitrate_controller_( | 29 : bitrate_controller_( |
| 30 BitrateController::CreateBitrateController(clock, | 30 BitrateController::CreateBitrateController(clock, |
| 31 observer, | 31 observer, |
| 32 &event_log_)), | 32 &event_log_)), |
| 33 acknowledged_bitrate_estimator_( | 33 acknowledged_bitrate_estimator_( |
| 34 rtc::MakeUnique<AcknowledgedBitrateEstimator>()), | 34 rtc::MakeUnique<AcknowledgedBitrateEstimator>( |
| 35 rtc::MakeUnique<BitrateEstimatorCreator>())), |
| 35 bwe_(new DelayBasedBwe(nullptr, clock)), | 36 bwe_(new DelayBasedBwe(nullptr, clock)), |
| 36 feedback_observer_(bitrate_controller_->CreateRtcpBandwidthObserver()), | 37 feedback_observer_(bitrate_controller_->CreateRtcpBandwidthObserver()), |
| 37 clock_(clock), | 38 clock_(clock), |
| 38 send_time_history_(clock_, 10000), | 39 send_time_history_(clock_, 10000), |
| 39 has_received_ack_(false), | 40 has_received_ack_(false), |
| 40 last_acked_seq_num_(0), | 41 last_acked_seq_num_(0), |
| 41 last_log_time_ms_(0) { | 42 last_log_time_ms_(0) { |
| 42 assert(kbps >= kMinBitrateKbps); | 43 assert(kbps >= kMinBitrateKbps); |
| 43 assert(kbps <= kMaxBitrateKbps); | 44 assert(kbps <= kMaxBitrateKbps); |
| 44 bitrate_controller_->SetStartBitrate(1000 * kbps); | 45 bitrate_controller_->SetStartBitrate(1000 * kbps); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 69 } | 70 } |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 | 73 |
| 73 int64_t rtt_ms = | 74 int64_t rtt_ms = |
| 74 clock_->TimeInMilliseconds() - feedback.latest_send_time_ms(); | 75 clock_->TimeInMilliseconds() - feedback.latest_send_time_ms(); |
| 75 bwe_->OnRttUpdate(rtt_ms, rtt_ms); | 76 bwe_->OnRttUpdate(rtt_ms, rtt_ms); |
| 76 BWE_TEST_LOGGING_PLOT(1, "RTT", clock_->TimeInMilliseconds(), rtt_ms); | 77 BWE_TEST_LOGGING_PLOT(1, "RTT", clock_->TimeInMilliseconds(), rtt_ms); |
| 77 | 78 |
| 78 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector( | 79 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector( |
| 79 packet_feedback_vector); | 80 packet_feedback_vector, false); |
| 80 DelayBasedBwe::Result result = bwe_->IncomingPacketFeedbackVector( | 81 DelayBasedBwe::Result result = bwe_->IncomingPacketFeedbackVector( |
| 81 packet_feedback_vector, acknowledged_bitrate_estimator_->bitrate_bps()); | 82 packet_feedback_vector, acknowledged_bitrate_estimator_->bitrate_bps()); |
| 82 if (result.updated) | 83 if (result.updated) |
| 83 bitrate_controller_->OnDelayBasedBweResult(result); | 84 bitrate_controller_->OnDelayBasedBweResult(result); |
| 84 | 85 |
| 85 if (has_received_ack_) { | 86 if (has_received_ack_) { |
| 86 int expected_packets = fb.packet_feedback_vector().back().sequence_number - | 87 int expected_packets = fb.packet_feedback_vector().back().sequence_number - |
| 87 last_acked_seq_num_; | 88 last_acked_seq_num_; |
| 88 // Assuming no reordering for now. | 89 // Assuming no reordering for now. |
| 89 if (expected_packets > 0) { | 90 if (expected_packets > 0) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 packet_feedback_vector_.back().arrival_time_ms; | 168 packet_feedback_vector_.back().arrival_time_ms; |
| 168 FeedbackPacket* fb = new SendSideBweFeedback( | 169 FeedbackPacket* fb = new SendSideBweFeedback( |
| 169 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); | 170 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); |
| 170 packet_feedback_vector_.clear(); | 171 packet_feedback_vector_.clear(); |
| 171 return fb; | 172 return fb; |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace bwe | 175 } // namespace bwe |
| 175 } // namespace testing | 176 } // namespace testing |
| 176 } // namespace webrtc | 177 } // namespace webrtc |
| OLD | NEW |