| Index: webrtc/modules/audio_processing/residual_echo_detector.h
|
| diff --git a/webrtc/modules/audio_processing/residual_echo_detector.h b/webrtc/modules/audio_processing/residual_echo_detector.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d87e77f850737a600111d4fb3343ce358751e341
|
| --- /dev/null
|
| +++ b/webrtc/modules/audio_processing/residual_echo_detector.h
|
| @@ -0,0 +1,64 @@
|
| +/*
|
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
| + *
|
| + * Use of this source code is governed by a BSD-style license
|
| + * that can be found in the LICENSE file in the root of the source
|
| + * tree. An additional intellectual property rights grant can be found
|
| + * in the file PATENTS. All contributing project authors may
|
| + * be found in the AUTHORS file in the root of the source tree.
|
| + */
|
| +
|
| +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_RESIDUAL_ECHO_DETECTOR_H_
|
| +#define WEBRTC_MODULES_AUDIO_PROCESSING_RESIDUAL_ECHO_DETECTOR_H_
|
| +
|
| +#include <memory>
|
| +#include <vector>
|
| +
|
| +#include "webrtc/base/constructormagic.h"
|
| +#include "webrtc/base/criticalsection.h"
|
| +#include "webrtc/base/optional.h"
|
| +#include "webrtc/base/swap_queue.h"
|
| +#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
| +#include "webrtc/modules/audio_processing/render_queue_item_verifier.h"
|
| +
|
| +namespace webrtc {
|
| +
|
| +class AudioBuffer;
|
| +class EchoDetector;
|
| +
|
| +class ResidualEchoDetector {
|
| + public:
|
| + ResidualEchoDetector(rtc::CriticalSection* crit_render,
|
| + rtc::CriticalSection* crit_capture);
|
| + ~ResidualEchoDetector();
|
| +
|
| + void AnalyzeRenderAudio(const AudioBuffer* audio);
|
| + void AnalyzeCaptureAudio(AudioBuffer* audio);
|
| +
|
| + void Initialize(int sample_rate_hz);
|
| +
|
| + // Reads render side data that has been queued on the render call.
|
| + // Called holding the capture lock.
|
| + void ReadQueuedRenderData();
|
| +
|
| + float get_echo_likelihood();
|
| +
|
| + private:
|
| + rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_);
|
| + rtc::CriticalSection* const crit_capture_;
|
| +
|
| + std::vector<float> render_queue_buffer_ GUARDED_BY(crit_render_);
|
| + std::vector<float> capture_queue_buffer_ GUARDED_BY(crit_capture_);
|
| +
|
| + // Lock protection not needed.
|
| + std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
|
| + render_signal_queue_;
|
| +
|
| + std::unique_ptr<EchoDetector> detector_;
|
| +
|
| + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ResidualEchoDetector);
|
| +};
|
| +
|
| +} // namespace webrtc
|
| +
|
| +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_RESIDUAL_ECHO_DETECTOR_H_
|
|
|