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 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 bool use_highpass_filter, | 69 bool use_highpass_filter, |
70 std::unique_ptr<BlockProcessor> block_processor); | 70 std::unique_ptr<BlockProcessor> block_processor); |
71 ~EchoCanceller3(); | 71 ~EchoCanceller3(); |
72 // Analyzes and stores an internal copy of the split-band domain render | 72 // Analyzes and stores an internal copy of the split-band domain render |
73 // signal. | 73 // signal. |
74 bool AnalyzeRender(AudioBuffer* farend); | 74 bool AnalyzeRender(AudioBuffer* farend); |
75 // Analyzes the full-band domain capture signal to detect signal saturation. | 75 // Analyzes the full-band domain capture signal to detect signal saturation. |
76 void AnalyzeCapture(AudioBuffer* capture); | 76 void AnalyzeCapture(AudioBuffer* capture); |
77 // Processes the split-band domain capture signal in order to remove any echo | 77 // Processes the split-band domain capture signal in order to remove any echo |
78 // present in the signal. | 78 // present in the signal. |
79 void ProcessCapture(AudioBuffer* capture, bool known_echo_path_change); | 79 void ProcessCapture(AudioBuffer* capture, bool level_change); |
80 | 80 |
81 // Signals whether an external detector has detected echo leakage from the | 81 // Signals whether an external detector has detected echo leakage from the |
82 // echo canceller. | 82 // echo canceller. |
83 // Note that in the case echo leakage has been flagged, it should be unflagged | 83 // Note that in the case echo leakage has been flagged, it should be unflagged |
84 // once it is no longer occurring. | 84 // once it is no longer occurring. |
85 void ReportEchoLeakage(bool leakage_detected) { | 85 void UpdateEchoLeakageStatus(bool leakage_detected) { |
86 RTC_DCHECK_RUNS_SERIALIZED(&capture_race_checker_); | 86 RTC_DCHECK_RUNS_SERIALIZED(&capture_race_checker_); |
87 block_processor_->ReportEchoLeakage(leakage_detected); | 87 block_processor_->UpdateEchoLeakageStatus(leakage_detected); |
88 } | 88 } |
89 | 89 |
90 // Validates a config. | 90 // Validates a config. |
91 static bool Validate(const AudioProcessing::Config::EchoCanceller3& config); | 91 static bool Validate(const AudioProcessing::Config::EchoCanceller3& config); |
92 // Dumps a config to a string. | 92 // Dumps a config to a string. |
93 static std::string ToString( | 93 static std::string ToString( |
94 const AudioProcessing::Config::EchoCanceller3& config); | 94 const AudioProcessing::Config::EchoCanceller3& config); |
95 | 95 |
96 private: | 96 private: |
97 class RenderWriter; | 97 class RenderWriter; |
98 | 98 |
| 99 // Empties the render SwapQueue. A bool is returned that indicates the success |
| 100 // of the operation. |
99 bool EmptyRenderQueue(); | 101 bool EmptyRenderQueue(); |
100 | 102 |
101 rtc::RaceChecker capture_race_checker_; | 103 rtc::RaceChecker capture_race_checker_; |
102 rtc::RaceChecker render_race_checker_; | 104 rtc::RaceChecker render_race_checker_; |
103 | 105 |
104 // State that is accessed by the AnalyzeRender call. | 106 // State that is accessed by the AnalyzeRender call. |
105 std::unique_ptr<RenderWriter> render_writer_ GUARDED_BY(render_race_checker_); | 107 std::unique_ptr<RenderWriter> render_writer_ GUARDED_BY(render_race_checker_); |
106 | 108 |
107 // State that may be accessed by the capture thread. | 109 // State that may be accessed by the capture thread. |
108 static int instance_count_; | 110 static int instance_count_; |
(...skipping 15 matching lines...) Expand all Loading... |
124 bool saturated_microphone_signal_ GUARDED_BY(capture_race_checker_) = false; | 126 bool saturated_microphone_signal_ GUARDED_BY(capture_race_checker_) = false; |
125 std::vector<std::vector<float>> block_ GUARDED_BY(capture_race_checker_); | 127 std::vector<std::vector<float>> block_ GUARDED_BY(capture_race_checker_); |
126 std::vector<rtc::ArrayView<float>> sub_frame_view_ | 128 std::vector<rtc::ArrayView<float>> sub_frame_view_ |
127 GUARDED_BY(capture_race_checker_); | 129 GUARDED_BY(capture_race_checker_); |
128 | 130 |
129 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3); | 131 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3); |
130 }; | 132 }; |
131 } // namespace webrtc | 133 } // namespace webrtc |
132 | 134 |
133 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_ECHO_CANCELLER3_H_ | 135 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_ECHO_CANCELLER3_H_ |
OLD | NEW |