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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_manager_base.h ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/audio_manager_base.h" 5 #include "media/audio/audio_manager_base.h"
6 #include "media/audio/audio_output_dispatcher.h"
7 #include "media/audio/audio_output_proxy.h"
8
9 namespace {
10 const int kStreamCloseDelayMs = 5000;
11 } // namespace
6 12
7 AudioManagerBase::AudioManagerBase() 13 AudioManagerBase::AudioManagerBase()
8 : audio_thread_("AudioThread"), 14 : audio_thread_("AudioThread"),
9 initialized_(false) { 15 initialized_(false) {
10 } 16 }
11 17
18 AudioManagerBase::~AudioManagerBase() {
19 }
20
12 void AudioManagerBase::Init() { 21 void AudioManagerBase::Init() {
13 initialized_ = audio_thread_.Start(); 22 initialized_ = audio_thread_.Start();
14 } 23 }
15 24
16 string16 AudioManagerBase::GetAudioInputDeviceModel() { 25 string16 AudioManagerBase::GetAudioInputDeviceModel() {
17 return string16(); 26 return string16();
18 } 27 }
19 28
20 MessageLoop* AudioManagerBase::GetMessageLoop() { 29 MessageLoop* AudioManagerBase::GetMessageLoop() {
21 DCHECK(initialized_); 30 DCHECK(initialized_);
22 return audio_thread_.message_loop(); 31 return audio_thread_.message_loop();
23 } 32 }
33
34 AudioOutputStream* AudioManagerBase::MakeAudioOutputStreamProxy(
35 const AudioParameters& params) {
36 if (!initialized_)
37 return NULL;
38
39 scoped_refptr<AudioOutputDispatcher>& dispatcher =
40 output_dispatchers_[params];
41 if (!dispatcher)
42 dispatcher = new AudioOutputDispatcher(this, params, kStreamCloseDelayMs);
43
44 return new AudioOutputProxy(dispatcher);
45 }
OLDNEW
« 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