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

Unified Diff: media/base/audio_renderer_mixer.cc

Issue 12102004: Renderer side audio device change wip... Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/base/audio_renderer_mixer.h ('k') | media/base/audio_renderer_mixer_input.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer.cc
diff --git a/media/base/audio_renderer_mixer.cc b/media/base/audio_renderer_mixer.cc
index cb9b022cdb6f2bfc666ac3aadbcd90d212efabf2..65fe310be7cf1b12615a2e8e87f4864eb9a86d59 100644
--- a/media/base/audio_renderer_mixer.cc
+++ b/media/base/audio_renderer_mixer.cc
@@ -20,7 +20,9 @@ AudioRendererMixer::AudioRendererMixer(
pause_delay_(base::TimeDelta::FromSeconds(kPauseDelaySeconds)),
last_play_time_(base::Time::Now()),
// Initialize |playing_| to true since Start() results in an auto-play.
- playing_(true) {
+ playing_(true),
+ input_params_(input_params),
+ output_params_(output_params) {
audio_sink_->Initialize(output_params, this);
audio_sink_->Start();
}
@@ -90,4 +92,15 @@ void AudioRendererMixer::OnRenderError() {
}
}
+void AudioRendererMixer::OnDeviceChange() {
+ base::AutoLock auto_lock(mixer_inputs_lock_);
+
+ // Iterate and remove elements which receive an updated mixer.
+ for (AudioRendererMixerInputSet::iterator it = mixer_inputs_.begin();
+ it != mixer_inputs_.end(); ++it) {
+ (*it)->OnDeviceChange();
+ }
+}
+
+
} // namespace media
« no previous file with comments | « media/base/audio_renderer_mixer.h ('k') | media/base/audio_renderer_mixer_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698