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}
diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h
index ddbaede..7057f28 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -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 @@
// 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;