OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 const bool is_aec_enabled = ap && ap->echo_cancellation()->is_enabled(); | 124 const bool is_aec_enabled = ap && ap->echo_cancellation()->is_enabled(); |
125 #endif | 125 #endif |
126 if (is_aec_enabled) { | 126 if (is_aec_enabled) { |
127 if (params.channels() > kMaxNumberOfPlayoutDataChannels) { | 127 if (params.channels() > kMaxNumberOfPlayoutDataChannels) { |
128 for (int i = 0; i < kMaxNumberOfPlayoutDataChannels; ++i) { | 128 for (int i = 0; i < kMaxNumberOfPlayoutDataChannels; ++i) { |
129 data_bus_playout->SetChannelData( | 129 data_bus_playout->SetChannelData( |
130 i, const_cast<float*>(data_bus->channel(i))); | 130 i, const_cast<float*>(data_bus->channel(i))); |
131 } | 131 } |
132 } | 132 } |
133 audio_processor->OnPlayoutData(data_bus_playout_to_use, | 133 audio_processor->OnPlayoutData(data_bus_playout_to_use, |
134 params.sample_rate(), 10); | 134 params.sample_rate(), 10, 0); |
135 } | 135 } |
136 | 136 |
137 media::AudioBus* processed_data = nullptr; | 137 media::AudioBus* processed_data = nullptr; |
138 base::TimeDelta capture_delay; | 138 base::TimeDelta capture_delay; |
139 int new_volume = 0; | 139 int new_volume = 0; |
140 while (audio_processor->ProcessAndConsumeData( | 140 while (audio_processor->ProcessAndConsumeData( |
141 255, false, &processed_data, &capture_delay, &new_volume)) { | 141 255, false, &processed_data, &capture_delay, &new_volume)) { |
142 EXPECT_TRUE(processed_data); | 142 EXPECT_TRUE(processed_data); |
143 EXPECT_NEAR(input_capture_delay.InMillisecondsF(), | 143 EXPECT_NEAR(input_capture_delay.InMillisecondsF(), |
144 capture_delay.InMillisecondsF(), | 144 capture_delay.InMillisecondsF(), |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 ProcessDataAndVerifyFormat(audio_processor.get(), | 588 ProcessDataAndVerifyFormat(audio_processor.get(), |
589 kAudioProcessingSampleRate, | 589 kAudioProcessingSampleRate, |
590 kAudioProcessingNumberOfChannel, | 590 kAudioProcessingNumberOfChannel, |
591 kAudioProcessingSampleRate / 100); | 591 kAudioProcessingSampleRate / 100); |
592 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives | 592 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives |
593 // |audio_processor|. | 593 // |audio_processor|. |
594 audio_processor = NULL; | 594 audio_processor = NULL; |
595 } | 595 } |
596 | 596 |
597 } // namespace content | 597 } // namespace content |
OLD | NEW |