Add stub draft of audio generator to APM

This provides the empty shell of an AudioGenerator class.
It is intended to be used for debugging purposes and can be inserted
into the APM much like an AecDump. It allows for playing out diagnostic
audio unaffected by codecs and network jitter, while still capturing
API interaction like in a normal call.

NOTRY=True

Bug: webrtc:8882
Change-Id: I8132afc95cdba02ab233f44e22e0a5f530710ef7
Reviewed-on: https://webrtc-review.googlesource.com/53300
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22282}
This commit is contained in:
Sam Zackrisson
2018-03-02 16:03:21 +01:00
committed by Commit Bot
parent 4c09d7af8a
commit 4d3644979c
11 changed files with 294 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include "api/audio/echo_control.h"
#include "api/optional.h"
#include "modules/audio_processing/beamformer/array_util.h"
#include "modules/audio_processing/include/audio_generator.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
#include "modules/audio_processing/include/config.h"
#include "rtc_base/arraysize.h"
@ -480,6 +481,16 @@ class AudioProcessing : public rtc::RefCountInterface {
// all pending logging tasks are completed.
virtual void DetachAecDump() = 0;
// Attaches provided webrtc::AudioGenerator for modifying playout audio.
// Calling this method when another AudioGenerator is attached replaces the
// active AudioGenerator with a new one.
virtual void AttachPlayoutAudioGenerator(
std::unique_ptr<AudioGenerator> audio_generator) = 0;
// If no AudioGenerator is attached, this has no effect. If an AecDump is
// attached, its destructor is called.
virtual void DetachPlayoutAudioGenerator() = 0;
// Use to send UMA histograms at end of a call. Note that all histogram
// specific member variables are reset.
virtual void UpdateHistogramsOnCallEnd() = 0;