Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: webrtc/modules/audio_processing/echo_cancellation_impl.h

Issue 2427553003: Moved the AEC render sample queue into the audio processing module (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/echo_cancellation_impl.h
diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.h b/webrtc/modules/audio_processing/echo_cancellation_impl.h
index bab5e54f4bd4b7f044765e7850ebb80b01ce2202..8a4ea718460c8bf859c615944b9549e2243276d3 100644
--- a/webrtc/modules/audio_processing/echo_cancellation_impl.h
+++ b/webrtc/modules/audio_processing/echo_cancellation_impl.h
@@ -16,9 +16,7 @@
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.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 {
@@ -30,7 +28,7 @@ class EchoCancellationImpl : public EchoCancellation {
rtc::CriticalSection* crit_capture);
~EchoCancellationImpl() override;
- int ProcessRenderAudio(const AudioBuffer* audio);
+ void ProcessRenderAudio(rtc::ArrayView<const float> packed_render_audio);
int ProcessCaptureAudio(AudioBuffer* audio, int stream_delay_ms);
// EchoCancellation implementation.
@@ -50,13 +48,16 @@ class EchoCancellationImpl : public EchoCancellation {
std::string GetExperimentsDescription();
bool is_refined_adaptive_filter_enabled() const;
- // Reads render side data that has been queued on the render call.
- // Called holding the capture lock.
- void ReadQueuedRenderData();
-
// Returns the system delay of the first AEC component.
int GetSystemDelayInSamples() const;
+ static void PackRenderAudioBuffer(const AudioBuffer* audio,
+ size_t num_output_channels,
+ size_t num_channels,
+ std::vector<float>* packed_buffer);
+ static size_t NumCancellersRequired(size_t num_output_channels,
+ size_t num_reverse_channels);
+
private:
class Canceller;
struct StreamProperties;
@@ -79,8 +80,6 @@ class EchoCancellationImpl : public EchoCancellation {
struct AecCore* aec_core() const override;
- size_t NumCancellersRequired() const;
-
void AllocateRenderQueue();
int Configure();
@@ -100,15 +99,6 @@ class EchoCancellationImpl : public EchoCancellation {
bool aec3_enabled_ GUARDED_BY(crit_capture_);
bool refined_adaptive_filter_enabled_ GUARDED_BY(crit_capture_) = false;
- size_t render_queue_element_max_size_ GUARDED_BY(crit_render_)
- GUARDED_BY(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::vector<std::unique_ptr<Canceller>> cancellers_;
std::unique_ptr<StreamProperties> stream_properties_;

Powered by Google App Engine
This is Rietveld 408576698