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_AEC_DUMP_BASED_SIMULATOR_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AEC_DUMP_BASED_SIMULATOR_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AEC_DUMP_BASED_SIMULATOR_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AEC_DUMP_BASED_SIMULATOR_H_ |
13 | 13 |
| 14 #include <memory> |
| 15 |
14 #include "webrtc/modules/audio_processing/test/audio_processing_simulator.h" | 16 #include "webrtc/modules/audio_processing/test/audio_processing_simulator.h" |
15 | 17 |
16 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
17 #include "webrtc/base/ignore_wundef.h" | 19 #include "webrtc/base/ignore_wundef.h" |
18 | 20 |
19 RTC_PUSH_IGNORING_WUNDEF() | 21 RTC_PUSH_IGNORING_WUNDEF() |
20 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 22 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
21 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" | 23 #include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h" |
22 #else | 24 #else |
23 #include "webrtc/modules/audio_processing/debug.pb.h" | 25 #include "webrtc/modules/audio_processing/debug.pb.h" |
(...skipping 10 matching lines...) Expand all Loading... |
34 ~AecDumpBasedSimulator() override; | 36 ~AecDumpBasedSimulator() override; |
35 | 37 |
36 // Processes the messages in the aecdump file. | 38 // Processes the messages in the aecdump file. |
37 void Process() override; | 39 void Process() override; |
38 | 40 |
39 private: | 41 private: |
40 void HandleMessage(const webrtc::audioproc::Init& msg); | 42 void HandleMessage(const webrtc::audioproc::Init& msg); |
41 void HandleMessage(const webrtc::audioproc::Stream& msg); | 43 void HandleMessage(const webrtc::audioproc::Stream& msg); |
42 void HandleMessage(const webrtc::audioproc::ReverseStream& msg); | 44 void HandleMessage(const webrtc::audioproc::ReverseStream& msg); |
43 void HandleMessage(const webrtc::audioproc::Config& msg); | 45 void HandleMessage(const webrtc::audioproc::Config& msg); |
44 void PrepareProcessStreamCall(const webrtc::audioproc::Stream& msg, | 46 void PrepareProcessStreamCall(const webrtc::audioproc::Stream& msg); |
45 bool* set_stream_analog_level_called); | |
46 void PrepareReverseProcessStreamCall( | 47 void PrepareReverseProcessStreamCall( |
47 const webrtc::audioproc::ReverseStream& msg); | 48 const webrtc::audioproc::ReverseStream& msg); |
48 void VerifyProcessStreamBitExactness(const webrtc::audioproc::Stream& msg); | 49 void VerifyProcessStreamBitExactness(const webrtc::audioproc::Stream& msg); |
49 | 50 |
50 enum InterfaceType { | 51 enum InterfaceType { |
51 kFixedInterface, | 52 kFixedInterface, |
52 kFloatInterface, | 53 kFloatInterface, |
53 kNotSpecified, | 54 kNotSpecified, |
54 }; | 55 }; |
55 | 56 |
56 FILE* dump_input_file_; | 57 FILE* dump_input_file_; |
57 std::unique_ptr<ChannelBuffer<float>> artificial_nearend_buf_; | 58 std::unique_ptr<ChannelBuffer<float>> artificial_nearend_buf_; |
58 std::unique_ptr<ChannelBufferWavReader> artificial_nearend_buffer_reader_; | 59 std::unique_ptr<ChannelBufferWavReader> artificial_nearend_buffer_reader_; |
59 bool artificial_nearend_eof_reported_ = false; | 60 bool artificial_nearend_eof_reported_ = false; |
60 InterfaceType interface_used_ = InterfaceType::kNotSpecified; | 61 InterfaceType interface_used_ = InterfaceType::kNotSpecified; |
61 | 62 |
| 63 // TODO(aleloi): Remove once a FakeRecordingDevice is addded as protected |
| 64 // member of AudioProcessingSimulator. |
| 65 int last_specified_microphone_level_ = kInitialMicrophoneGainLevel; |
| 66 |
62 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AecDumpBasedSimulator); | 67 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AecDumpBasedSimulator); |
63 }; | 68 }; |
64 | 69 |
65 } // namespace test | 70 } // namespace test |
66 } // namespace webrtc | 71 } // namespace webrtc |
67 | 72 |
68 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AEC_DUMP_BASED_SIMULATOR_H_ | 73 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_AEC_DUMP_BASED_SIMULATOR_H_ |
OLD | NEW |