| 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 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ |
| 13 | 13 |
| 14 #include <algorithm> | 14 #include <algorithm> |
| 15 #include <fstream> | 15 #include <fstream> |
| 16 #include <limits> | 16 #include <limits> |
| 17 #include <memory> | 17 #include <memory> |
| 18 #include <string> | 18 #include <string> |
| 19 | 19 |
| 20 #include "webrtc/base/timeutils.h" | |
| 21 #include "webrtc/base/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
| 22 #include "webrtc/base/optional.h" | 21 #include "webrtc/base/optional.h" |
| 22 #include "webrtc/base/task_queue.h" |
| 23 #include "webrtc/base/timeutils.h" |
| 23 #include "webrtc/common_audio/channel_buffer.h" | 24 #include "webrtc/common_audio/channel_buffer.h" |
| 24 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 25 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 25 #include "webrtc/modules/audio_processing/test/test_utils.h" | 26 #include "webrtc/modules/audio_processing/test/test_utils.h" |
| 26 | 27 |
| 27 namespace webrtc { | 28 namespace webrtc { |
| 28 namespace test { | 29 namespace test { |
| 29 | 30 |
| 30 // Holds all the parameters available for controlling the simulation. | 31 // Holds all the parameters available for controlling the simulation. |
| 31 struct SimulationSettings { | 32 struct SimulationSettings { |
| 32 SimulationSettings(); | 33 SimulationSettings(); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 void SetupBuffersConfigsOutputs(int input_sample_rate_hz, | 143 void SetupBuffersConfigsOutputs(int input_sample_rate_hz, |
| 143 int output_sample_rate_hz, | 144 int output_sample_rate_hz, |
| 144 int reverse_input_sample_rate_hz, | 145 int reverse_input_sample_rate_hz, |
| 145 int reverse_output_sample_rate_hz, | 146 int reverse_output_sample_rate_hz, |
| 146 int input_num_channels, | 147 int input_num_channels, |
| 147 int output_num_channels, | 148 int output_num_channels, |
| 148 int reverse_input_num_channels, | 149 int reverse_input_num_channels, |
| 149 int reverse_output_num_channels); | 150 int reverse_output_num_channels); |
| 150 | 151 |
| 151 const SimulationSettings settings_; | 152 const SimulationSettings settings_; |
| 153 rtc::TaskQueue worker_queue_; // Important to make this outlive last |
| 154 // call to StopDebugRecording. |
| 152 std::unique_ptr<AudioProcessing> ap_; | 155 std::unique_ptr<AudioProcessing> ap_; |
| 153 | 156 |
| 154 std::unique_ptr<ChannelBuffer<float>> in_buf_; | 157 std::unique_ptr<ChannelBuffer<float>> in_buf_; |
| 155 std::unique_ptr<ChannelBuffer<float>> out_buf_; | 158 std::unique_ptr<ChannelBuffer<float>> out_buf_; |
| 156 std::unique_ptr<ChannelBuffer<float>> reverse_in_buf_; | 159 std::unique_ptr<ChannelBuffer<float>> reverse_in_buf_; |
| 157 std::unique_ptr<ChannelBuffer<float>> reverse_out_buf_; | 160 std::unique_ptr<ChannelBuffer<float>> reverse_out_buf_; |
| 158 StreamConfig in_config_; | 161 StreamConfig in_config_; |
| 159 StreamConfig out_config_; | 162 StreamConfig out_config_; |
| 160 StreamConfig reverse_in_config_; | 163 StreamConfig reverse_in_config_; |
| 161 StreamConfig reverse_out_config_; | 164 StreamConfig reverse_out_config_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 176 TickIntervalStats proc_time_; | 179 TickIntervalStats proc_time_; |
| 177 std::ofstream residual_echo_likelihood_graph_writer_; | 180 std::ofstream residual_echo_likelihood_graph_writer_; |
| 178 | 181 |
| 179 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioProcessingSimulator); | 182 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioProcessingSimulator); |
| 180 }; | 183 }; |
| 181 | 184 |
| 182 } // namespace test | 185 } // namespace test |
| 183 } // namespace webrtc | 186 } // namespace webrtc |
| 184 | 187 |
| 185 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ | 188 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AUDIO_PROCESSING_SIMULATOR_H_ |
| OLD | NEW |