Allow an external audio processing module to be used in WebRTC

[This CL is a rebase of an original CL by solenberg@:
https://codereview.webrtc.org/2948763002/ which in turn was a
rebase of an original CL by peah@:
https://chromium-review.googlesource.com/c/527032/]

Allow an external audio processing module to be used in WebRTC

This CL adds support for optionally using an externally created audio
processing module in a peerconnection. The ownership is shared
between the peerconnection and the external creator of the module.

As part of this the internal ownership of the audio processing module
is moved from VoiceEngine to WebRtcVoiceEngine.

BUG=webrtc:7775

Review-Url: https://codereview.webrtc.org/2961723004
Cr-Commit-Position: refs/heads/master@{#18837}
This commit is contained in:
peah
2017-06-29 08:32:09 -07:00
committed by Commit Bot
parent 3dbfac3515
commit a9cc40b7d2
53 changed files with 320 additions and 208 deletions

View File

@ -321,7 +321,8 @@ AudioProcessing* AudioProcessing::Create(const webrtc::Config& config) {
AudioProcessing* AudioProcessing::Create(const webrtc::Config& config,
NonlinearBeamformer* beamformer) {
AudioProcessingImpl* apm = new AudioProcessingImpl(config, beamformer);
AudioProcessingImpl* apm =
new rtc::RefCountedObject<AudioProcessingImpl>(config, beamformer);
if (apm->Initialize() != kNoError) {
delete apm;
apm = nullptr;