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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 int FullBweSender::GetFeedbackIntervalMs() const { | 44 int FullBweSender::GetFeedbackIntervalMs() const { |
45 return kFeedbackIntervalMs; | 45 return kFeedbackIntervalMs; |
46 } | 46 } |
47 | 47 |
48 void FullBweSender::GiveFeedback(const FeedbackPacket& feedback) { | 48 void FullBweSender::GiveFeedback(const FeedbackPacket& feedback) { |
49 const SendSideBweFeedback& fb = | 49 const SendSideBweFeedback& fb = |
50 static_cast<const SendSideBweFeedback&>(feedback); | 50 static_cast<const SendSideBweFeedback&>(feedback); |
51 if (fb.packet_feedback_vector().empty()) | 51 if (fb.packet_feedback_vector().empty()) |
52 return; | 52 return; |
53 // TODO(sprang): Unconstify PacketInfo so we don't need temp copy? | |
54 std::vector<PacketInfo> packet_feedback_vector(fb.packet_feedback_vector()); | 53 std::vector<PacketInfo> packet_feedback_vector(fb.packet_feedback_vector()); |
55 for (PacketInfo& packet : packet_feedback_vector) { | 54 for (PacketInfo& packet_info : packet_feedback_vector) { |
56 if (!send_time_history_.GetSendTime(packet.sequence_number, | 55 if (!send_time_history_.GetInfo(&packet_info, true)) { |
57 &packet.send_time_ms, true)) { | |
58 LOG(LS_WARNING) << "Ack arrived too late."; | 56 LOG(LS_WARNING) << "Ack arrived too late."; |
59 } | 57 } |
60 } | 58 } |
61 | 59 |
62 int64_t rtt_ms = | 60 int64_t rtt_ms = |
63 clock_->TimeInMilliseconds() - feedback.latest_send_time_ms(); | 61 clock_->TimeInMilliseconds() - feedback.latest_send_time_ms(); |
64 rbe_->OnRttUpdate(rtt_ms, rtt_ms); | 62 rbe_->OnRttUpdate(rtt_ms, rtt_ms); |
65 BWE_TEST_LOGGING_PLOT(1, "RTT", clock_->TimeInMilliseconds(), rtt_ms); | 63 BWE_TEST_LOGGING_PLOT(1, "RTT", clock_->TimeInMilliseconds(), rtt_ms); |
66 | 64 |
67 rbe_->IncomingPacketFeedbackVector(packet_feedback_vector); | 65 rbe_->IncomingPacketFeedbackVector(packet_feedback_vector); |
(...skipping 20 matching lines...) Expand all Loading... |
88 } else { | 86 } else { |
89 last_acked_seq_num_ = packet_feedback_vector.back().sequence_number; | 87 last_acked_seq_num_ = packet_feedback_vector.back().sequence_number; |
90 has_received_ack_ = true; | 88 has_received_ack_ = true; |
91 } | 89 } |
92 } | 90 } |
93 | 91 |
94 void FullBweSender::OnPacketsSent(const Packets& packets) { | 92 void FullBweSender::OnPacketsSent(const Packets& packets) { |
95 for (Packet* packet : packets) { | 93 for (Packet* packet : packets) { |
96 if (packet->GetPacketType() == Packet::kMedia) { | 94 if (packet->GetPacketType() == Packet::kMedia) { |
97 MediaPacket* media_packet = static_cast<MediaPacket*>(packet); | 95 MediaPacket* media_packet = static_cast<MediaPacket*>(packet); |
98 send_time_history_.AddAndRemoveOldSendTimes( | 96 PacketInfo info(0, media_packet->sender_timestamp_ms(), |
99 media_packet->header().sequenceNumber, | 97 media_packet->header().sequenceNumber, |
100 media_packet->GetAbsSendTimeInMs()); | 98 media_packet->payload_size(), packet->paced()); |
| 99 send_time_history_.AddAndRemoveOld(info); |
101 } | 100 } |
102 } | 101 } |
103 } | 102 } |
104 | 103 |
105 void FullBweSender::OnReceiveBitrateChanged( | 104 void FullBweSender::OnReceiveBitrateChanged( |
106 const std::vector<unsigned int>& ssrcs, | 105 const std::vector<unsigned int>& ssrcs, |
107 unsigned int bitrate) { | 106 unsigned int bitrate) { |
108 feedback_observer_->OnReceivedEstimatedBitrate(bitrate); | 107 feedback_observer_->OnReceivedEstimatedBitrate(bitrate); |
109 } | 108 } |
110 | 109 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 packet_feedback_vector_.back().arrival_time_ms; | 142 packet_feedback_vector_.back().arrival_time_ms; |
144 FeedbackPacket* fb = new SendSideBweFeedback( | 143 FeedbackPacket* fb = new SendSideBweFeedback( |
145 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); | 144 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); |
146 packet_feedback_vector_.clear(); | 145 packet_feedback_vector_.clear(); |
147 return fb; | 146 return fb; |
148 } | 147 } |
149 | 148 |
150 } // namespace bwe | 149 } // namespace bwe |
151 } // namespace testing | 150 } // namespace testing |
152 } // namespace webrtc | 151 } // namespace webrtc |
OLD | NEW |