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

Unified Diff: media/audio/pulse/pulse_input.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/pulse/pulse_input.h ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/pulse/pulse_input.cc
diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc
index 4e48e10ec442d611bdcc2b5e67d78743aaa79780..c365c47b1bc6dbcb94bda31a9ee539eb07c85dca 100644
--- a/media/audio/pulse/pulse_input.cc
+++ b/media/audio/pulse/pulse_input.cc
@@ -66,6 +66,8 @@ void PulseAudioInputStream::Start(AudioInputCallback* callback) {
if (stream_started_)
return;
+ StartAgc();
+
// Clean up the old buffer.
pa_stream_drop(handle_);
buffer_->Clear();
@@ -86,6 +88,8 @@ void PulseAudioInputStream::Stop() {
if (!stream_started_)
return;
+ StopAgc();
+
// Set the flag to false to stop filling new data to soundcard.
stream_started_ = false;
@@ -246,11 +250,10 @@ void PulseAudioInputStream::ReadData() {
// 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.
- // QueryAgcVolume() will trigger a callback to asynchronously update the
- // |volume_|, we disregard the |normalized_volume| from QueryAgcVolume()
+ // We disregard the |normalized_volume| from GetAgcVolume()
// and use the value calculated by |volume_|.
double normalized_volume = 0.0;
- QueryAgcVolume(&normalized_volume);
+ GetAgcVolume(&normalized_volume);
normalized_volume = volume_ / GetMaxVolume();
do {
« no previous file with comments | « media/audio/pulse/pulse_input.h ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698