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

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

Issue 185413009: Implements the GetSignalLevel and GetStats interface for the local audio track. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased Created 6 years, 9 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 720afbf5e54306e641eb207f1d6d0616410599b5..5f87f19c6465fda7761f7a2370b02783d1a7c71e 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -226,6 +226,12 @@ void MediaStreamAudioProcessor::OnPlayoutDataSourceChanged() {
render_converter_.reset();
}
+void MediaStreamAudioProcessor::GetStats(AudioProcessorStats* stats) {
+ stats->typing_noise_detected =
+ (base::subtle::Acquire_Load(&typing_detected_) != false);
+ GetAecStats(audio_processing_.get(), stats);
+}
+
void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
const blink::WebMediaConstraints& constraints, int effects) {
DCHECK(!audio_processing_);
@@ -425,8 +431,8 @@ int MediaStreamAudioProcessor::ProcessData(webrtc::AudioFrame* audio_frame,
audio_frame->vad_activity_ != webrtc::AudioFrame::kVadUnknown) {
bool vad_active =
(audio_frame->vad_activity_ == webrtc::AudioFrame::kVadActive);
- // TODO(xians): Pass this |typing_detected_| to peer connection.
- typing_detected_ = typing_detector_->Process(key_pressed, vad_active);
+ bool typing_detected = typing_detector_->Process(key_pressed, vad_active);
+ base::subtle::Release_Store(&typing_detected_, typing_detected);
}
// Return 0 if the volume has not been changed, otherwise return the new
« 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