Chromium Code Reviews| 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 <iostream> | 11 #include <iostream> |
| 12 | 12 |
| 13 #include "webrtc/base/flags.h" | 13 #include "webrtc/base/flags.h" |
| 14 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" | 14 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" |
| 15 #include "webrtc/test/field_trial.h" | 15 #include "webrtc/test/field_trial.h" |
| 16 #include "webrtc/test/testsupport/fileutils.h" | |
| 16 #include "webrtc/tools/event_log_visualizer/analyzer.h" | 17 #include "webrtc/tools/event_log_visualizer/analyzer.h" |
| 17 #include "webrtc/tools/event_log_visualizer/plot_base.h" | 18 #include "webrtc/tools/event_log_visualizer/plot_base.h" |
| 18 #include "webrtc/tools/event_log_visualizer/plot_python.h" | 19 #include "webrtc/tools/event_log_visualizer/plot_python.h" |
| 19 | 20 |
| 20 DEFINE_bool(incoming, true, "Plot statistics for incoming packets."); | 21 DEFINE_bool(incoming, true, "Plot statistics for incoming packets."); |
| 21 DEFINE_bool(outgoing, true, "Plot statistics for outgoing packets."); | 22 DEFINE_bool(outgoing, true, "Plot statistics for outgoing packets."); |
| 22 DEFINE_bool(plot_all, true, "Plot all different data types."); | 23 DEFINE_bool(plot_all, true, "Plot all different data types."); |
| 23 DEFINE_bool(plot_packets, | 24 DEFINE_bool(plot_packets, |
| 24 false, | 25 false, |
| 25 "Plot bar graph showing the size of each packet."); | 26 "Plot bar graph showing the size of each packet."); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 "Plot the audio encoder frame length."); | 71 "Plot the audio encoder frame length."); |
| 71 DEFINE_bool( | 72 DEFINE_bool( |
| 72 audio_encoder_uplink_packet_loss_fraction, | 73 audio_encoder_uplink_packet_loss_fraction, |
| 73 false, | 74 false, |
| 74 "Plot the uplink packet loss fraction which is send to the audio encoder."); | 75 "Plot the uplink packet loss fraction which is send to the audio encoder."); |
| 75 DEFINE_bool(audio_encoder_fec, false, "Plot the audio encoder FEC."); | 76 DEFINE_bool(audio_encoder_fec, false, "Plot the audio encoder FEC."); |
| 76 DEFINE_bool(audio_encoder_dtx, false, "Plot the audio encoder DTX."); | 77 DEFINE_bool(audio_encoder_dtx, false, "Plot the audio encoder DTX."); |
| 77 DEFINE_bool(audio_encoder_num_channels, | 78 DEFINE_bool(audio_encoder_num_channels, |
| 78 false, | 79 false, |
| 79 "Plot the audio encoder number of channels."); | 80 "Plot the audio encoder number of channels."); |
| 81 DEFINE_bool(plot_audio_jitter_buffer, | |
| 82 false, | |
| 83 "Plot the audio jitter buffer delay profile."); | |
| 80 DEFINE_string( | 84 DEFINE_string( |
| 81 force_fieldtrials, | 85 force_fieldtrials, |
| 82 "", | 86 "", |
| 83 "Field trials control experimental feature code which can be forced. " | 87 "Field trials control experimental feature code which can be forced. " |
| 84 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/" | 88 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/" |
| 85 " will assign the group Enabled to field trial WebRTC-FooFeature. Multiple " | 89 " will assign the group Enabled to field trial WebRTC-FooFeature. Multiple " |
| 86 "trials are separated by \"/\""); | 90 "trials are separated by \"/\""); |
| 87 DEFINE_bool(help, false, "prints this message"); | 91 DEFINE_bool(help, false, "prints this message"); |
| 88 | 92 |
| 89 int main(int argc, char* argv[]) { | 93 int main(int argc, char* argv[]) { |
| 90 std::string program_name = argv[0]; | 94 std::string program_name = argv[0]; |
| 91 std::string usage = | 95 std::string usage = |
| 92 "A tool for visualizing WebRTC event logs.\n" | 96 "A tool for visualizing WebRTC event logs.\n" |
| 93 "Example usage:\n" + | 97 "Example usage:\n" + |
| 94 program_name + " <logfile> | python\n" + "Run " + program_name + | 98 program_name + " <logfile> | python\n" + "Run " + program_name + |
| 95 " --help for a list of command line options\n"; | 99 " --help for a list of command line options\n"; |
| 96 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 100 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| 97 if (FLAG_help) { | 101 if (FLAG_help) { |
| 98 rtc::FlagList::Print(nullptr, false); | 102 rtc::FlagList::Print(nullptr, false); |
| 99 return 0; | 103 return 0; |
| 100 } | 104 } |
| 101 | 105 |
| 102 if (argc != 2) { | 106 if (argc != 2) { |
| 103 // Print usage information. | 107 // Print usage information. |
| 104 std::cout << usage; | 108 std::cout << usage; |
| 105 return 0; | 109 return 0; |
| 106 } | 110 } |
| 107 | 111 |
| 112 webrtc::test::SetExecutablePath(argv[0]); | |
|
hlundin-webrtc
2017/06/08 09:54:55
This is needed to make webrtc::test::ResourcePath
| |
| 108 webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); | 113 webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); |
| 109 | 114 |
| 110 std::string filename = argv[1]; | 115 std::string filename = argv[1]; |
| 111 | 116 |
| 112 webrtc::ParsedRtcEventLog parsed_log; | 117 webrtc::ParsedRtcEventLog parsed_log; |
| 113 | 118 |
| 114 if (!parsed_log.ParseFile(filename)) { | 119 if (!parsed_log.ParseFile(filename)) { |
| 115 std::cerr << "Could not parse the entire log file." << std::endl; | 120 std::cerr << "Could not parse the entire log file." << std::endl; |
| 116 std::cerr << "Proceeding to analyze the first " | 121 std::cerr << "Proceeding to analyze the first " |
| 117 << parsed_log.GetNumberOfEvents() << " events in the file." | 122 << parsed_log.GetNumberOfEvents() << " events in the file." |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 } | 229 } |
| 225 | 230 |
| 226 if (FLAG_plot_all || FLAG_audio_encoder_dtx) { | 231 if (FLAG_plot_all || FLAG_audio_encoder_dtx) { |
| 227 analyzer.CreateAudioEncoderEnableDtxGraph(collection->AppendNewPlot()); | 232 analyzer.CreateAudioEncoderEnableDtxGraph(collection->AppendNewPlot()); |
| 228 } | 233 } |
| 229 | 234 |
| 230 if (FLAG_plot_all || FLAG_audio_encoder_num_channels) { | 235 if (FLAG_plot_all || FLAG_audio_encoder_num_channels) { |
| 231 analyzer.CreateAudioEncoderNumChannelsGraph(collection->AppendNewPlot()); | 236 analyzer.CreateAudioEncoderNumChannelsGraph(collection->AppendNewPlot()); |
| 232 } | 237 } |
| 233 | 238 |
| 239 if (FLAG_plot_all || FLAG_plot_audio_jitter_buffer) { | |
| 240 analyzer.CreateAudioJitterBufferGraph( | |
| 241 webrtc::test::ResourcePath( | |
| 242 "audio_processing/conversational_speech/EN_script2_F_sp2_B1", | |
| 243 "wav"), | |
| 244 48000, collection->AppendNewPlot()); | |
| 245 } | |
| 246 | |
| 234 collection->Draw(); | 247 collection->Draw(); |
| 235 | 248 |
| 236 return 0; | 249 return 0; |
| 237 } | 250 } |
| OLD | NEW |