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

Unified Diff: media/audio/linux/alsa_input.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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/linux/alsa_output_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/linux/alsa_input.cc
===================================================================
--- media/audio/linux/alsa_input.cc (revision 114012)
+++ media/audio/linux/alsa_input.cc (working copy)
@@ -22,10 +22,12 @@
const char* AlsaPcmInputStream::kAutoSelectDevice = "";
-AlsaPcmInputStream::AlsaPcmInputStream(const std::string& device_name,
+AlsaPcmInputStream::AlsaPcmInputStream(AudioManagerLinux* audio_manager,
+ const std::string& device_name,
const AudioParameters& params,
AlsaWrapper* wrapper)
- : device_name_(device_name),
+ : audio_manager_(audio_manager),
+ device_name_(device_name),
params_(params),
bytes_per_packet_(params.samples_per_packet *
(params.channels * params.bits_per_sample) / 8),
@@ -110,8 +112,7 @@
base::Bind(&AlsaPcmInputStream::ReadAudio, weak_factory_.GetWeakPtr()),
delay_ms);
- static_cast<AudioManagerLinux*>(AudioManager::GetAudioManager())->
- IncreaseActiveInputStreamCount();
+ audio_manager_->IncreaseActiveInputStreamCount();
}
}
@@ -224,8 +225,7 @@
// Stop is always called before Close. In case of error, this will be
// also called when closing the input controller.
- static_cast<AudioManagerLinux*>(AudioManager::GetAudioManager())->
- DecreaseActiveInputStreamCount();
+ audio_manager_->DecreaseActiveInputStreamCount();
weak_factory_.InvalidateWeakPtrs(); // Cancel the next scheduled read.
int error = wrapper_->PcmDrop(device_handle_);
« no previous file with comments | « media/audio/linux/alsa_input.h ('k') | media/audio/linux/alsa_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698