Index: webrtc/modules/audio_processing/audio_processing_impl.h |
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h |
index 7fc81f8899df3219537bc51289fad6fbebc105c4..0472edf094cb1ed02f203c9dd1f9cafc4b21d771 100644 |
--- a/webrtc/modules/audio_processing/audio_processing_impl.h |
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h |
@@ -23,6 +23,7 @@ |
#include "webrtc/base/swap_queue.h" |
#include "webrtc/base/thread_annotations.h" |
#include "webrtc/modules/audio_processing/audio_buffer.h" |
+#include "webrtc/modules/audio_processing/include/aec_dump.h" |
#include "webrtc/modules/audio_processing/include/audio_processing.h" |
#include "webrtc/modules/audio_processing/render_queue_item_verifier.h" |
#include "webrtc/modules/audio_processing/rms_level.h" |
@@ -64,6 +65,8 @@ class AudioProcessingImpl : public AudioProcessing { |
void ApplyConfig(const AudioProcessing::Config& config) override; |
void SetExtraOptions(const webrtc::Config& config) override; |
void UpdateHistogramsOnCallEnd() override; |
+ void AttachAecDump(std::unique_ptr<AecDump> aec_dump) override; |
+ void DetachAecDump() override; |
int StartDebugRecording(const char filename[kMaxFilenameSize], |
int64_t max_log_size_bytes) override; |
int StartDebugRecording(FILE* handle, int64_t max_log_size_bytes) override; |
@@ -278,6 +281,34 @@ class AudioProcessingImpl : public AudioProcessing { |
EXCLUSIVE_LOCKS_REQUIRED(crit_render_); |
int ProcessRenderStreamLocked() EXCLUSIVE_LOCKS_REQUIRED(crit_render_); |
+ // Collects configuration settings from public and private |
+ // submodules to be saved as an audioproc::Config message on the |
+ // AecDump if it is attached. If not |forced|, only writes the current |
+ // config if it is different from the last saved one; if |forced|, |
+ // writes the config regardless of the last saved. |
+ void WriteAecDumpConfigMessage(bool forced) |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
+ |
+ // Notifies attached AecDump of current configuration and capture data. |
+ void RecordUnprocessedCaptureStream(const float* const* capture_stream) |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
+ |
+ void RecordUnprocessedCaptureStream(const AudioFrame& capture_frame) |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
+ |
+ // Notifies attached AecDump of current configuration and |
+ // processed capture data and issues a capture stream recording |
+ // request. |
+ void RecordProcessedCaptureStream( |
+ const float* const* processed_capture_stream) |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
+ |
+ void RecordProcessedCaptureStream(const AudioFrame& processed_capture_frame) |
+ EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
+ |
+ // Notifies attached AecDump about current state (delay, drift, etc). |
+ void RecordAudioProcessingState() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_); |
+ |
// Debug dump methods that are internal and called without locks. |
// TODO(peah): Make thread safe. |
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
@@ -302,6 +333,14 @@ class AudioProcessingImpl : public AudioProcessing { |
ApmDebugDumpState debug_dump_; |
#endif |
+ // AecDump instance used for optionally logging APM config, input |
+ // and output to file in the AEC-dump format defined in debug.proto. |
+ std::unique_ptr<AecDump> aec_dump_; |
+ |
+ // Hold the last config written with AecDump for avoiding writing |
+ // the same config twice. |
+ InternalAPMConfig apm_config_for_aec_dump_ GUARDED_BY(crit_capture_); |
+ |
// Critical sections. |
rtc::CriticalSection crit_render_ ACQUIRED_BEFORE(crit_capture_); |
rtc::CriticalSection crit_capture_; |