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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 | 754 |
755 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 755 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
756 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 756 plot->SetSuggestedYAxis(0, 1, "Bitrate (kbps)", kBottomMargin, kTopMargin); |
757 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { | 757 if (desired_direction == webrtc::PacketDirection::kIncomingPacket) { |
758 plot->SetTitle("Incoming bitrate per stream"); | 758 plot->SetTitle("Incoming bitrate per stream"); |
759 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { | 759 } else if (desired_direction == webrtc::PacketDirection::kOutgoingPacket) { |
760 plot->SetTitle("Outgoing bitrate per stream"); | 760 plot->SetTitle("Outgoing bitrate per stream"); |
761 } | 761 } |
762 } | 762 } |
763 | 763 |
764 void EventLogAnalyzer::CreateBweGraph(Plot* plot) { | 764 void EventLogAnalyzer::CreateBweSimulationGraph(Plot* plot) { |
765 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; | 765 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; |
766 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; | 766 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; |
767 | 767 |
768 for (const auto& kv : rtp_packets_) { | 768 for (const auto& kv : rtp_packets_) { |
769 if (kv.first.GetDirection() == PacketDirection::kOutgoingPacket) { | 769 if (kv.first.GetDirection() == PacketDirection::kOutgoingPacket) { |
770 for (const LoggedRtpPacket& rtp_packet : kv.second) | 770 for (const LoggedRtpPacket& rtp_packet : kv.second) |
771 outgoing_rtp.insert(std::make_pair(rtp_packet.timestamp, &rtp_packet)); | 771 outgoing_rtp.insert(std::make_pair(rtp_packet.timestamp, &rtp_packet)); |
772 } | 772 } |
773 } | 773 } |
774 | 774 |
775 for (const auto& kv : rtcp_packets_) { | 775 for (const auto& kv : rtcp_packets_) { |
776 if (kv.first.GetDirection() == PacketDirection::kIncomingPacket) { | 776 if (kv.first.GetDirection() == PacketDirection::kIncomingPacket) { |
777 for (const LoggedRtcpPacket& rtcp_packet : kv.second) | 777 for (const LoggedRtcpPacket& rtcp_packet : kv.second) |
778 incoming_rtcp.insert( | 778 incoming_rtcp.insert( |
779 std::make_pair(rtcp_packet.timestamp, &rtcp_packet)); | 779 std::make_pair(rtcp_packet.timestamp, &rtcp_packet)); |
780 } | 780 } |
781 } | 781 } |
782 | 782 |
783 SimulatedClock clock(0); | 783 SimulatedClock clock(0); |
784 BitrateObserver observer; | 784 BitrateObserver observer; |
785 RtcEventLogNullImpl null_event_log; | 785 RtcEventLogNullImpl null_event_log; |
786 CongestionController cc(&clock, &observer, &observer, &null_event_log); | 786 CongestionController cc(&clock, &observer, &observer, &null_event_log); |
787 // TODO(holmer): Log the call config and use that here instead. | 787 // TODO(holmer): Log the call config and use that here instead. |
788 static const uint32_t kDefaultStartBitrateBps = 300000; | 788 static const uint32_t kDefaultStartBitrateBps = 300000; |
789 cc.SetBweBitrates(0, kDefaultStartBitrateBps, -1); | 789 cc.SetBweBitrates(0, kDefaultStartBitrateBps, -1); |
790 | 790 |
791 TimeSeries time_series; | 791 TimeSeries time_series; |
792 time_series.label = "BWE"; | 792 time_series.label = "Delay-based estimate"; |
793 time_series.style = LINE_DOT_GRAPH; | 793 time_series.style = LINE_DOT_GRAPH; |
794 | 794 |
795 auto rtp_iterator = outgoing_rtp.begin(); | 795 auto rtp_iterator = outgoing_rtp.begin(); |
796 auto rtcp_iterator = incoming_rtcp.begin(); | 796 auto rtcp_iterator = incoming_rtcp.begin(); |
797 | 797 |
798 auto NextRtpTime = [&]() { | 798 auto NextRtpTime = [&]() { |
799 if (rtp_iterator != outgoing_rtp.end()) | 799 if (rtp_iterator != outgoing_rtp.end()) |
800 return static_cast<int64_t>(rtp_iterator->first); | 800 return static_cast<int64_t>(rtp_iterator->first); |
801 return std::numeric_limits<int64_t>::max(); | 801 return std::numeric_limits<int64_t>::max(); |
802 }; | 802 }; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 time_us = std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()}); | 854 time_us = std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()}); |
855 } | 855 } |
856 // Add the data set to the plot. | 856 // Add the data set to the plot. |
857 plot->series_list_.push_back(std::move(time_series)); | 857 plot->series_list_.push_back(std::move(time_series)); |
858 | 858 |
859 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 859 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
860 plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 860 plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); |
861 plot->SetTitle("Simulated BWE behavior"); | 861 plot->SetTitle("Simulated BWE behavior"); |
862 } | 862 } |
863 | 863 |
864 void EventLogAnalyzer::CreateNetworkDelayFeebackGraph(Plot* plot) { | 864 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { |
865 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; | 865 std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; |
866 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; | 866 std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; |
867 | 867 |
868 for (const auto& kv : rtp_packets_) { | 868 for (const auto& kv : rtp_packets_) { |
869 if (kv.first.GetDirection() == PacketDirection::kOutgoingPacket) { | 869 if (kv.first.GetDirection() == PacketDirection::kOutgoingPacket) { |
870 for (const LoggedRtpPacket& rtp_packet : kv.second) | 870 for (const LoggedRtpPacket& rtp_packet : kv.second) |
871 outgoing_rtp.insert(std::make_pair(rtp_packet.timestamp, &rtp_packet)); | 871 outgoing_rtp.insert(std::make_pair(rtp_packet.timestamp, &rtp_packet)); |
872 } | 872 } |
873 } | 873 } |
874 | 874 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 point.y -= estimated_base_delay_ms; | 944 point.y -= estimated_base_delay_ms; |
945 // Add the data set to the plot. | 945 // Add the data set to the plot. |
946 plot->series_list_.push_back(std::move(time_series)); | 946 plot->series_list_.push_back(std::move(time_series)); |
947 | 947 |
948 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 948 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
949 plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); | 949 plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); |
950 plot->SetTitle("Network Delay Change."); | 950 plot->SetTitle("Network Delay Change."); |
951 } | 951 } |
952 } // namespace plotting | 952 } // namespace plotting |
953 } // namespace webrtc | 953 } // namespace webrtc |
OLD | NEW |