Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc

Issue 2710093004: Rename webrtc::PacketInfo to webrtc::PacketFeedback (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 int SendSideBweSender::GetFeedbackIntervalMs() const { 49 int SendSideBweSender::GetFeedbackIntervalMs() const {
50 return kFeedbackIntervalMs; 50 return kFeedbackIntervalMs;
51 } 51 }
52 52
53 void SendSideBweSender::GiveFeedback(const FeedbackPacket& feedback) { 53 void SendSideBweSender::GiveFeedback(const FeedbackPacket& feedback) {
54 const SendSideBweFeedback& fb = 54 const SendSideBweFeedback& fb =
55 static_cast<const SendSideBweFeedback&>(feedback); 55 static_cast<const SendSideBweFeedback&>(feedback);
56 if (fb.packet_feedback_vector().empty()) 56 if (fb.packet_feedback_vector().empty())
57 return; 57 return;
58 std::vector<PacketInfo> packet_feedback_vector(fb.packet_feedback_vector()); 58 std::vector<PacketFeedback> packet_feedback_vector(
59 for (PacketInfo& packet_info : packet_feedback_vector) { 59 fb.packet_feedback_vector());
60 if (!send_time_history_.GetInfo(&packet_info, true)) { 60 for (PacketFeedback& packet_feedback : packet_feedback_vector) {
61 if (!send_time_history_.GetFeedback(&packet_feedback, true)) {
61 int64_t now_ms = clock_->TimeInMilliseconds(); 62 int64_t now_ms = clock_->TimeInMilliseconds();
62 if (now_ms - last_log_time_ms_ > 5000) { 63 if (now_ms - last_log_time_ms_ > 5000) {
63 LOG(LS_WARNING) << "Ack arrived too late."; 64 LOG(LS_WARNING) << "Ack arrived too late.";
64 last_log_time_ms_ = now_ms; 65 last_log_time_ms_ = now_ms;
65 } 66 }
66 } 67 }
67 } 68 }
68 69
69 int64_t rtt_ms = 70 int64_t rtt_ms =
70 clock_->TimeInMilliseconds() - feedback.latest_send_time_ms(); 71 clock_->TimeInMilliseconds() - feedback.latest_send_time_ms();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 SendSideBweReceiver::SendSideBweReceiver(int flow_id) 137 SendSideBweReceiver::SendSideBweReceiver(int flow_id)
137 : BweReceiver(flow_id), last_feedback_ms_(0) { 138 : BweReceiver(flow_id), last_feedback_ms_(0) {
138 } 139 }
139 140
140 SendSideBweReceiver::~SendSideBweReceiver() { 141 SendSideBweReceiver::~SendSideBweReceiver() {
141 } 142 }
142 143
143 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms, 144 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms,
144 const MediaPacket& media_packet) { 145 const MediaPacket& media_packet) {
145 packet_feedback_vector_.push_back( 146 packet_feedback_vector_.push_back(
146 PacketInfo(-1, arrival_time_ms, media_packet.sender_timestamp_ms(), 147 PacketFeedback(-1, arrival_time_ms, media_packet.sender_timestamp_ms(),
147 media_packet.header().sequenceNumber, 148 media_packet.header().sequenceNumber,
148 media_packet.payload_size(), PacedPacketInfo())); 149 media_packet.payload_size(), PacedPacketInfo()));
149 150
150 // Log received packet information. 151 // Log received packet information.
151 BweReceiver::ReceivePacket(arrival_time_ms, media_packet); 152 BweReceiver::ReceivePacket(arrival_time_ms, media_packet);
152 } 153 }
153 154
154 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) { 155 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) {
155 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs) 156 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs)
156 return NULL; 157 return NULL;
157 last_feedback_ms_ = now_ms; 158 last_feedback_ms_ = now_ms;
158 int64_t corrected_send_time_ms = 159 int64_t corrected_send_time_ms =
159 packet_feedback_vector_.back().send_time_ms + now_ms - 160 packet_feedback_vector_.back().send_time_ms + now_ms -
160 packet_feedback_vector_.back().arrival_time_ms; 161 packet_feedback_vector_.back().arrival_time_ms;
161 FeedbackPacket* fb = new SendSideBweFeedback( 162 FeedbackPacket* fb = new SendSideBweFeedback(
162 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); 163 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_);
163 packet_feedback_vector_.clear(); 164 packet_feedback_vector_.clear();
164 return fb; 165 return fb;
165 } 166 }
166 167
167 } // namespace bwe 168 } // namespace bwe
168 } // namespace testing 169 } // namespace testing
169 } // namespace webrtc 170 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698