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

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: Created 6 years, 10 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 5bcbb6dd9e0177190f41451534486957f6f10cae..f701a551dc78b94e04be5cce9a80ac37f05238bd 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -211,6 +211,12 @@ void MediaStreamAudioProcessor::OnPlayoutData(media::AudioBus* audio_bus,
audio_processing_->AnalyzeReverseStream(&render_frame_);
}
+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_);
@@ -406,8 +412,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

Powered by Google App Engine
This is Rietveld 408576698