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

Side by Side Diff: webrtc/modules/audio_processing/test/debug_dump_test.cc

Issue 1541633002: Reland "Added option to specify a maximum file size when recording an AEC dump." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix to prevent Chrome from breaking. Created 5 years 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 output_config_.set_sample_rate_hz(rate_hz); 174 output_config_.set_sample_rate_hz(rate_hz);
175 MaybeResetBuffer(&output_, output_config_); 175 MaybeResetBuffer(&output_, output_config_);
176 } 176 }
177 177
178 void DebugDumpGenerator::SetOutputChannels(int channels) { 178 void DebugDumpGenerator::SetOutputChannels(int channels) {
179 output_config_.set_num_channels(channels); 179 output_config_.set_num_channels(channels);
180 MaybeResetBuffer(&output_, output_config_); 180 MaybeResetBuffer(&output_, output_config_);
181 } 181 }
182 182
183 void DebugDumpGenerator::StartRecording() { 183 void DebugDumpGenerator::StartRecording() {
184 apm_->StartDebugRecording(dump_file_name_.c_str()); 184 apm_->StartDebugRecording(dump_file_name_.c_str(), -1);
185 } 185 }
186 186
187 void DebugDumpGenerator::Process(size_t num_blocks) { 187 void DebugDumpGenerator::Process(size_t num_blocks) {
188 for (size_t i = 0; i < num_blocks; ++i) { 188 for (size_t i = 0; i < num_blocks; ++i) {
189 ReadAndDeinterleave(&reverse_audio_, reverse_file_channels_, 189 ReadAndDeinterleave(&reverse_audio_, reverse_file_channels_,
190 reverse_config_, reverse_->channels()); 190 reverse_config_, reverse_->channels());
191 ReadAndDeinterleave(&input_audio_, input_file_channels_, input_config_, 191 ReadAndDeinterleave(&input_audio_, input_file_channels_, input_config_,
192 input_->channels()); 192 input_->channels());
193 RTC_CHECK_EQ(AudioProcessing::kNoError, apm_->set_stream_delay_ms(100)); 193 RTC_CHECK_EQ(AudioProcessing::kNoError, apm_->set_stream_delay_ms(100));
194 apm_->set_stream_key_pressed(i % 10 == 9); 194 apm_->set_stream_key_pressed(i % 10 == 9);
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 config.Set<ExperimentalNs>(new ExperimentalNs(true)); 600 config.Set<ExperimentalNs>(new ExperimentalNs(true));
601 DebugDumpGenerator generator(config); 601 DebugDumpGenerator generator(config);
602 generator.StartRecording(); 602 generator.StartRecording();
603 generator.Process(100); 603 generator.Process(100);
604 generator.StopRecording(); 604 generator.StopRecording();
605 VerifyDebugDump(generator.dump_file_name()); 605 VerifyDebugDump(generator.dump_file_name());
606 } 606 }
607 607
608 } // namespace test 608 } // namespace test
609 } // namespace webrtc 609 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698