Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: webrtc/modules/audio_processing/transient/transient_suppression_test.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // This application tests the transient suppression by providing a processed 141 // This application tests the transient suppression by providing a processed
142 // PCM file, which has to be listened to in order to evaluate the 142 // PCM file, which has to be listened to in order to evaluate the
143 // performance. 143 // performance.
144 // It gets an audio file, and its voice gain information, and the suppressor 144 // It gets an audio file, and its voice gain information, and the suppressor
145 // process it giving the output file "suppressed_keystrokes.pcm". 145 // process it giving the output file "suppressed_keystrokes.pcm".
146 void void_main() { 146 void void_main() {
147 // TODO(aluebs): Remove all FileWrappers. 147 // TODO(aluebs): Remove all FileWrappers.
148 // Prepare the input file. 148 // Prepare the input file.
149 FILE* in_file = fopen(FLAGS_in_file_name.c_str(), "rb"); 149 FILE* in_file = fopen(FLAGS_in_file_name.c_str(), "rb");
150 ASSERT_TRUE(in_file != NULL); 150 ASSERT_TRUE(in_file != nullptr);
151 151
152 // Prepare the detection file. 152 // Prepare the detection file.
153 FILE* detection_file = NULL; 153 FILE* detection_file = nullptr;
154 if (!FLAGS_detection_file_name.empty()) { 154 if (!FLAGS_detection_file_name.empty()) {
155 detection_file = fopen(FLAGS_detection_file_name.c_str(), "rb"); 155 detection_file = fopen(FLAGS_detection_file_name.c_str(), "rb");
156 } 156 }
157 157
158 // Prepare the reference file. 158 // Prepare the reference file.
159 FILE* reference_file = NULL; 159 FILE* reference_file = nullptr;
160 if (!FLAGS_reference_file_name.empty()) { 160 if (!FLAGS_reference_file_name.empty()) {
161 reference_file = fopen(FLAGS_reference_file_name.c_str(), "rb"); 161 reference_file = fopen(FLAGS_reference_file_name.c_str(), "rb");
162 } 162 }
163 163
164 // Prepare the output file. 164 // Prepare the output file.
165 std::string out_file_name = test::OutputPath() + "suppressed_keystrokes.pcm"; 165 std::string out_file_name = test::OutputPath() + "suppressed_keystrokes.pcm";
166 FILE* out_file = fopen(out_file_name.c_str(), "wb"); 166 FILE* out_file = fopen(out_file_name.c_str(), "wb");
167 ASSERT_TRUE(out_file != NULL); 167 ASSERT_TRUE(out_file != nullptr);
168 168
169 int detection_rate_hz = FLAGS_detection_rate_hz; 169 int detection_rate_hz = FLAGS_detection_rate_hz;
170 if (detection_rate_hz == 0) { 170 if (detection_rate_hz == 0) {
171 detection_rate_hz = FLAGS_sample_rate_hz; 171 detection_rate_hz = FLAGS_sample_rate_hz;
172 } 172 }
173 173
174 Agc agc; 174 Agc agc;
175 175
176 TransientSuppressor suppressor; 176 TransientSuppressor suppressor;
177 suppressor.Initialize( 177 suppressor.Initialize(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 } // namespace webrtc 244 } // namespace webrtc
245 245
246 int main(int argc, char* argv[]) { 246 int main(int argc, char* argv[]) {
247 google::SetUsageMessage(webrtc::kUsage); 247 google::SetUsageMessage(webrtc::kUsage);
248 google::ParseCommandLineFlags(&argc, &argv, true); 248 google::ParseCommandLineFlags(&argc, &argv, true);
249 webrtc::void_main(); 249 webrtc::void_main();
250 return 0; 250 return 0;
251 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698