Plot RTCP SR and RR contents in event_log_visualizer.
Plot the contents of all report blocks in all sender and receiver reports.
This includes fraction lost, cumulative number of lost packets, extended
highest sequence number and time since last received SR.
Bug: None
Change-Id: Ifbded689a666da140c468e11c33b6c6f99a3041e
Reviewed-on: https://webrtc-review.googlesource.com/90247
Reviewed-by: Alex Narest <alexnarest@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24083}diff --git a/rtc_tools/event_log_visualizer/analyzer.cc b/rtc_tools/event_log_visualizer/analyzer.cc
index 7555845..4ddd68c 100644
--- a/rtc_tools/event_log_visualizer/analyzer.cc
+++ b/rtc_tools/event_log_visualizer/analyzer.cc
@@ -1458,6 +1458,61 @@
plot->SetTitle(GetDirectionAsString(direction) + " timestamps");
}
+void EventLogAnalyzer::CreateSenderAndReceiverReportPlot(
+ PacketDirection direction,
+ rtc::FunctionView<float(const rtcp::ReportBlock&)> fy,
+ std::string title,
+ std::string yaxis_label,
+ Plot* plot) {
+ std::map<uint32_t, TimeSeries> sr_reports_by_ssrc;
+ const auto& sender_reports = parsed_log_.sender_reports(direction);
+ for (const auto& rtcp : sender_reports) {
+ float x = ToCallTimeSec(rtcp.log_time_us());
+ uint32_t ssrc = rtcp.sr.sender_ssrc();
+ for (const auto& block : rtcp.sr.report_blocks()) {
+ float y = fy(block);
+ auto sr_report_it = sr_reports_by_ssrc.find(ssrc);
+ bool inserted;
+ if (sr_report_it == sr_reports_by_ssrc.end()) {
+ std::tie(sr_report_it, inserted) = sr_reports_by_ssrc.emplace(
+ ssrc, TimeSeries(GetStreamName(direction, ssrc) + " Sender Reports",
+ LineStyle::kLine, PointStyle::kHighlight));
+ }
+ sr_report_it->second.points.emplace_back(x, y);
+ }
+ }
+ for (auto& kv : sr_reports_by_ssrc) {
+ plot->AppendTimeSeries(std::move(kv.second));
+ }
+
+ std::map<uint32_t, TimeSeries> rr_reports_by_ssrc;
+ const auto& receiver_reports = parsed_log_.receiver_reports(direction);
+ for (const auto& rtcp : receiver_reports) {
+ float x = ToCallTimeSec(rtcp.log_time_us());
+ uint32_t ssrc = rtcp.rr.sender_ssrc();
+ for (const auto& block : rtcp.rr.report_blocks()) {
+ float y = fy(block);
+ auto rr_report_it = rr_reports_by_ssrc.find(ssrc);
+ bool inserted;
+ if (rr_report_it == rr_reports_by_ssrc.end()) {
+ std::tie(rr_report_it, inserted) = rr_reports_by_ssrc.emplace(
+ ssrc,
+ TimeSeries(GetStreamName(direction, ssrc) + " Receiver Reports",
+ LineStyle::kLine, PointStyle::kHighlight));
+ }
+ rr_report_it->second.points.emplace_back(x, y);
+ }
+ }
+ for (auto& kv : rr_reports_by_ssrc) {
+ plot->AppendTimeSeries(std::move(kv.second));
+ }
+
+ plot->SetXAxis(ToCallTimeSec(begin_time_), call_duration_s_, "Time (s)",
+ kLeftMargin, kRightMargin);
+ plot->SetSuggestedYAxis(0, 1, yaxis_label, kBottomMargin, kTopMargin);
+ plot->SetTitle(title);
+}
+
void EventLogAnalyzer::CreateAudioEncoderTargetBitrateGraph(Plot* plot) {
TimeSeries time_series("Audio encoder target bitrate", LineStyle::kLine,
PointStyle::kHighlight);