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

Unified Diff: media/audio/linux/alsa_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/linux/alsa_input.h ('k') | media/audio/mac/audio_low_latency_input_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/linux/alsa_input.cc
diff --git a/media/audio/linux/alsa_input.cc b/media/audio/linux/alsa_input.cc
index 8f785301bf9ee2fb52f223dc45b53e2ff48038e9..ce337d335cb3983368929edae4118253b10c26e6 100644
--- a/media/audio/linux/alsa_input.cc
+++ b/media/audio/linux/alsa_input.cc
@@ -102,6 +102,7 @@ bool AlsaPcmInputStream::Open() {
void AlsaPcmInputStream::Start(AudioInputCallback* callback) {
DCHECK(!callback_ && callback);
callback_ = callback;
+ StartAgc();
int error = wrapper_->PcmPrepare(device_handle_);
if (error < 0) {
HandleError("PcmPrepare", error);
@@ -203,7 +204,7 @@ void AlsaPcmInputStream::ReadAudio() {
// 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(&normalized_volume);
+ GetAgcVolume(&normalized_volume);
while (num_buffers--) {
int frames_read = wrapper_->PcmReadi(device_handle_, audio_buffer_.get(),
@@ -240,6 +241,8 @@ void AlsaPcmInputStream::Stop() {
if (!device_handle_ || !callback_)
return;
+ StopAgc();
+
// Stop is always called before Close. In case of error, this will be
// also called when closing the input controller.
audio_manager_->DecreaseActiveInputStreamCount();
« no previous file with comments | « media/audio/linux/alsa_input.h ('k') | media/audio/mac/audio_low_latency_input_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698