OLD | NEW |
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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 StreamId stream_id = kv.first; | 546 StreamId stream_id = kv.first; |
547 const std::vector<T>& packet_stream = kv.second; | 547 const std::vector<T>& packet_stream = kv.second; |
548 // Filter on direction and SSRC. | 548 // Filter on direction and SSRC. |
549 if (stream_id.GetDirection() != desired_direction || | 549 if (stream_id.GetDirection() != desired_direction || |
550 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) { | 550 !MatchingSsrc(stream_id.GetSsrc(), desired_ssrc_)) { |
551 continue; | 551 continue; |
552 } | 552 } |
553 | 553 |
554 TimeSeries time_series; | 554 TimeSeries time_series; |
555 time_series.label = label_prefix + " " + GetStreamName(stream_id); | 555 time_series.label = label_prefix + " " + GetStreamName(stream_id); |
556 time_series.style = LINE_GRAPH; | 556 time_series.style = LINE_STEP_GRAPH; |
557 | 557 |
558 for (size_t i = 0; i < packet_stream.size(); i++) { | 558 for (size_t i = 0; i < packet_stream.size(); i++) { |
559 float x = static_cast<float>(packet_stream[i].timestamp - begin_time_) / | 559 float x = static_cast<float>(packet_stream[i].timestamp - begin_time_) / |
560 1000000; | 560 1000000; |
561 time_series.points.emplace_back(x, i); | |
562 time_series.points.emplace_back(x, i + 1); | 561 time_series.points.emplace_back(x, i + 1); |
563 } | 562 } |
564 | 563 |
565 plot->series_list_.push_back(std::move(time_series)); | 564 plot->series_list_.push_back(std::move(time_series)); |
566 } | 565 } |
567 } | 566 } |
568 | 567 |
569 void EventLogAnalyzer::CreateAccumulatedPacketsGraph( | 568 void EventLogAnalyzer::CreateAccumulatedPacketsGraph( |
570 PacketDirection desired_direction, | 569 PacketDirection desired_direction, |
571 Plot* plot) { | 570 Plot* plot) { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 // Overlay the send-side bandwidth estimate over the outgoing bitrate. | 869 // Overlay the send-side bandwidth estimate over the outgoing bitrate. |
871 if (desired_direction == kOutgoingPacket) { | 870 if (desired_direction == kOutgoingPacket) { |
872 plot->series_list_.push_back(TimeSeries()); | 871 plot->series_list_.push_back(TimeSeries()); |
873 for (auto& bwe_update : bwe_loss_updates_) { | 872 for (auto& bwe_update : bwe_loss_updates_) { |
874 float x = | 873 float x = |
875 static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; | 874 static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; |
876 float y = static_cast<float>(bwe_update.new_bitrate) / 1000; | 875 float y = static_cast<float>(bwe_update.new_bitrate) / 1000; |
877 plot->series_list_.back().points.emplace_back(x, y); | 876 plot->series_list_.back().points.emplace_back(x, y); |
878 } | 877 } |
879 plot->series_list_.back().label = "Loss-based estimate"; | 878 plot->series_list_.back().label = "Loss-based estimate"; |
880 plot->series_list_.back().style = LINE_GRAPH; | 879 plot->series_list_.back().style = LINE_STEP_GRAPH; |
881 } | 880 } |
882 plot->series_list_.back().style = LINE_GRAPH; | |
883 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 881 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
884 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 882 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); |
885 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 883 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
886 plot->SetTitle("Incoming RTP bitrate"); | 884 plot->SetTitle("Incoming RTP bitrate"); |
887 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 885 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
888 plot->SetTitle("Outgoing RTP bitrate"); | 886 plot->SetTitle("Outgoing RTP bitrate"); |
889 } | 887 } |
890 } | 888 } |
891 | 889 |
892 // For each SSRC, plot the bandwidth used by that stream. | 890 // For each SSRC, plot the bandwidth used by that stream. |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 int64_t capture_ms = packet.header.timestamp / 90.0; | 1188 int64_t capture_ms = packet.header.timestamp / 90.0; |
1191 int64_t arrival_ms = packet.timestamp / 1000.0; | 1189 int64_t arrival_ms = packet.timestamp / 1000.0; |
1192 timestamps.push_back(std::make_pair(capture_ms, arrival_ms)); | 1190 timestamps.push_back(std::make_pair(capture_ms, arrival_ms)); |
1193 } | 1191 } |
1194 } | 1192 } |
1195 } | 1193 } |
1196 return timestamps; | 1194 return timestamps; |
1197 } | 1195 } |
1198 } // namespace plotting | 1196 } // namespace plotting |
1199 } // namespace webrtc | 1197 } // namespace webrtc |
OLD | NEW |