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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 case ParsedRtcEventLog::RTCP_EVENT: { | 197 case ParsedRtcEventLog::RTCP_EVENT: { |
198 break; | 198 break; |
199 } | 199 } |
200 case ParsedRtcEventLog::LOG_START: { | 200 case ParsedRtcEventLog::LOG_START: { |
201 break; | 201 break; |
202 } | 202 } |
203 case ParsedRtcEventLog::LOG_END: { | 203 case ParsedRtcEventLog::LOG_END: { |
204 break; | 204 break; |
205 } | 205 } |
206 case ParsedRtcEventLog::BWE_PACKET_LOSS_EVENT: { | 206 case ParsedRtcEventLog::BWE_PACKET_LOSS_EVENT: { |
| 207 BwePacketLossEvent bwe_update; |
| 208 bwe_update.timestamp = parsed_log_.GetTimestamp(i); |
| 209 parsed_log_.GetBwePacketLossEvent(i, &bwe_update.new_bitrate, |
| 210 &bwe_update.fraction_loss, |
| 211 &bwe_update.expected_packets); |
| 212 bwe_loss_updates_.push_back(bwe_update); |
207 break; | 213 break; |
208 } | 214 } |
209 case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { | 215 case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { |
210 break; | 216 break; |
211 } | 217 } |
212 case ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: { | 218 case ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: { |
213 break; | 219 break; |
214 } | 220 } |
215 case ParsedRtcEventLog::UNKNOWN_EVENT: { | 221 case ParsedRtcEventLog::UNKNOWN_EVENT: { |
216 break; | 222 break; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 556 } |
551 | 557 |
552 // Set labels. | 558 // Set labels. |
553 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 559 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
554 plot->series.back().label = "Incoming bitrate"; | 560 plot->series.back().label = "Incoming bitrate"; |
555 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 561 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
556 plot->series.back().label = "Outgoing bitrate"; | 562 plot->series.back().label = "Outgoing bitrate"; |
557 } | 563 } |
558 plot->series.back().style = LINE_GRAPH; | 564 plot->series.back().style = LINE_GRAPH; |
559 | 565 |
| 566 // Overlay the send-side bandwidth estimate over the outgoing bitrate. |
| 567 if (desired_direction == kOutgoingPacket) { |
| 568 plot->series.push_back(TimeSeries()); |
| 569 for (auto& bwe_update : bwe_loss_updates_) { |
| 570 float x = |
| 571 static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; |
| 572 float y = static_cast<float>(bwe_update.new_bitrate) / 1000; |
| 573 max_y = std::max(max_y, y); |
| 574 plot->series.back().points.emplace_back(x, y); |
| 575 } |
| 576 plot->series.back().label = "Loss-based estimate"; |
| 577 plot->series.back().style = LINE_GRAPH; |
| 578 } |
| 579 |
560 plot->xaxis_min = kDefaultXMin; | 580 plot->xaxis_min = kDefaultXMin; |
561 plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin; | 581 plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin; |
562 plot->xaxis_label = "Time (s)"; | 582 plot->xaxis_label = "Time (s)"; |
563 plot->yaxis_min = kDefaultYMin; | 583 plot->yaxis_min = kDefaultYMin; |
564 plot->yaxis_max = max_y * kYMargin; | 584 plot->yaxis_max = max_y * kYMargin; |
565 plot->yaxis_label = "Bitrate (kbps)"; | 585 plot->yaxis_label = "Bitrate (kbps)"; |
566 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 586 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
567 plot->title = "Incoming RTP bitrate"; | 587 plot->title = "Incoming RTP bitrate"; |
568 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 588 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
569 plot->title = "Outgoing RTP bitrate"; | 589 plot->title = "Outgoing RTP bitrate"; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 plot->yaxis_label = "Bitrate (kbps)"; | 670 plot->yaxis_label = "Bitrate (kbps)"; |
651 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 671 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
652 plot->title = "Incoming bitrate per stream"; | 672 plot->title = "Incoming bitrate per stream"; |
653 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 673 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
654 plot->title = "Outgoing bitrate per stream"; | 674 plot->title = "Outgoing bitrate per stream"; |
655 } | 675 } |
656 } | 676 } |
657 | 677 |
658 } // namespace plotting | 678 } // namespace plotting |
659 } // namespace webrtc | 679 } // namespace webrtc |
OLD | NEW |