| 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  | 
|    11 #include "webrtc/tools/event_log_visualizer/analyzer.h" |    11 #include "webrtc/tools/event_log_visualizer/analyzer.h" | 
|    12  |    12  | 
|    13 #include <algorithm> |    13 #include <algorithm> | 
|    14 #include <limits> |    14 #include <limits> | 
|    15 #include <map> |    15 #include <map> | 
|    16 #include <sstream> |    16 #include <sstream> | 
|    17 #include <string> |    17 #include <string> | 
|    18 #include <utility> |    18 #include <utility> | 
|    19  |    19  | 
|    20 #include "webrtc/api/call/audio_receive_stream.h" |    20 #include "webrtc/api/call/audio_receive_stream.h" | 
|    21 #include "webrtc/api/call/audio_send_stream.h" |    21 #include "webrtc/api/call/audio_send_stream.h" | 
|    22 #include "webrtc/base/checks.h" |    22 #include "webrtc/base/checks.h" | 
|    23 #include "webrtc/base/logging.h" |    23 #include "webrtc/base/logging.h" | 
|    24 #include "webrtc/base/rate_statistics.h" |    24 #include "webrtc/base/rate_statistics.h" | 
|    25 #include "webrtc/call.h" |    25 #include "webrtc/call.h" | 
|    26 #include "webrtc/common_types.h" |    26 #include "webrtc/common_types.h" | 
 |    27 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 
|    27 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" |    28 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" | 
|    28 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |    29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 
|    29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |    30 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 
|    30 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |    31 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 
|    31 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |    32 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 
|    32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" |    33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" | 
|    33 #include "webrtc/video_receive_stream.h" |    34 #include "webrtc/video_receive_stream.h" | 
|    34 #include "webrtc/video_send_stream.h" |    35 #include "webrtc/video_send_stream.h" | 
|    35  |    36  | 
|    36 namespace webrtc { |    37 namespace webrtc { | 
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1046   } |  1047   } | 
|  1047   // Add the data set to the plot. |  1048   // Add the data set to the plot. | 
|  1048   plot->series_list_.push_back(std::move(time_series)); |  1049   plot->series_list_.push_back(std::move(time_series)); | 
|  1049   plot->series_list_.push_back(std::move(acked_time_series)); |  1050   plot->series_list_.push_back(std::move(acked_time_series)); | 
|  1050  |  1051  | 
|  1051   plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |  1052   plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 
|  1052   plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); |  1053   plot->SetSuggestedYAxis(0, 10, "Bitrate (kbps)", kBottomMargin, kTopMargin); | 
|  1053   plot->SetTitle("Simulated BWE behavior"); |  1054   plot->SetTitle("Simulated BWE behavior"); | 
|  1054 } |  1055 } | 
|  1055  |  1056  | 
 |  1057 // TODO(holmer): Remove once TransportFeedbackAdapter no longer needs a | 
 |  1058 // BitrateController. | 
 |  1059 class NullBitrateController : public BitrateController { | 
 |  1060  public: | 
 |  1061   ~NullBitrateController() override {} | 
 |  1062   RtcpBandwidthObserver* CreateRtcpBandwidthObserver() override { | 
 |  1063     return nullptr; | 
 |  1064   } | 
 |  1065   void SetStartBitrate(int start_bitrate_bps) override {} | 
 |  1066   void SetMinMaxBitrate(int min_bitrate_bps, int max_bitrate_bps) override {} | 
 |  1067   void SetBitrates(int start_bitrate_bps, | 
 |  1068                    int min_bitrate_bps, | 
 |  1069                    int max_bitrate_bps) override {} | 
 |  1070   void ResetBitrates(int bitrate_bps, | 
 |  1071                      int min_bitrate_bps, | 
 |  1072                      int max_bitrate_bps) override {} | 
 |  1073   void OnDelayBasedBweResult(const DelayBasedBwe::Result& result) override {} | 
 |  1074   bool AvailableBandwidth(uint32_t* bandwidth) const override { return false; } | 
 |  1075   void SetReservedBitrate(uint32_t reserved_bitrate_bps) override {} | 
 |  1076   bool GetNetworkParameters(uint32_t* bitrate, | 
 |  1077                             uint8_t* fraction_loss, | 
 |  1078                             int64_t* rtt) override { | 
 |  1079     return false; | 
 |  1080   } | 
 |  1081   int64_t TimeUntilNextProcess() override { return 0; } | 
 |  1082   void Process() override {} | 
 |  1083 }; | 
 |  1084  | 
|  1056 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { |  1085 void EventLogAnalyzer::CreateNetworkDelayFeedbackGraph(Plot* plot) { | 
|  1057   std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; |  1086   std::map<uint64_t, const LoggedRtpPacket*> outgoing_rtp; | 
|  1058   std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; |  1087   std::map<uint64_t, const LoggedRtcpPacket*> incoming_rtcp; | 
|  1059  |  1088  | 
|  1060   for (const auto& kv : rtp_packets_) { |  1089   for (const auto& kv : rtp_packets_) { | 
|  1061     if (kv.first.GetDirection() == PacketDirection::kOutgoingPacket) { |  1090     if (kv.first.GetDirection() == PacketDirection::kOutgoingPacket) { | 
|  1062       for (const LoggedRtpPacket& rtp_packet : kv.second) |  1091       for (const LoggedRtpPacket& rtp_packet : kv.second) | 
|  1063         outgoing_rtp.insert(std::make_pair(rtp_packet.timestamp, &rtp_packet)); |  1092         outgoing_rtp.insert(std::make_pair(rtp_packet.timestamp, &rtp_packet)); | 
|  1064     } |  1093     } | 
|  1065   } |  1094   } | 
|  1066  |  1095  | 
|  1067   for (const auto& kv : rtcp_packets_) { |  1096   for (const auto& kv : rtcp_packets_) { | 
|  1068     if (kv.first.GetDirection() == PacketDirection::kIncomingPacket) { |  1097     if (kv.first.GetDirection() == PacketDirection::kIncomingPacket) { | 
|  1069       for (const LoggedRtcpPacket& rtcp_packet : kv.second) |  1098       for (const LoggedRtcpPacket& rtcp_packet : kv.second) | 
|  1070         incoming_rtcp.insert( |  1099         incoming_rtcp.insert( | 
|  1071             std::make_pair(rtcp_packet.timestamp, &rtcp_packet)); |  1100             std::make_pair(rtcp_packet.timestamp, &rtcp_packet)); | 
|  1072     } |  1101     } | 
|  1073   } |  1102   } | 
|  1074  |  1103  | 
|  1075   SimulatedClock clock(0); |  1104   SimulatedClock clock(0); | 
|  1076   TransportFeedbackAdapter feedback_adapter(&clock); |  1105   NullBitrateController null_controller; | 
 |  1106   TransportFeedbackAdapter feedback_adapter(&clock, &null_controller); | 
|  1077  |  1107  | 
|  1078   TimeSeries time_series; |  1108   TimeSeries time_series; | 
|  1079   time_series.label = "Network Delay Change"; |  1109   time_series.label = "Network Delay Change"; | 
|  1080   time_series.style = LINE_DOT_GRAPH; |  1110   time_series.style = LINE_DOT_GRAPH; | 
|  1081   int64_t estimated_base_delay_ms = std::numeric_limits<int64_t>::max(); |  1111   int64_t estimated_base_delay_ms = std::numeric_limits<int64_t>::max(); | 
|  1082  |  1112  | 
|  1083   auto rtp_iterator = outgoing_rtp.begin(); |  1113   auto rtp_iterator = outgoing_rtp.begin(); | 
|  1084   auto rtcp_iterator = incoming_rtcp.begin(); |  1114   auto rtcp_iterator = incoming_rtcp.begin(); | 
|  1085  |  1115  | 
|  1086   auto NextRtpTime = [&]() { |  1116   auto NextRtpTime = [&]() { | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1137     point.y -= estimated_base_delay_ms; |  1167     point.y -= estimated_base_delay_ms; | 
|  1138   // Add the data set to the plot. |  1168   // Add the data set to the plot. | 
|  1139   plot->series_list_.push_back(std::move(time_series)); |  1169   plot->series_list_.push_back(std::move(time_series)); | 
|  1140  |  1170  | 
|  1141   plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |  1171   plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 
|  1142   plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); |  1172   plot->SetSuggestedYAxis(0, 10, "Delay (ms)", kBottomMargin, kTopMargin); | 
|  1143   plot->SetTitle("Network Delay Change."); |  1173   plot->SetTitle("Network Delay Change."); | 
|  1144 } |  1174 } | 
|  1145 }  // namespace plotting |  1175 }  // namespace plotting | 
|  1146 }  // namespace webrtc |  1176 }  // namespace webrtc | 
| OLD | NEW |