terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include <iostream> |
| 12 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 13 | #include "logging/rtc_event_log/rtc_event_log_parser.h" |
| 14 | #include "rtc_base/flags.h" |
| 15 | #include "rtc_tools/event_log_visualizer/analyzer.h" |
| 16 | #include "rtc_tools/event_log_visualizer/plot_base.h" |
| 17 | #include "rtc_tools/event_log_visualizer/plot_python.h" |
| 18 | #include "test/field_trial.h" |
| 19 | #include "test/testsupport/fileutils.h" |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 20 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 21 | DEFINE_string(plot_profile, |
| 22 | "default", |
| 23 | "A profile that selects a certain subset of the plots. Currently " |
Bjorn Terelius | 1edfff9 | 2017-10-11 13:15:19 +0200 | [diff] [blame] | 24 | "defined profiles are \"all\", \"none\", \"sendside_bwe\"," |
| 25 | "\"receiveside_bwe\" and \"default\""); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 26 | |
| 27 | DEFINE_bool(plot_incoming_packet_sizes, |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 28 | false, |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 29 | "Plot bar graph showing the size of each incoming packet."); |
| 30 | DEFINE_bool(plot_outgoing_packet_sizes, |
| 31 | false, |
| 32 | "Plot bar graph showing the size of each outgoing packet."); |
| 33 | DEFINE_bool(plot_incoming_packet_count, |
| 34 | false, |
| 35 | "Plot the accumulated number of packets for each incoming stream."); |
| 36 | DEFINE_bool(plot_outgoing_packet_count, |
| 37 | false, |
| 38 | "Plot the accumulated number of packets for each outgoing stream."); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 39 | DEFINE_bool(plot_audio_playout, |
| 40 | false, |
| 41 | "Plot bar graph showing the time between each audio playout."); |
ivoc | aac9d6f | 2016-09-22 07:01:47 -0700 | [diff] [blame] | 42 | DEFINE_bool(plot_audio_level, |
| 43 | false, |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 44 | "Plot line graph showing the audio level of incoming audio."); |
| 45 | DEFINE_bool(plot_incoming_sequence_number_delta, |
| 46 | false, |
| 47 | "Plot the sequence number difference between consecutive incoming " |
| 48 | "packets."); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 49 | DEFINE_bool( |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 50 | plot_incoming_delay_delta, |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 51 | false, |
| 52 | "Plot the difference in 1-way path delay between consecutive packets."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 53 | DEFINE_bool(plot_incoming_delay, |
| 54 | true, |
| 55 | "Plot the 1-way path delay for incoming packets, normalized so " |
| 56 | "that the first packet has delay 0."); |
| 57 | DEFINE_bool(plot_incoming_loss_rate, |
| 58 | true, |
| 59 | "Compute the loss rate for incoming packets using a method that's " |
| 60 | "similar to the one used for RTCP SR and RR fraction lost. Note " |
| 61 | "that the loss rate can be negative if packets are duplicated or " |
| 62 | "reordered."); |
| 63 | DEFINE_bool(plot_incoming_bitrate, |
| 64 | true, |
| 65 | "Plot the total bitrate used by all incoming streams."); |
| 66 | DEFINE_bool(plot_outgoing_bitrate, |
| 67 | true, |
| 68 | "Plot the total bitrate used by all outgoing streams."); |
| 69 | DEFINE_bool(plot_incoming_stream_bitrate, |
| 70 | true, |
| 71 | "Plot the bitrate used by each incoming stream."); |
| 72 | DEFINE_bool(plot_outgoing_stream_bitrate, |
| 73 | true, |
| 74 | "Plot the bitrate used by each outgoing stream."); |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 75 | DEFINE_bool(plot_simulated_receiveside_bwe, |
| 76 | false, |
| 77 | "Run the receive-side bandwidth estimator with the incoming rtp " |
| 78 | "packets and plot the resulting estimate."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 79 | DEFINE_bool(plot_simulated_sendside_bwe, |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 80 | false, |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 81 | "Run the send-side bandwidth estimator with the outgoing rtp and " |
| 82 | "incoming rtcp and plot the resulting estimate."); |
stefan | c3de033 | 2016-08-02 07:22:17 -0700 | [diff] [blame] | 83 | DEFINE_bool(plot_network_delay_feedback, |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 84 | true, |
stefan | c3de033 | 2016-08-02 07:22:17 -0700 | [diff] [blame] | 85 | "Compute network delay based on sent packets and the received " |
| 86 | "transport feedback."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 87 | DEFINE_bool(plot_fraction_loss_feedback, |
| 88 | true, |
terelius | f736d23 | 2016-08-04 10:00:11 -0700 | [diff] [blame] | 89 | "Plot packet loss in percent for outgoing packets (as perceived by " |
| 90 | "the send-side bandwidth estimator)."); |
Bjorn Terelius | 0295a96 | 2017-10-25 17:42:41 +0200 | [diff] [blame] | 91 | DEFINE_bool(plot_pacer_delay, |
| 92 | false, |
| 93 | "Plot the time each sent packet has spent in the pacer (based on " |
| 94 | "the difference between the RTP timestamp and the send " |
| 95 | "timestamp)."); |
stefan | e372d3c | 2017-02-02 08:04:18 -0800 | [diff] [blame] | 96 | DEFINE_bool(plot_timestamps, |
| 97 | false, |
| 98 | "Plot the rtp timestamps of all rtp and rtcp packets over time."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 99 | DEFINE_bool(plot_audio_encoder_bitrate_bps, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 100 | false, |
| 101 | "Plot the audio encoder target bitrate."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 102 | DEFINE_bool(plot_audio_encoder_frame_length_ms, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 103 | false, |
| 104 | "Plot the audio encoder frame length."); |
| 105 | DEFINE_bool( |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 106 | plot_audio_encoder_packet_loss, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 107 | false, |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 108 | "Plot the uplink packet loss fraction which is sent to the audio encoder."); |
| 109 | DEFINE_bool(plot_audio_encoder_fec, false, "Plot the audio encoder FEC."); |
| 110 | DEFINE_bool(plot_audio_encoder_dtx, false, "Plot the audio encoder DTX."); |
| 111 | DEFINE_bool(plot_audio_encoder_num_channels, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 112 | false, |
| 113 | "Plot the audio encoder number of channels."); |
henrik.lundin | 3c938fc | 2017-06-14 06:09:58 -0700 | [diff] [blame] | 114 | DEFINE_bool(plot_audio_jitter_buffer, |
| 115 | false, |
| 116 | "Plot the audio jitter buffer delay profile."); |
Bjorn Terelius | 1edfff9 | 2017-10-11 13:15:19 +0200 | [diff] [blame] | 117 | |
stefan | 985d280 | 2016-11-15 06:54:09 -0800 | [diff] [blame] | 118 | DEFINE_string( |
| 119 | force_fieldtrials, |
| 120 | "", |
| 121 | "Field trials control experimental feature code which can be forced. " |
| 122 | "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/" |
| 123 | " will assign the group Enabled to field trial WebRTC-FooFeature. Multiple " |
| 124 | "trials are separated by \"/\""); |
owb | 7fbeb0b | 2017-08-16 02:48:33 -0700 | [diff] [blame] | 125 | DEFINE_string(wav_filename, |
| 126 | "", |
| 127 | "Path to wav file used for simulation of jitter buffer"); |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 128 | DEFINE_bool(help, false, "prints this message"); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 129 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 130 | DEFINE_bool(show_detector_state, |
| 131 | false, |
| 132 | "Show the state of the delay based BWE detector on the total " |
| 133 | "bitrate graph"); |
| 134 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 135 | DEFINE_bool( |
| 136 | print_triage_notifications, |
| 137 | false, |
| 138 | "Print triage notifications, i.e. a list of suspicious looking events."); |
| 139 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 140 | void SetAllPlotFlags(bool setting); |
| 141 | |
philipel | 23c7f25 | 2017-07-14 06:30:03 -0700 | [diff] [blame] | 142 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 143 | int main(int argc, char* argv[]) { |
| 144 | std::string program_name = argv[0]; |
| 145 | std::string usage = |
| 146 | "A tool for visualizing WebRTC event logs.\n" |
| 147 | "Example usage:\n" + |
| 148 | program_name + " <logfile> | python\n" + "Run " + program_name + |
| 149 | " --help for a list of command line options\n"; |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 150 | |
| 151 | // Parse command line flags without removing them. We're only interested in |
| 152 | // the |plot_profile| flag. |
| 153 | rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, false); |
| 154 | if (strcmp(FLAG_plot_profile, "all") == 0) { |
| 155 | SetAllPlotFlags(true); |
| 156 | } else if (strcmp(FLAG_plot_profile, "none") == 0) { |
| 157 | SetAllPlotFlags(false); |
Bjorn Terelius | 1edfff9 | 2017-10-11 13:15:19 +0200 | [diff] [blame] | 158 | } else if (strcmp(FLAG_plot_profile, "sendside_bwe") == 0) { |
| 159 | SetAllPlotFlags(false); |
| 160 | FLAG_plot_outgoing_packet_sizes = true; |
| 161 | FLAG_plot_outgoing_bitrate = true; |
| 162 | FLAG_plot_outgoing_stream_bitrate = true; |
| 163 | FLAG_plot_simulated_sendside_bwe = true; |
| 164 | FLAG_plot_network_delay_feedback = true; |
| 165 | FLAG_plot_fraction_loss_feedback = true; |
| 166 | } else if (strcmp(FLAG_plot_profile, "receiveside_bwe") == 0) { |
| 167 | SetAllPlotFlags(false); |
| 168 | FLAG_plot_incoming_packet_sizes = true; |
| 169 | FLAG_plot_incoming_delay_delta = true; |
| 170 | FLAG_plot_incoming_delay = true; |
| 171 | FLAG_plot_incoming_loss_rate = true; |
| 172 | FLAG_plot_incoming_bitrate = true; |
| 173 | FLAG_plot_incoming_stream_bitrate = true; |
| 174 | FLAG_plot_simulated_receiveside_bwe = true; |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 175 | } else if (strcmp(FLAG_plot_profile, "default") == 0) { |
| 176 | // Do nothing. |
| 177 | } else { |
| 178 | rtc::Flag* plot_profile_flag = rtc::FlagList::Lookup("plot_profile"); |
| 179 | RTC_CHECK(plot_profile_flag); |
| 180 | plot_profile_flag->Print(false); |
| 181 | } |
| 182 | // Parse the remaining flags. They are applied relative to the chosen profile. |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 183 | rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 184 | |
terelius | c4a5c14 | 2017-07-20 08:05:09 -0700 | [diff] [blame] | 185 | if (argc != 2 || FLAG_help) { |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 186 | // Print usage information. |
| 187 | std::cout << usage; |
terelius | c4a5c14 | 2017-07-20 08:05:09 -0700 | [diff] [blame] | 188 | if (FLAG_help) |
| 189 | rtc::FlagList::Print(nullptr, false); |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 190 | return 0; |
| 191 | } |
| 192 | |
henrik.lundin | 3c938fc | 2017-06-14 06:09:58 -0700 | [diff] [blame] | 193 | webrtc::test::SetExecutablePath(argv[0]); |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 194 | webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); |
stefan | 985d280 | 2016-11-15 06:54:09 -0800 | [diff] [blame] | 195 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 196 | std::string filename = argv[1]; |
| 197 | |
| 198 | webrtc::ParsedRtcEventLog parsed_log; |
| 199 | |
| 200 | if (!parsed_log.ParseFile(filename)) { |
| 201 | std::cerr << "Could not parse the entire log file." << std::endl; |
| 202 | std::cerr << "Proceeding to analyze the first " |
| 203 | << parsed_log.GetNumberOfEvents() << " events in the file." |
| 204 | << std::endl; |
| 205 | } |
| 206 | |
| 207 | webrtc::plotting::EventLogAnalyzer analyzer(parsed_log); |
| 208 | std::unique_ptr<webrtc::plotting::PlotCollection> collection( |
| 209 | new webrtc::plotting::PythonPlotCollection()); |
| 210 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 211 | if (FLAG_plot_incoming_packet_sizes) { |
| 212 | analyzer.CreatePacketGraph(webrtc::PacketDirection::kIncomingPacket, |
| 213 | collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 214 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 215 | if (FLAG_plot_outgoing_packet_sizes) { |
| 216 | analyzer.CreatePacketGraph(webrtc::PacketDirection::kOutgoingPacket, |
| 217 | collection->AppendNewPlot()); |
| 218 | } |
| 219 | if (FLAG_plot_incoming_packet_count) { |
| 220 | analyzer.CreateAccumulatedPacketsGraph( |
| 221 | webrtc::PacketDirection::kIncomingPacket, collection->AppendNewPlot()); |
| 222 | } |
| 223 | if (FLAG_plot_outgoing_packet_count) { |
| 224 | analyzer.CreateAccumulatedPacketsGraph( |
| 225 | webrtc::PacketDirection::kOutgoingPacket, collection->AppendNewPlot()); |
| 226 | } |
| 227 | if (FLAG_plot_audio_playout) { |
terelius | dc35dcd | 2016-08-01 12:03:27 -0700 | [diff] [blame] | 228 | analyzer.CreatePlayoutGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 229 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 230 | if (FLAG_plot_audio_level) { |
ivoc | aac9d6f | 2016-09-22 07:01:47 -0700 | [diff] [blame] | 231 | analyzer.CreateAudioLevelGraph(collection->AppendNewPlot()); |
| 232 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 233 | if (FLAG_plot_incoming_sequence_number_delta) { |
| 234 | analyzer.CreateSequenceNumberGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 235 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 236 | if (FLAG_plot_incoming_delay_delta) { |
| 237 | analyzer.CreateIncomingDelayDeltaGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 238 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 239 | if (FLAG_plot_incoming_delay) { |
| 240 | analyzer.CreateIncomingDelayGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 241 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 242 | if (FLAG_plot_incoming_loss_rate) { |
Stefan Holmer | 99f8e08 | 2016-09-09 13:37:50 +0200 | [diff] [blame] | 243 | analyzer.CreateIncomingPacketLossGraph(collection->AppendNewPlot()); |
terelius | f736d23 | 2016-08-04 10:00:11 -0700 | [diff] [blame] | 244 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 245 | if (FLAG_plot_incoming_bitrate) { |
| 246 | analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kIncomingPacket, |
| 247 | collection->AppendNewPlot(), |
| 248 | FLAG_show_detector_state); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 249 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 250 | if (FLAG_plot_outgoing_bitrate) { |
| 251 | analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kOutgoingPacket, |
| 252 | collection->AppendNewPlot(), |
| 253 | FLAG_show_detector_state); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 254 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 255 | if (FLAG_plot_incoming_stream_bitrate) { |
| 256 | analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kIncomingPacket, |
| 257 | collection->AppendNewPlot()); |
| 258 | } |
| 259 | if (FLAG_plot_outgoing_stream_bitrate) { |
| 260 | analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kOutgoingPacket, |
| 261 | collection->AppendNewPlot()); |
| 262 | } |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 263 | if (FLAG_plot_simulated_receiveside_bwe) { |
| 264 | analyzer.CreateReceiveSideBweSimulationGraph(collection->AppendNewPlot()); |
| 265 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 266 | if (FLAG_plot_simulated_sendside_bwe) { |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 267 | analyzer.CreateSendSideBweSimulationGraph(collection->AppendNewPlot()); |
Stefan Holmer | 1318103 | 2016-07-29 14:48:54 +0200 | [diff] [blame] | 268 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 269 | if (FLAG_plot_network_delay_feedback) { |
terelius | e34c19c | 2016-08-15 08:47:14 -0700 | [diff] [blame] | 270 | analyzer.CreateNetworkDelayFeedbackGraph(collection->AppendNewPlot()); |
stefan | c3de033 | 2016-08-02 07:22:17 -0700 | [diff] [blame] | 271 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 272 | if (FLAG_plot_fraction_loss_feedback) { |
| 273 | analyzer.CreateFractionLossGraph(collection->AppendNewPlot()); |
| 274 | } |
| 275 | if (FLAG_plot_timestamps) { |
stefan | e372d3c | 2017-02-02 08:04:18 -0800 | [diff] [blame] | 276 | analyzer.CreateTimestampGraph(collection->AppendNewPlot()); |
| 277 | } |
Bjorn Terelius | 0295a96 | 2017-10-25 17:42:41 +0200 | [diff] [blame] | 278 | if (FLAG_plot_pacer_delay) { |
| 279 | analyzer.CreatePacerDelayGraph(collection->AppendNewPlot()); |
| 280 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 281 | if (FLAG_plot_audio_encoder_bitrate_bps) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 282 | analyzer.CreateAudioEncoderTargetBitrateGraph(collection->AppendNewPlot()); |
| 283 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 284 | if (FLAG_plot_audio_encoder_frame_length_ms) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 285 | analyzer.CreateAudioEncoderFrameLengthGraph(collection->AppendNewPlot()); |
| 286 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 287 | if (FLAG_plot_audio_encoder_packet_loss) { |
| 288 | analyzer.CreateAudioEncoderPacketLossGraph(collection->AppendNewPlot()); |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 289 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 290 | if (FLAG_plot_audio_encoder_fec) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 291 | analyzer.CreateAudioEncoderEnableFecGraph(collection->AppendNewPlot()); |
| 292 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 293 | if (FLAG_plot_audio_encoder_dtx) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 294 | analyzer.CreateAudioEncoderEnableDtxGraph(collection->AppendNewPlot()); |
| 295 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 296 | if (FLAG_plot_audio_encoder_num_channels) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 297 | analyzer.CreateAudioEncoderNumChannelsGraph(collection->AppendNewPlot()); |
| 298 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 299 | if (FLAG_plot_audio_jitter_buffer) { |
owb | 7fbeb0b | 2017-08-16 02:48:33 -0700 | [diff] [blame] | 300 | std::string wav_path; |
| 301 | if (FLAG_wav_filename[0] != '\0') { |
| 302 | wav_path = FLAG_wav_filename; |
| 303 | } else { |
| 304 | wav_path = webrtc::test::ResourcePath( |
| 305 | "audio_processing/conversational_speech/EN_script2_F_sp2_B1", "wav"); |
| 306 | } |
| 307 | analyzer.CreateAudioJitterBufferGraph(wav_path, 48000, |
| 308 | collection->AppendNewPlot()); |
henrik.lundin | 3c938fc | 2017-06-14 06:09:58 -0700 | [diff] [blame] | 309 | } |
| 310 | |
terelius | dc35dcd | 2016-08-01 12:03:27 -0700 | [diff] [blame] | 311 | collection->Draw(); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 312 | |
Bjorn Terelius | 2eb3188 | 2017-11-30 15:15:25 +0100 | [diff] [blame] | 313 | if (FLAG_print_triage_notifications) { |
| 314 | analyzer.CreateTriageNotifications(); |
| 315 | analyzer.PrintNotifications(stderr); |
| 316 | } |
| 317 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 318 | return 0; |
| 319 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 320 | |
| 321 | |
| 322 | void SetAllPlotFlags(bool setting) { |
| 323 | FLAG_plot_incoming_packet_sizes = setting; |
| 324 | FLAG_plot_outgoing_packet_sizes = setting; |
| 325 | FLAG_plot_incoming_packet_count = setting; |
| 326 | FLAG_plot_outgoing_packet_count = setting; |
| 327 | FLAG_plot_audio_playout = setting; |
| 328 | FLAG_plot_audio_level = setting; |
| 329 | FLAG_plot_incoming_sequence_number_delta = setting; |
| 330 | FLAG_plot_incoming_delay_delta = setting; |
| 331 | FLAG_plot_incoming_delay = setting; |
| 332 | FLAG_plot_incoming_loss_rate = setting; |
| 333 | FLAG_plot_incoming_bitrate = setting; |
| 334 | FLAG_plot_outgoing_bitrate = setting; |
| 335 | FLAG_plot_incoming_stream_bitrate = setting; |
| 336 | FLAG_plot_outgoing_stream_bitrate = setting; |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 337 | FLAG_plot_simulated_receiveside_bwe = setting; |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 338 | FLAG_plot_simulated_sendside_bwe = setting; |
| 339 | FLAG_plot_network_delay_feedback = setting; |
| 340 | FLAG_plot_fraction_loss_feedback = setting; |
| 341 | FLAG_plot_timestamps = setting; |
| 342 | FLAG_plot_audio_encoder_bitrate_bps = setting; |
| 343 | FLAG_plot_audio_encoder_frame_length_ms = setting; |
| 344 | FLAG_plot_audio_encoder_packet_loss = setting; |
| 345 | FLAG_plot_audio_encoder_fec = setting; |
| 346 | FLAG_plot_audio_encoder_dtx = setting; |
| 347 | FLAG_plot_audio_encoder_num_channels = setting; |
| 348 | FLAG_plot_audio_jitter_buffer = setting; |
| 349 | } |