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 uint64_t timestamp = parsed_log_.GetTimestamp(i); | |
208 int32_t bitrate; | |
209 uint8_t fraction_loss; | |
210 int32_t expected_packets; | |
211 parsed_log_.GetBwePacketLossEvent(i, &bitrate, &fraction_loss, | |
212 &expected_packets); | |
213 bwe_loss_updates_.push_back(BwePacketLossEvent( | |
ivoc
2016/07/19 09:42:48
You could use emplace_back here to construct the o
terelius
2016/07/19 13:06:18
Changed the GetBwePacketLossEvent to write the dir
| |
214 timestamp, bitrate, fraction_loss, expected_packets)); | |
207 break; | 215 break; |
208 } | 216 } |
209 case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { | 217 case ParsedRtcEventLog::BWE_PACKET_DELAY_EVENT: { |
210 break; | 218 break; |
211 } | 219 } |
212 case ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: { | 220 case ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: { |
213 break; | 221 break; |
214 } | 222 } |
215 case ParsedRtcEventLog::UNKNOWN_EVENT: { | 223 case ParsedRtcEventLog::UNKNOWN_EVENT: { |
216 break; | 224 break; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 } | 558 } |
551 | 559 |
552 // Set labels. | 560 // Set labels. |
553 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 561 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
554 plot->series.back().label = "Incoming bitrate"; | 562 plot->series.back().label = "Incoming bitrate"; |
555 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 563 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
556 plot->series.back().label = "Outgoing bitrate"; | 564 plot->series.back().label = "Outgoing bitrate"; |
557 } | 565 } |
558 plot->series.back().style = LINE_GRAPH; | 566 plot->series.back().style = LINE_GRAPH; |
559 | 567 |
568 // Overlay the send-side bandwidth estimate over the outgoing bitrate. | |
569 if (desired_direction == kOutgoingPacket) { | |
570 plot->series.push_back(TimeSeries()); | |
571 for (auto& bwe_update : bwe_loss_updates_) { | |
572 float x = | |
573 static_cast<float>(bwe_update.timestamp - begin_time_) / 1000000; | |
574 float y = static_cast<float>(bwe_update.new_bitrate) / 1000; | |
575 max_y = std::max(max_y, y); | |
576 plot->series.back().points.push_back(TimeSeriesPoint(x, y)); | |
ivoc
2016/07/19 09:42:48
Another opportunity for emplace_back.
terelius
2016/07/19 13:06:18
Done.
| |
577 } | |
578 plot->series.back().label = "Loss-based estimate"; | |
579 plot->series.back().style = LINE_GRAPH; | |
580 } | |
581 | |
560 plot->xaxis_min = kDefaultXMin; | 582 plot->xaxis_min = kDefaultXMin; |
561 plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin; | 583 plot->xaxis_max = (end_time_ - begin_time_) / 1000000 * kXMargin; |
562 plot->xaxis_label = "Time (s)"; | 584 plot->xaxis_label = "Time (s)"; |
563 plot->yaxis_min = kDefaultYMin; | 585 plot->yaxis_min = kDefaultYMin; |
564 plot->yaxis_max = max_y * kYMargin; | 586 plot->yaxis_max = max_y * kYMargin; |
565 plot->yaxis_label = "Bitrate (kbps)"; | 587 plot->yaxis_label = "Bitrate (kbps)"; |
566 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 588 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
567 plot->title = "Incoming RTP bitrate"; | 589 plot->title = "Incoming RTP bitrate"; |
568 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 590 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
569 plot->title = "Outgoing RTP bitrate"; | 591 plot->title = "Outgoing RTP bitrate"; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 plot->yaxis_label = "Bitrate (kbps)"; | 672 plot->yaxis_label = "Bitrate (kbps)"; |
651 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 673 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
652 plot->title = "Incoming bitrate per stream"; | 674 plot->title = "Incoming bitrate per stream"; |
653 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 675 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
654 plot->title = "Outgoing bitrate per stream"; | 676 plot->title = "Outgoing bitrate per stream"; |
655 } | 677 } |
656 } | 678 } |
657 | 679 |
658 } // namespace plotting | 680 } // namespace plotting |
659 } // namespace webrtc | 681 } // namespace webrtc |
OLD | NEW |