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

Side by Side Diff: webrtc/tools/event_log_visualizer/analyzer.cc

Issue 2707383006: GetTransportFeedbackVector() includes unreceived packets, sorted by seq-num (Closed)
Patch Set: Response to CR 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 int64_t last_update_us = 0; 1042 int64_t last_update_us = 0;
1043 while (time_us != std::numeric_limits<int64_t>::max()) { 1043 while (time_us != std::numeric_limits<int64_t>::max()) {
1044 clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds()); 1044 clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds());
1045 if (clock.TimeInMicroseconds() >= NextRtcpTime()) { 1045 if (clock.TimeInMicroseconds() >= NextRtcpTime()) {
1046 RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime()); 1046 RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime());
1047 const LoggedRtcpPacket& rtcp = *rtcp_iterator->second; 1047 const LoggedRtcpPacket& rtcp = *rtcp_iterator->second;
1048 if (rtcp.type == kRtcpTransportFeedback) { 1048 if (rtcp.type == kRtcpTransportFeedback) {
1049 TransportFeedbackObserver* observer = cc.GetTransportFeedbackObserver(); 1049 TransportFeedbackObserver* observer = cc.GetTransportFeedbackObserver();
1050 observer->OnTransportFeedback(*static_cast<rtcp::TransportFeedback*>( 1050 observer->OnTransportFeedback(*static_cast<rtcp::TransportFeedback*>(
1051 rtcp.packet.get())); 1051 rtcp.packet.get()));
1052 // TODO(elad.alon): Modify this (before landing).
1052 std::vector<PacketFeedback> feedback = 1053 std::vector<PacketFeedback> feedback =
1053 observer->GetTransportFeedbackVector(); 1054 observer->GetTransportFeedbackVector();
1054 rtc::Optional<uint32_t> bitrate_bps; 1055 rtc::Optional<uint32_t> bitrate_bps;
1055 if (!feedback.empty()) { 1056 if (!feedback.empty()) {
1056 for (const PacketFeedback& packet : feedback) 1057 for (const PacketFeedback& packet : feedback)
1057 acked_bitrate.Update(packet.payload_size, packet.arrival_time_ms); 1058 acked_bitrate.Update(packet.payload_size, packet.arrival_time_ms);
1058 bitrate_bps = acked_bitrate.Rate(feedback.back().arrival_time_ms); 1059 bitrate_bps = acked_bitrate.Rate(feedback.back().arrival_time_ms);
1059 } 1060 }
1060 uint32_t y = 0; 1061 uint32_t y = 0;
1061 if (bitrate_bps) 1062 if (bitrate_bps)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1178
1178 int64_t time_us = std::min(NextRtpTime(), NextRtcpTime()); 1179 int64_t time_us = std::min(NextRtpTime(), NextRtcpTime());
1179 while (time_us != std::numeric_limits<int64_t>::max()) { 1180 while (time_us != std::numeric_limits<int64_t>::max()) {
1180 clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds()); 1181 clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds());
1181 if (clock.TimeInMicroseconds() >= NextRtcpTime()) { 1182 if (clock.TimeInMicroseconds() >= NextRtcpTime()) {
1182 RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime()); 1183 RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime());
1183 const LoggedRtcpPacket& rtcp = *rtcp_iterator->second; 1184 const LoggedRtcpPacket& rtcp = *rtcp_iterator->second;
1184 if (rtcp.type == kRtcpTransportFeedback) { 1185 if (rtcp.type == kRtcpTransportFeedback) {
1185 feedback_adapter.OnTransportFeedback( 1186 feedback_adapter.OnTransportFeedback(
1186 *static_cast<rtcp::TransportFeedback*>(rtcp.packet.get())); 1187 *static_cast<rtcp::TransportFeedback*>(rtcp.packet.get()));
1188 // TODO(elad.alon): Modify this (before landing).
1187 std::vector<PacketFeedback> feedback = 1189 std::vector<PacketFeedback> feedback =
1188 feedback_adapter.GetTransportFeedbackVector(); 1190 feedback_adapter.GetTransportFeedbackVector();
1189 for (const PacketFeedback& packet : feedback) { 1191 for (const PacketFeedback& packet : feedback) {
1190 int64_t y = packet.arrival_time_ms - packet.send_time_ms; 1192 int64_t y = packet.arrival_time_ms - packet.send_time_ms;
1191 float x = 1193 float x =
1192 static_cast<float>(clock.TimeInMicroseconds() - begin_time_) / 1194 static_cast<float>(clock.TimeInMicroseconds() - begin_time_) /
1193 1000000; 1195 1000000;
1194 estimated_base_delay_ms = std::min(y, estimated_base_delay_ms); 1196 estimated_base_delay_ms = std::min(y, estimated_base_delay_ms);
1195 time_series.points.emplace_back(x, y); 1197 time_series.points.emplace_back(x, y);
1196 } 1198 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 return rtc::Optional<float>(); 1377 return rtc::Optional<float>();
1376 }); 1378 });
1377 plot->series_list_.back().label = "Audio encoder number of channels"; 1379 plot->series_list_.back().label = "Audio encoder number of channels";
1378 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); 1380 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
1379 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", 1381 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))",
1380 kBottomMargin, kTopMargin); 1382 kBottomMargin, kTopMargin);
1381 plot->SetTitle("Reported audio encoder number of channels"); 1383 plot->SetTitle("Reported audio encoder number of channels");
1382 } 1384 }
1383 } // namespace plotting 1385 } // namespace plotting
1384 } // namespace webrtc 1386 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698