OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 AudioOutputStream* AudioManagerBase::MakeAudioOutputStreamProxy( | 136 AudioOutputStream* AudioManagerBase::MakeAudioOutputStreamProxy( |
137 const AudioParameters& params) { | 137 const AudioParameters& params) { |
138 DCHECK(GetMessageLoop()->BelongsToCurrentThread()); | 138 DCHECK(GetMessageLoop()->BelongsToCurrentThread()); |
139 | 139 |
140 scoped_refptr<AudioOutputDispatcher>& dispatcher = | 140 scoped_refptr<AudioOutputDispatcher>& dispatcher = |
141 output_dispatchers_[params]; | 141 output_dispatchers_[params]; |
142 if (!dispatcher) { | 142 if (!dispatcher) { |
143 base::TimeDelta close_delay = | 143 base::TimeDelta close_delay = |
144 base::TimeDelta::FromSeconds(kStreamCloseDelaySeconds); | 144 base::TimeDelta::FromSeconds(kStreamCloseDelaySeconds); |
145 // TODO(dalecurtis): Temporarily disable the mixer for non-Windows/Mac platforms | |
146 // until a fix for http://crbug.com/138098 can be found. | |
147 #if defined(OS_WIN) || defined(OS_MACOSX) | |
148 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 145 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
149 if (!cmd_line->HasSwitch(switches::kDisableAudioMixer)) { | 146 // TODO(dalecurtis): Browser side mixing has a couple issues that must be |
| 147 // fixed before it can be turned on by default: http://crbug.com/138098 and |
| 148 // http://crbug.com/140247 |
| 149 if (cmd_line->HasSwitch(switches::kEnableAudioMixer)) { |
150 dispatcher = new AudioOutputMixer(this, params, close_delay); | 150 dispatcher = new AudioOutputMixer(this, params, close_delay); |
151 } else | 151 } else { |
152 #endif | |
153 { | |
154 dispatcher = new AudioOutputDispatcherImpl(this, params, close_delay); | 152 dispatcher = new AudioOutputDispatcherImpl(this, params, close_delay); |
155 } | 153 } |
156 } | 154 } |
157 return new AudioOutputProxy(dispatcher); | 155 return new AudioOutputProxy(dispatcher); |
158 } | 156 } |
159 | 157 |
160 bool AudioManagerBase::CanShowAudioInputSettings() { | 158 bool AudioManagerBase::CanShowAudioInputSettings() { |
161 return false; | 159 return false; |
162 } | 160 } |
163 | 161 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // So, better crash now than later. | 236 // So, better crash now than later. |
239 DCHECK(dispatcher->HasOneRef()) << "AudioOutputProxies are still alive"; | 237 DCHECK(dispatcher->HasOneRef()) << "AudioOutputProxies are still alive"; |
240 dispatcher = NULL; | 238 dispatcher = NULL; |
241 } | 239 } |
242 } | 240 } |
243 | 241 |
244 output_dispatchers_.clear(); | 242 output_dispatchers_.clear(); |
245 } | 243 } |
246 | 244 |
247 } // namespace media | 245 } // namespace media |
OLD | NEW |