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

Unified Diff: media/audio/audio_input_device.cc

Issue 21183002: Adding key press detection in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add linux impl Created 7 years, 4 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: media/audio/audio_input_device.cc
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc
index 87fd57143cd1433568c2dab8b3fc83e52112415a..5477be6e63fd98ad450699a1849f11c6b0163ca0 100644
--- a/media/audio/audio_input_device.cc
+++ b/media/audio/audio_input_device.cc
@@ -294,6 +294,7 @@ void AudioInputDevice::AudioThreadCallback::Process(int pending_data) {
DCHECK_EQ(buffer->params.size,
segment_length_ - sizeof(AudioInputBufferParameters));
double volume = buffer->params.volume;
+ bool key_pressed = buffer->params.key_pressed;
int audio_delay_milliseconds = pending_data / bytes_per_ms_;
int16* memory = reinterpret_cast<int16*>(&buffer->audio[0]);
@@ -308,8 +309,8 @@ void AudioInputDevice::AudioThreadCallback::Process(int pending_data) {
// Deliver captured data to the client in floating point format
// and update the audio-delay measurement.
- capture_callback_->Capture(audio_bus_.get(),
- audio_delay_milliseconds, volume);
+ capture_callback_->Capture(
+ audio_bus_.get(), audio_delay_milliseconds, volume, key_pressed);
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698