Chromium Code Reviews| Index: webrtc/modules/audio_processing/echo_control_mobile_impl.h |
| diff --git a/webrtc/modules/audio_processing/echo_control_mobile_impl.h b/webrtc/modules/audio_processing/echo_control_mobile_impl.h |
| index da7022545f245171a3353a59f55fc991273d57f6..4151b12da76899abd5abc19c6532e6409396bb03 100644 |
| --- a/webrtc/modules/audio_processing/echo_control_mobile_impl.h |
| +++ b/webrtc/modules/audio_processing/echo_control_mobile_impl.h |
| @@ -11,6 +11,8 @@ |
| #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |
| #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |
| +#include "webrtc/base/scoped_ptr.h" |
| +#include "webrtc/common_audio/swap_queue.h" |
| #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| #include "webrtc/modules/audio_processing/processing_component.h" |
| @@ -19,6 +21,21 @@ namespace webrtc { |
| class AudioBuffer; |
| class CriticalSectionWrapper; |
| +// Functor to use when supplying a verifier function for the queue item |
| +// verifcation. |
| +class AecmRenderQueueItemVerifier { |
|
hlundin-webrtc
2015/11/06 07:05:13
Oh, they have different names. Then I guess you'll
peah-webrtc
2015/11/06 10:44:20
Good point! It works as it is, but I instead creat
|
| + public: |
| + explicit AecmRenderQueueItemVerifier(size_t minimum_capacity) |
| + : minimum_capacity_(minimum_capacity) {} |
| + |
| + bool operator()(const std::vector<int16_t>& v) const { |
| + return v.capacity() >= minimum_capacity_; |
| + } |
| + |
| + private: |
| + size_t minimum_capacity_; |
| +}; |
| + |
| class EchoControlMobileImpl : public EchoControlMobile, |
| public ProcessingComponent { |
| public: |
| @@ -37,7 +54,16 @@ class EchoControlMobileImpl : public EchoControlMobile, |
| // ProcessingComponent implementation. |
| int Initialize() override; |
| + // Reads render side data that has been queued on the render call. |
| + void ReadQueuedRenderData(); |
| + |
| private: |
| + static const size_t kAllowedValuesOfSamplesPerFrame1 = 80; |
| + static const size_t kAllowedValuesOfSamplesPerFrame2 = 160; |
| + // TODO(peah): Decrease this once we properly handle hugely unbalanced |
| + // reverse and forward call numbers. |
| + static const size_t kMaxNumFramesToBuffer = 100; |
| + |
| // EchoControlMobile implementation. |
| int Enable(bool enable) override; |
| int set_routing_mode(RoutingMode mode) override; |
| @@ -53,11 +79,19 @@ class EchoControlMobileImpl : public EchoControlMobile, |
| int num_handles_required() const override; |
| int GetHandleError(void* handle) const override; |
| + void AllocateRenderQueue(); |
| + |
| const AudioProcessing* apm_; |
| CriticalSectionWrapper* crit_; |
| RoutingMode routing_mode_; |
| bool comfort_noise_enabled_; |
| unsigned char* external_echo_path_; |
| + |
| + size_t render_queue_element_max_size_; |
| + std::vector<int16_t> render_queue_buffer_; |
| + std::vector<int16_t> capture_queue_buffer_; |
| + rtc::scoped_ptr<SwapQueue<std::vector<int16_t>, AecmRenderQueueItemVerifier>> |
| + render_signal_queue_; |
| }; |
| } // namespace webrtc |