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)."); |
stefan | e372d3c | 2017-02-02 08:04:18 -0800 | [diff] [blame] | 91 | DEFINE_bool(plot_timestamps, |
| 92 | false, |
| 93 | "Plot the rtp timestamps of all rtp and rtcp packets over time."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 94 | DEFINE_bool(plot_audio_encoder_bitrate_bps, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 95 | false, |
| 96 | "Plot the audio encoder target bitrate."); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 97 | DEFINE_bool(plot_audio_encoder_frame_length_ms, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 98 | false, |
| 99 | "Plot the audio encoder frame length."); |
| 100 | DEFINE_bool( |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 101 | plot_audio_encoder_packet_loss, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 102 | false, |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 103 | "Plot the uplink packet loss fraction which is sent to the audio encoder."); |
| 104 | DEFINE_bool(plot_audio_encoder_fec, false, "Plot the audio encoder FEC."); |
| 105 | DEFINE_bool(plot_audio_encoder_dtx, false, "Plot the audio encoder DTX."); |
| 106 | DEFINE_bool(plot_audio_encoder_num_channels, |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 107 | false, |
| 108 | "Plot the audio encoder number of channels."); |
henrik.lundin | 3c938fc | 2017-06-14 06:09:58 -0700 | [diff] [blame] | 109 | DEFINE_bool(plot_audio_jitter_buffer, |
| 110 | false, |
| 111 | "Plot the audio jitter buffer delay profile."); |
Bjorn Terelius | 1edfff9 | 2017-10-11 13:15:19 +0200 | [diff] [blame] | 112 | |
stefan | 985d280 | 2016-11-15 06:54:09 -0800 | [diff] [blame] | 113 | DEFINE_string( |
| 114 | force_fieldtrials, |
| 115 | "", |
| 116 | "Field trials control experimental feature code which can be forced. " |
| 117 | "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/" |
| 118 | " will assign the group Enabled to field trial WebRTC-FooFeature. Multiple " |
| 119 | "trials are separated by \"/\""); |
owb | 7fbeb0b | 2017-08-16 02:48:33 -0700 | [diff] [blame] | 120 | DEFINE_string(wav_filename, |
| 121 | "", |
| 122 | "Path to wav file used for simulation of jitter buffer"); |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 123 | DEFINE_bool(help, false, "prints this message"); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 124 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 125 | DEFINE_bool(show_detector_state, |
| 126 | false, |
| 127 | "Show the state of the delay based BWE detector on the total " |
| 128 | "bitrate graph"); |
| 129 | |
| 130 | void SetAllPlotFlags(bool setting); |
| 131 | |
philipel | 23c7f25 | 2017-07-14 06:30:03 -0700 | [diff] [blame] | 132 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 133 | int main(int argc, char* argv[]) { |
| 134 | std::string program_name = argv[0]; |
| 135 | std::string usage = |
| 136 | "A tool for visualizing WebRTC event logs.\n" |
| 137 | "Example usage:\n" + |
| 138 | program_name + " <logfile> | python\n" + "Run " + program_name + |
| 139 | " --help for a list of command line options\n"; |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 140 | |
| 141 | // Parse command line flags without removing them. We're only interested in |
| 142 | // the |plot_profile| flag. |
| 143 | rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, false); |
| 144 | if (strcmp(FLAG_plot_profile, "all") == 0) { |
| 145 | SetAllPlotFlags(true); |
| 146 | } else if (strcmp(FLAG_plot_profile, "none") == 0) { |
| 147 | SetAllPlotFlags(false); |
Bjorn Terelius | 1edfff9 | 2017-10-11 13:15:19 +0200 | [diff] [blame] | 148 | } else if (strcmp(FLAG_plot_profile, "sendside_bwe") == 0) { |
| 149 | SetAllPlotFlags(false); |
| 150 | FLAG_plot_outgoing_packet_sizes = true; |
| 151 | FLAG_plot_outgoing_bitrate = true; |
| 152 | FLAG_plot_outgoing_stream_bitrate = true; |
| 153 | FLAG_plot_simulated_sendside_bwe = true; |
| 154 | FLAG_plot_network_delay_feedback = true; |
| 155 | FLAG_plot_fraction_loss_feedback = true; |
| 156 | } else if (strcmp(FLAG_plot_profile, "receiveside_bwe") == 0) { |
| 157 | SetAllPlotFlags(false); |
| 158 | FLAG_plot_incoming_packet_sizes = true; |
| 159 | FLAG_plot_incoming_delay_delta = true; |
| 160 | FLAG_plot_incoming_delay = true; |
| 161 | FLAG_plot_incoming_loss_rate = true; |
| 162 | FLAG_plot_incoming_bitrate = true; |
| 163 | FLAG_plot_incoming_stream_bitrate = true; |
| 164 | FLAG_plot_simulated_receiveside_bwe = true; |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 165 | } else if (strcmp(FLAG_plot_profile, "default") == 0) { |
| 166 | // Do nothing. |
| 167 | } else { |
| 168 | rtc::Flag* plot_profile_flag = rtc::FlagList::Lookup("plot_profile"); |
| 169 | RTC_CHECK(plot_profile_flag); |
| 170 | plot_profile_flag->Print(false); |
| 171 | } |
| 172 | // Parse the remaining flags. They are applied relative to the chosen profile. |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 173 | rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 174 | |
terelius | c4a5c14 | 2017-07-20 08:05:09 -0700 | [diff] [blame] | 175 | if (argc != 2 || FLAG_help) { |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 176 | // Print usage information. |
| 177 | std::cout << usage; |
terelius | c4a5c14 | 2017-07-20 08:05:09 -0700 | [diff] [blame] | 178 | if (FLAG_help) |
| 179 | rtc::FlagList::Print(nullptr, false); |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 180 | return 0; |
| 181 | } |
| 182 | |
henrik.lundin | 3c938fc | 2017-06-14 06:09:58 -0700 | [diff] [blame] | 183 | webrtc::test::SetExecutablePath(argv[0]); |
kjellander | 4fa5be4 | 2017-05-16 00:01:23 -0700 | [diff] [blame] | 184 | webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); |
stefan | 985d280 | 2016-11-15 06:54:09 -0800 | [diff] [blame] | 185 | |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 186 | std::string filename = argv[1]; |
| 187 | |
| 188 | webrtc::ParsedRtcEventLog parsed_log; |
| 189 | |
| 190 | if (!parsed_log.ParseFile(filename)) { |
| 191 | std::cerr << "Could not parse the entire log file." << std::endl; |
| 192 | std::cerr << "Proceeding to analyze the first " |
| 193 | << parsed_log.GetNumberOfEvents() << " events in the file." |
| 194 | << std::endl; |
| 195 | } |
| 196 | |
| 197 | webrtc::plotting::EventLogAnalyzer analyzer(parsed_log); |
| 198 | std::unique_ptr<webrtc::plotting::PlotCollection> collection( |
| 199 | new webrtc::plotting::PythonPlotCollection()); |
| 200 | |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 201 | if (FLAG_plot_incoming_packet_sizes) { |
| 202 | analyzer.CreatePacketGraph(webrtc::PacketDirection::kIncomingPacket, |
| 203 | collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 204 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 205 | if (FLAG_plot_outgoing_packet_sizes) { |
| 206 | analyzer.CreatePacketGraph(webrtc::PacketDirection::kOutgoingPacket, |
| 207 | collection->AppendNewPlot()); |
| 208 | } |
| 209 | if (FLAG_plot_incoming_packet_count) { |
| 210 | analyzer.CreateAccumulatedPacketsGraph( |
| 211 | webrtc::PacketDirection::kIncomingPacket, collection->AppendNewPlot()); |
| 212 | } |
| 213 | if (FLAG_plot_outgoing_packet_count) { |
| 214 | analyzer.CreateAccumulatedPacketsGraph( |
| 215 | webrtc::PacketDirection::kOutgoingPacket, collection->AppendNewPlot()); |
| 216 | } |
| 217 | if (FLAG_plot_audio_playout) { |
terelius | dc35dcd | 2016-08-01 12:03:27 -0700 | [diff] [blame] | 218 | analyzer.CreatePlayoutGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 219 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 220 | if (FLAG_plot_audio_level) { |
ivoc | aac9d6f | 2016-09-22 07:01:47 -0700 | [diff] [blame] | 221 | analyzer.CreateAudioLevelGraph(collection->AppendNewPlot()); |
| 222 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 223 | if (FLAG_plot_incoming_sequence_number_delta) { |
| 224 | analyzer.CreateSequenceNumberGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 225 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 226 | if (FLAG_plot_incoming_delay_delta) { |
| 227 | analyzer.CreateIncomingDelayDeltaGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 228 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 229 | if (FLAG_plot_incoming_delay) { |
| 230 | analyzer.CreateIncomingDelayGraph(collection->AppendNewPlot()); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 231 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 232 | if (FLAG_plot_incoming_loss_rate) { |
Stefan Holmer | 99f8e08 | 2016-09-09 13:37:50 +0200 | [diff] [blame] | 233 | analyzer.CreateIncomingPacketLossGraph(collection->AppendNewPlot()); |
terelius | f736d23 | 2016-08-04 10:00:11 -0700 | [diff] [blame] | 234 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 235 | if (FLAG_plot_incoming_bitrate) { |
| 236 | analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kIncomingPacket, |
| 237 | collection->AppendNewPlot(), |
| 238 | FLAG_show_detector_state); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 239 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 240 | if (FLAG_plot_outgoing_bitrate) { |
| 241 | analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kOutgoingPacket, |
| 242 | collection->AppendNewPlot(), |
| 243 | FLAG_show_detector_state); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 244 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 245 | if (FLAG_plot_incoming_stream_bitrate) { |
| 246 | analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kIncomingPacket, |
| 247 | collection->AppendNewPlot()); |
| 248 | } |
| 249 | if (FLAG_plot_outgoing_stream_bitrate) { |
| 250 | analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kOutgoingPacket, |
| 251 | collection->AppendNewPlot()); |
| 252 | } |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 253 | if (FLAG_plot_simulated_receiveside_bwe) { |
| 254 | analyzer.CreateReceiveSideBweSimulationGraph(collection->AppendNewPlot()); |
| 255 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 256 | if (FLAG_plot_simulated_sendside_bwe) { |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 257 | analyzer.CreateSendSideBweSimulationGraph(collection->AppendNewPlot()); |
Stefan Holmer | 1318103 | 2016-07-29 14:48:54 +0200 | [diff] [blame] | 258 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 259 | if (FLAG_plot_network_delay_feedback) { |
terelius | e34c19c | 2016-08-15 08:47:14 -0700 | [diff] [blame] | 260 | analyzer.CreateNetworkDelayFeedbackGraph(collection->AppendNewPlot()); |
stefan | c3de033 | 2016-08-02 07:22:17 -0700 | [diff] [blame] | 261 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 262 | if (FLAG_plot_fraction_loss_feedback) { |
| 263 | analyzer.CreateFractionLossGraph(collection->AppendNewPlot()); |
| 264 | } |
| 265 | if (FLAG_plot_timestamps) { |
stefan | e372d3c | 2017-02-02 08:04:18 -0800 | [diff] [blame] | 266 | analyzer.CreateTimestampGraph(collection->AppendNewPlot()); |
| 267 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 268 | if (FLAG_plot_audio_encoder_bitrate_bps) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 269 | analyzer.CreateAudioEncoderTargetBitrateGraph(collection->AppendNewPlot()); |
| 270 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 271 | if (FLAG_plot_audio_encoder_frame_length_ms) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 272 | analyzer.CreateAudioEncoderFrameLengthGraph(collection->AppendNewPlot()); |
| 273 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 274 | if (FLAG_plot_audio_encoder_packet_loss) { |
| 275 | analyzer.CreateAudioEncoderPacketLossGraph(collection->AppendNewPlot()); |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 276 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 277 | if (FLAG_plot_audio_encoder_fec) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 278 | analyzer.CreateAudioEncoderEnableFecGraph(collection->AppendNewPlot()); |
| 279 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 280 | if (FLAG_plot_audio_encoder_dtx) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 281 | analyzer.CreateAudioEncoderEnableDtxGraph(collection->AppendNewPlot()); |
| 282 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 283 | if (FLAG_plot_audio_encoder_num_channels) { |
michaelt | 6e5b219 | 2017-02-22 07:33:27 -0800 | [diff] [blame] | 284 | analyzer.CreateAudioEncoderNumChannelsGraph(collection->AppendNewPlot()); |
| 285 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 286 | if (FLAG_plot_audio_jitter_buffer) { |
owb | 7fbeb0b | 2017-08-16 02:48:33 -0700 | [diff] [blame] | 287 | std::string wav_path; |
| 288 | if (FLAG_wav_filename[0] != '\0') { |
| 289 | wav_path = FLAG_wav_filename; |
| 290 | } else { |
| 291 | wav_path = webrtc::test::ResourcePath( |
| 292 | "audio_processing/conversational_speech/EN_script2_F_sp2_B1", "wav"); |
| 293 | } |
| 294 | analyzer.CreateAudioJitterBufferGraph(wav_path, 48000, |
| 295 | collection->AppendNewPlot()); |
henrik.lundin | 3c938fc | 2017-06-14 06:09:58 -0700 | [diff] [blame] | 296 | } |
| 297 | |
terelius | dc35dcd | 2016-08-01 12:03:27 -0700 | [diff] [blame] | 298 | collection->Draw(); |
terelius | 54ce680 | 2016-07-13 06:44:41 -0700 | [diff] [blame] | 299 | |
| 300 | return 0; |
| 301 | } |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 302 | |
| 303 | |
| 304 | void SetAllPlotFlags(bool setting) { |
| 305 | FLAG_plot_incoming_packet_sizes = setting; |
| 306 | FLAG_plot_outgoing_packet_sizes = setting; |
| 307 | FLAG_plot_incoming_packet_count = setting; |
| 308 | FLAG_plot_outgoing_packet_count = setting; |
| 309 | FLAG_plot_audio_playout = setting; |
| 310 | FLAG_plot_audio_level = setting; |
| 311 | FLAG_plot_incoming_sequence_number_delta = setting; |
| 312 | FLAG_plot_incoming_delay_delta = setting; |
| 313 | FLAG_plot_incoming_delay = setting; |
| 314 | FLAG_plot_incoming_loss_rate = setting; |
| 315 | FLAG_plot_incoming_bitrate = setting; |
| 316 | FLAG_plot_outgoing_bitrate = setting; |
| 317 | FLAG_plot_incoming_stream_bitrate = setting; |
| 318 | FLAG_plot_outgoing_stream_bitrate = setting; |
Bjorn Terelius | 28db266 | 2017-10-04 14:22:43 +0200 | [diff] [blame] | 319 | FLAG_plot_simulated_receiveside_bwe = setting; |
terelius | 2ee076d | 2017-08-15 02:04:02 -0700 | [diff] [blame] | 320 | FLAG_plot_simulated_sendside_bwe = setting; |
| 321 | FLAG_plot_network_delay_feedback = setting; |
| 322 | FLAG_plot_fraction_loss_feedback = setting; |
| 323 | FLAG_plot_timestamps = setting; |
| 324 | FLAG_plot_audio_encoder_bitrate_bps = setting; |
| 325 | FLAG_plot_audio_encoder_frame_length_ms = setting; |
| 326 | FLAG_plot_audio_encoder_packet_loss = setting; |
| 327 | FLAG_plot_audio_encoder_fec = setting; |
| 328 | FLAG_plot_audio_encoder_dtx = setting; |
| 329 | FLAG_plot_audio_encoder_num_channels = setting; |
| 330 | FLAG_plot_audio_jitter_buffer = setting; |
| 331 | } |