OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 SentPacket sent_packet(send_time_ms, PacketStatus::Unacked); | 92 SentPacket sent_packet(send_time_ms, PacketStatus::Unacked); |
93 packet_status_window_.insert(packet_status_window_.end(), | 93 packet_status_window_.insert(packet_status_window_.end(), |
94 std::make_pair(seq_num, sent_packet)); | 94 std::make_pair(seq_num, sent_packet)); |
95 | 95 |
96 if (packet_status_window_.size() == 1) { | 96 if (packet_status_window_.size() == 1) { |
97 ref_packet_status_ = packet_status_window_.cbegin(); | 97 ref_packet_status_ = packet_status_window_.cbegin(); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 void TransportFeedbackPacketLossTracker::OnNewTransportFeedbackVector( | 101 void TransportFeedbackPacketLossTracker::OnPacketFeedbackVector( |
102 const std::vector<PacketFeedback>& packet_feedback_vector) { | 102 const std::vector<PacketFeedback>& packet_feedback_vector) { |
103 for (const PacketFeedback& packet : packet_feedback_vector) { | 103 for (const PacketFeedback& packet : packet_feedback_vector) { |
104 const auto& it = packet_status_window_.find(packet.sequence_number); | 104 const auto& it = packet_status_window_.find(packet.sequence_number); |
105 | 105 |
106 // Packets which aren't at least marked as unacked either do not belong to | 106 // Packets which aren't at least marked as unacked either do not belong to |
107 // this media stream, or have been shifted out of window. | 107 // this media stream, or have been shifted out of window. |
108 if (it == packet_status_window_.end()) | 108 if (it == packet_status_window_.end()) |
109 continue; | 109 continue; |
110 | 110 |
111 const bool lost = packet.arrival_time_ms == PacketFeedback::kNotReceived; | 111 const bool lost = packet.arrival_time_ms == PacketFeedback::kNotReceived; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 TransportFeedbackPacketLossTracker::RplrState::GetMetric() const { | 359 TransportFeedbackPacketLossTracker::RplrState::GetMetric() const { |
360 if (num_acked_pairs_ < min_num_acked_pairs_) { | 360 if (num_acked_pairs_ < min_num_acked_pairs_) { |
361 return rtc::Optional<float>(); | 361 return rtc::Optional<float>(); |
362 } else { | 362 } else { |
363 return rtc::Optional<float>( | 363 return rtc::Optional<float>( |
364 static_cast<float>(num_recoverable_losses_) / num_acked_pairs_); | 364 static_cast<float>(num_recoverable_losses_) / num_acked_pairs_); |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 } // namespace webrtc | 368 } // namespace webrtc |
OLD | NEW |