Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: content/renderer/media/media_stream_audio_processor.cc

Issue 2103483002: Add UMA stats for AEC filter divergence metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_processor.cc
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index 272a70fe2f7dc8071d7bb5707da78a2a1fc4663b..c02696e068432520252b7d2d6d31ef0a2694735c 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -287,6 +287,7 @@ MediaStreamAudioProcessor::MediaStreamAudioProcessor(
WebRtcPlayoutDataSource* playout_data_source)
: render_delay_ms_(0),
playout_data_source_(playout_data_source),
+ main_thread_message_loop_(base::MessageLoop::current()),
audio_mirroring_(false),
typing_detected_(false),
stopped_(false) {
@@ -389,6 +390,7 @@ bool MediaStreamAudioProcessor::ProcessAndConsumeData(
void MediaStreamAudioProcessor::Stop() {
DCHECK(main_thread_checker_.CalledOnValidThread());
+
if (stopped_)
return;
@@ -409,6 +411,9 @@ void MediaStreamAudioProcessor::Stop() {
playout_data_source_->RemovePlayoutSink(this);
playout_data_source_ = NULL;
}
+
+ if (echo_information_)
+ echo_information_->ReportAndResetAecDivergentFilterStats();
}
const media::AudioParameters& MediaStreamAudioProcessor::InputFormat() const {
@@ -756,13 +761,18 @@ int MediaStreamAudioProcessor::ProcessData(const float* const* process_ptrs,
base::subtle::Release_Store(&typing_detected_, detected);
}
- if (echo_information_) {
- echo_information_.get()->UpdateAecDelayStats(ap->echo_cancellation());
- }
+ main_thread_message_loop_->PostTask(
+ FROM_HERE, base::Bind(&MediaStreamAudioProcessor::UpdateAecStats, this));
// Return 0 if the volume hasn't been changed, and otherwise the new volume.
return (agc->stream_analog_level() == volume) ?
0 : agc->stream_analog_level();
}
+void MediaStreamAudioProcessor::UpdateAecStats() {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
+ if (echo_information_)
+ echo_information_->UpdateAecStats(audio_processing_->echo_cancellation());
+}
+
} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_audio_processor.h ('k') | content/renderer/media/media_stream_audio_processor_options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698