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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 "Mark the delay based bwe detector state on the total bitrate graph"); | 96 "Mark the delay based bwe detector state on the total bitrate graph"); |
97 | 97 |
98 int main(int argc, char* argv[]) { | 98 int main(int argc, char* argv[]) { |
99 std::string program_name = argv[0]; | 99 std::string program_name = argv[0]; |
100 std::string usage = | 100 std::string usage = |
101 "A tool for visualizing WebRTC event logs.\n" | 101 "A tool for visualizing WebRTC event logs.\n" |
102 "Example usage:\n" + | 102 "Example usage:\n" + |
103 program_name + " <logfile> | python\n" + "Run " + program_name + | 103 program_name + " <logfile> | python\n" + "Run " + program_name + |
104 " --help for a list of command line options\n"; | 104 " --help for a list of command line options\n"; |
105 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 105 rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
106 if (FLAG_help) { | 106 if (argc != 2 || FLAG_help) { |
107 rtc::FlagList::Print(nullptr, false); | 107 // Print usage information. |
| 108 std::cout << usage; |
| 109 if (FLAG_help) |
| 110 rtc::FlagList::Print(nullptr, false); |
108 return 0; | 111 return 0; |
109 } | 112 } |
110 | 113 |
111 if (argc != 2) { | |
112 // Print usage information. | |
113 std::cout << usage; | |
114 return 0; | |
115 } | |
116 | |
117 webrtc::test::SetExecutablePath(argv[0]); | 114 webrtc::test::SetExecutablePath(argv[0]); |
118 webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); | 115 webrtc::test::InitFieldTrialsFromString(FLAG_force_fieldtrials); |
119 | 116 |
120 std::string filename = argv[1]; | 117 std::string filename = argv[1]; |
121 | 118 |
122 webrtc::ParsedRtcEventLog parsed_log; | 119 webrtc::ParsedRtcEventLog parsed_log; |
123 | 120 |
124 if (!parsed_log.ParseFile(filename)) { | 121 if (!parsed_log.ParseFile(filename)) { |
125 std::cerr << "Could not parse the entire log file." << std::endl; | 122 std::cerr << "Could not parse the entire log file." << std::endl; |
126 std::cerr << "Proceeding to analyze the first " | 123 std::cerr << "Proceeding to analyze the first " |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 webrtc::test::ResourcePath( | 245 webrtc::test::ResourcePath( |
249 "audio_processing/conversational_speech/EN_script2_F_sp2_B1", | 246 "audio_processing/conversational_speech/EN_script2_F_sp2_B1", |
250 "wav"), | 247 "wav"), |
251 48000, collection->AppendNewPlot()); | 248 48000, collection->AppendNewPlot()); |
252 } | 249 } |
253 | 250 |
254 collection->Draw(); | 251 collection->Draw(); |
255 | 252 |
256 return 0; | 253 return 0; |
257 } | 254 } |
OLD | NEW |