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

Unified Diff: media/audio/audio_manager_base.cc

Issue 5158003: Implement AudioOutputProxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memleak in the unittests Created 10 years, 1 month 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/audio_manager_base.h ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager_base.cc
diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc
index 95a47f1d09c4f791f79ddb667c51beb4136d78b2..e5222406efe2f706f1525ee11c749f4415d5d884 100644
--- a/media/audio/audio_manager_base.cc
+++ b/media/audio/audio_manager_base.cc
@@ -3,12 +3,21 @@
// found in the LICENSE file.
#include "media/audio/audio_manager_base.h"
+#include "media/audio/audio_output_dispatcher.h"
+#include "media/audio/audio_output_proxy.h"
+
+namespace {
+const int kStreamCloseDelayMs = 5000;
+} // namespace
AudioManagerBase::AudioManagerBase()
: audio_thread_("AudioThread"),
initialized_(false) {
}
+AudioManagerBase::~AudioManagerBase() {
+}
+
void AudioManagerBase::Init() {
initialized_ = audio_thread_.Start();
}
@@ -21,3 +30,16 @@ MessageLoop* AudioManagerBase::GetMessageLoop() {
DCHECK(initialized_);
return audio_thread_.message_loop();
}
+
+AudioOutputStream* AudioManagerBase::MakeAudioOutputStreamProxy(
+ const AudioParameters& params) {
+ if (!initialized_)
+ return NULL;
+
+ scoped_refptr<AudioOutputDispatcher>& dispatcher =
+ output_dispatchers_[params];
+ if (!dispatcher)
+ dispatcher = new AudioOutputDispatcher(this, params, kStreamCloseDelayMs);
+
+ return new AudioOutputProxy(dispatcher);
+}
« no previous file with comments | « media/audio/audio_manager_base.h ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698