| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void MediaPacket::SetAbsSendTimeMs(int64_t abs_send_time_ms) { | 150 void MediaPacket::SetAbsSendTimeMs(int64_t abs_send_time_ms) { |
| 151 header_.extension.hasAbsoluteSendTime = true; | 151 header_.extension.hasAbsoluteSendTime = true; |
| 152 header_.extension.absoluteSendTime = ((static_cast<int64_t>(abs_send_time_ms * | 152 header_.extension.absoluteSendTime = ((static_cast<int64_t>(abs_send_time_ms * |
| 153 (1 << 18)) + 500) / 1000) & 0x00fffffful; | 153 (1 << 18)) + 500) / 1000) & 0x00fffffful; |
| 154 } | 154 } |
| 155 | 155 |
| 156 BbrBweFeedback::BbrBweFeedback( | 156 BbrBweFeedback::BbrBweFeedback( |
| 157 int flow_id, | 157 int flow_id, |
| 158 int64_t send_time_us, | 158 int64_t send_time_us, |
| 159 int64_t latest_send_time_ms, | 159 int64_t latest_send_time_ms, |
| 160 const std::vector<uint64_t>& packet_feedback_vector) | 160 const std::vector<uint16_t>& packet_feedback_vector) |
| 161 : FeedbackPacket(flow_id, send_time_us, latest_send_time_ms), | 161 : FeedbackPacket(flow_id, send_time_us, latest_send_time_ms), |
| 162 packet_feedback_vector_(packet_feedback_vector) {} | 162 packet_feedback_vector_(packet_feedback_vector) {} |
| 163 | 163 |
| 164 RembFeedback::RembFeedback(int flow_id, | 164 RembFeedback::RembFeedback(int flow_id, |
| 165 int64_t send_time_us, | 165 int64_t send_time_us, |
| 166 int64_t last_send_time_ms, | 166 int64_t last_send_time_ms, |
| 167 uint32_t estimated_bps, | 167 uint32_t estimated_bps, |
| 168 RTCPReportBlock report_block) | 168 RTCPReportBlock report_block) |
| 169 : FeedbackPacket(flow_id, send_time_us, last_send_time_ms), | 169 : FeedbackPacket(flow_id, send_time_us, last_send_time_ms), |
| 170 estimated_bps_(estimated_bps), | 170 estimated_bps_(estimated_bps), |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 uint32_t ChokeFilter::capacity_kbps() { | 512 uint32_t ChokeFilter::capacity_kbps() { |
| 513 return capacity_kbps_; | 513 return capacity_kbps_; |
| 514 } | 514 } |
| 515 | 515 |
| 516 void ChokeFilter::RunFor(int64_t /*time_ms*/, Packets* in_out) { | 516 void ChokeFilter::RunFor(int64_t /*time_ms*/, Packets* in_out) { |
| 517 assert(in_out); | 517 assert(in_out); |
| 518 for (PacketsIt it = in_out->begin(); it != in_out->end(); ) { | 518 for (PacketsIt it = in_out->begin(); it != in_out->end(); ) { |
| 519 int64_t earliest_send_time_us = | 519 int64_t earliest_send_time_us = |
| 520 std::max(last_send_time_us_, (*it)->send_time_us()); | 520 std::max(last_send_time_us_, (*it)->send_time_us()); |
| 521 | |
| 522 int64_t new_send_time_us = | 521 int64_t new_send_time_us = |
| 523 earliest_send_time_us + | 522 earliest_send_time_us + |
| 524 ((*it)->payload_size() * 8 * 1000 + capacity_kbps_ / 2) / | 523 ((*it)->payload_size() * 8 * 1000 + capacity_kbps_ / 2) / |
| 525 capacity_kbps_; | 524 capacity_kbps_; |
| 526 | 525 BWE_TEST_LOGGING_PLOT(0, "MaxThroughput_", new_send_time_us / 1000, |
| 526 capacity_kbps_); |
| 527 if (delay_cap_helper_->ShouldSendPacket(new_send_time_us, | 527 if (delay_cap_helper_->ShouldSendPacket(new_send_time_us, |
| 528 (*it)->send_time_us())) { | 528 (*it)->send_time_us())) { |
| 529 (*it)->set_send_time_us(new_send_time_us); | 529 (*it)->set_send_time_us(new_send_time_us); |
| 530 last_send_time_us_ = new_send_time_us; | 530 last_send_time_us_ = new_send_time_us; |
| 531 ++it; | 531 ++it; |
| 532 } else { | 532 } else { |
| 533 delete *it; | 533 delete *it; |
| 534 it = in_out->erase(it); | 534 it = in_out->erase(it); |
| 535 } | 535 } |
| 536 } | 536 } |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, | 820 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, |
| 821 uint32_t remaining_payload) { | 821 uint32_t remaining_payload) { |
| 822 uint32_t fragments = | 822 uint32_t fragments = |
| 823 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; | 823 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; |
| 824 uint32_t avg_size = (frame_size + fragments - 1) / fragments; | 824 uint32_t avg_size = (frame_size + fragments - 1) / fragments; |
| 825 return std::min(avg_size, remaining_payload); | 825 return std::min(avg_size, remaining_payload); |
| 826 } | 826 } |
| 827 } // namespace bwe | 827 } // namespace bwe |
| 828 } // namespace testing | 828 } // namespace testing |
| 829 } // namespace webrtc | 829 } // namespace webrtc |
| OLD | NEW |