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

Unified Diff: media/audio/mac/audio_low_latency_input_mac.cc

Issue 15563004: Improved AGC update scheme for the audio backend in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Start/Stop APIs for the AGC part Created 7 years, 7 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
« no previous file with comments | « media/audio/mac/audio_low_latency_input_mac.h ('k') | media/audio/pulse/pulse_input.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_low_latency_input_mac.cc
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index cf9d180a4b92df06c9fefe492d7764d8a0f3c67c..ff2f83f6979278010f7e5ba51995139771478c48 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -268,6 +268,7 @@ void AUAudioInputStream::Start(AudioInputCallback* callback) {
if (started_ || !audio_unit_)
return;
sink_ = callback;
+ StartAgc();
OSStatus result = AudioOutputUnitStart(audio_unit_);
if (result == noErr) {
started_ = true;
@@ -279,6 +280,7 @@ void AUAudioInputStream::Start(AudioInputCallback* callback) {
void AUAudioInputStream::Stop() {
if (!started_)
return;
+ StopAgc();
OSStatus result = AudioOutputUnitStop(audio_unit_);
if (result == noErr) {
started_ = false;
@@ -483,11 +485,11 @@ OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames,
// Update the capture latency.
double capture_latency_frames = GetCaptureLatency(time_stamp);
- // Update the AGC volume level once every second. Note that, |volume| is
- // also updated each time SetVolume() is called through IPC by the
- // render-side AGC.
+ // The AGC volume level is updated once every second on a separate thread.
+ // Note that, |volume| is also updated each time SetVolume() is called
+ // through IPC by the render-side AGC.
double normalized_volume = 0.0;
- QueryAgcVolume(&normalized_volume);
+ GetAgcVolume(&normalized_volume);
AudioBuffer& buffer = io_data->mBuffers[0];
uint8* audio_data = reinterpret_cast<uint8*>(buffer.mData);
« no previous file with comments | « media/audio/mac/audio_low_latency_input_mac.h ('k') | media/audio/pulse/pulse_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698