Update to current webrtc library
This is from the upstream library commit id 3326535126e435f1ba647885ce43a8f0f3d317eb, corresponding to Chromium 88.0.4290.1.
This commit is contained in:
@ -8,57 +8,79 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
|
||||
#define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
|
||||
#ifndef MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
|
||||
#define MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
|
||||
|
||||
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
||||
#include "webrtc/modules/audio_processing/processing_component.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class AudioBuffer;
|
||||
class CriticalSectionWrapper;
|
||||
|
||||
class EchoControlMobileImpl : public EchoControlMobile,
|
||||
public ProcessingComponent {
|
||||
// The acoustic echo control for mobile (AECM) component is a low complexity
|
||||
// robust option intended for use on mobile devices.
|
||||
class EchoControlMobileImpl {
|
||||
public:
|
||||
EchoControlMobileImpl(const AudioProcessing* apm,
|
||||
CriticalSectionWrapper* crit);
|
||||
virtual ~EchoControlMobileImpl();
|
||||
EchoControlMobileImpl();
|
||||
|
||||
int ProcessRenderAudio(const AudioBuffer* audio);
|
||||
int ProcessCaptureAudio(AudioBuffer* audio);
|
||||
~EchoControlMobileImpl();
|
||||
|
||||
// EchoControlMobile implementation.
|
||||
bool is_enabled() const override;
|
||||
RoutingMode routing_mode() const override;
|
||||
bool is_comfort_noise_enabled() const override;
|
||||
// Recommended settings for particular audio routes. In general, the louder
|
||||
// the echo is expected to be, the higher this value should be set. The
|
||||
// preferred setting may vary from device to device.
|
||||
enum RoutingMode {
|
||||
kQuietEarpieceOrHeadset,
|
||||
kEarpiece,
|
||||
kLoudEarpiece,
|
||||
kSpeakerphone,
|
||||
kLoudSpeakerphone
|
||||
};
|
||||
|
||||
// ProcessingComponent implementation.
|
||||
int Initialize() override;
|
||||
// Sets echo control appropriate for the audio routing |mode| on the device.
|
||||
// It can and should be updated during a call if the audio routing changes.
|
||||
int set_routing_mode(RoutingMode mode);
|
||||
RoutingMode routing_mode() const;
|
||||
|
||||
// Comfort noise replaces suppressed background noise to maintain a
|
||||
// consistent signal level.
|
||||
int enable_comfort_noise(bool enable);
|
||||
bool is_comfort_noise_enabled() const;
|
||||
|
||||
void ProcessRenderAudio(rtc::ArrayView<const int16_t> packed_render_audio);
|
||||
int ProcessCaptureAudio(AudioBuffer* audio, int stream_delay_ms);
|
||||
|
||||
void Initialize(int sample_rate_hz,
|
||||
size_t num_reverse_channels,
|
||||
size_t num_output_channels);
|
||||
|
||||
static void PackRenderAudioBuffer(const AudioBuffer* audio,
|
||||
size_t num_output_channels,
|
||||
size_t num_channels,
|
||||
std::vector<int16_t>* packed_buffer);
|
||||
|
||||
static size_t NumCancellersRequired(size_t num_output_channels,
|
||||
size_t num_reverse_channels);
|
||||
|
||||
private:
|
||||
// EchoControlMobile implementation.
|
||||
int Enable(bool enable) override;
|
||||
int set_routing_mode(RoutingMode mode) override;
|
||||
int enable_comfort_noise(bool enable) override;
|
||||
int SetEchoPath(const void* echo_path, size_t size_bytes) override;
|
||||
int GetEchoPath(void* echo_path, size_t size_bytes) const override;
|
||||
class Canceller;
|
||||
struct StreamProperties;
|
||||
|
||||
// ProcessingComponent implementation.
|
||||
void* CreateHandle() const override;
|
||||
int InitializeHandle(void* handle) const override;
|
||||
int ConfigureHandle(void* handle) const override;
|
||||
void DestroyHandle(void* handle) const override;
|
||||
int num_handles_required() const override;
|
||||
int GetHandleError(void* handle) const override;
|
||||
int Configure();
|
||||
|
||||
const AudioProcessing* apm_;
|
||||
CriticalSectionWrapper* crit_;
|
||||
RoutingMode routing_mode_;
|
||||
bool comfort_noise_enabled_;
|
||||
unsigned char* external_echo_path_;
|
||||
|
||||
std::vector<std::unique_ptr<Canceller>> cancellers_;
|
||||
std::unique_ptr<StreamProperties> stream_properties_;
|
||||
std::vector<std::array<int16_t, 160>> low_pass_reference_;
|
||||
bool reference_copied_ = false;
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
|
||||
#endif // MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_
|
||||
|
Reference in New Issue
Block a user