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

Unified Diff: webrtc/tools/event_log_visualizer/analyzer.cc

Issue 2310943002: Add time line for acked bitrate. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/event_log_visualizer/analyzer.cc
diff --git a/webrtc/tools/event_log_visualizer/analyzer.cc b/webrtc/tools/event_log_visualizer/analyzer.cc
index 7db82ae47806a4c262a9b7353d3869f160b30d2f..7797825e2a2536f1c3d735781acdeba5eb7db0a9 100644
--- a/webrtc/tools/event_log_visualizer/analyzer.cc
+++ b/webrtc/tools/event_log_visualizer/analyzer.cc
@@ -21,6 +21,7 @@
#include "webrtc/api/call/audio_send_stream.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
+#include "webrtc/base/rate_statistics.h"
#include "webrtc/call.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
@@ -835,6 +836,9 @@ void EventLogAnalyzer::CreateBweSimulationGraph(Plot* plot) {
TimeSeries time_series;
time_series.label = "Delay-based estimate";
time_series.style = LINE_DOT_GRAPH;
+ TimeSeries acked_time_series;
+ acked_time_series.label = "Acked bitrate";
+ acked_time_series.style = LINE_DOT_GRAPH;
auto rtp_iterator = outgoing_rtp.begin();
auto rtcp_iterator = incoming_rtcp.begin();
@@ -860,6 +864,8 @@ void EventLogAnalyzer::CreateBweSimulationGraph(Plot* plot) {
return std::numeric_limits<int64_t>::max();
};
+ RateStatistics acked_bitrate(1000, 8000);
+
int64_t time_us = std::min(NextRtpTime(), NextRtcpTime());
while (time_us != std::numeric_limits<int64_t>::max()) {
clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds());
@@ -867,8 +873,23 @@ void EventLogAnalyzer::CreateBweSimulationGraph(Plot* plot) {
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime());
const LoggedRtcpPacket& rtcp = *rtcp_iterator->second;
if (rtcp.type == kRtcpTransportFeedback) {
- cc.GetTransportFeedbackObserver()->OnTransportFeedback(
- *static_cast<rtcp::TransportFeedback*>(rtcp.packet.get()));
+ TransportFeedbackObserver* observer = cc.GetTransportFeedbackObserver();
+ observer->OnTransportFeedback(*static_cast<rtcp::TransportFeedback*>(
+ rtcp.packet.get()));
+ std::vector<PacketInfo> feedback =
+ observer->GetTransportFeedbackVector();
+ rtc::Optional<uint32_t> bitrate_bps;
+ if (!feedback.empty()) {
+ for (const PacketInfo& packet : feedback)
+ acked_bitrate.Update(packet.payload_size, packet.arrival_time_ms);
+ bitrate_bps = acked_bitrate.Rate(feedback.back().arrival_time_ms);
+ }
+ uint32_t y = 0;
+ if (bitrate_bps)
+ y = *bitrate_bps / 1000;
+ float x = static_cast<float>(clock.TimeInMicroseconds() - begin_time_) /
+ 1000000;
+ acked_time_series.points.emplace_back(x, y);
}
++rtcp_iterator;
}
@@ -900,6 +921,7 @@ void EventLogAnalyzer::CreateBweSimulationGraph(Plot* plot) {
}
// Add the data set to the plot.
plot->series_list_.push_back(std::move(time_series));
+ plot->series_list_.push_back(std::move(acked_time_series));
plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin);
plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin);
@@ -955,9 +977,10 @@ void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) {
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime());
const LoggedRtcpPacket& rtcp = *rtcp_iterator->second;
if (rtcp.type == kRtcpTransportFeedback) {
+ feedback_adapter.OnTransportFeedback(
+ *static_cast<rtcp::TransportFeedback*>(rtcp.packet.get()));
std::vector<PacketInfo> feedback =
- feedback_adapter.GetPacketFeedbackVector(
- *static_cast<rtcp::TransportFeedback*>(rtcp.packet.get()));
+ feedback_adapter.GetTransportFeedbackVector();
for (const PacketInfo& packet : feedback) {
int64_t y = packet.arrival_time_ms - packet.send_time_ms;
float x =
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698