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

Side by Side Diff: media/audio/audio_manager_base.cc

Issue 10440115: Turn on audio mixer by default. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 145 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
146 if (cmd_line->HasSwitch(switches::kEnableAudioMixer)) { 146 if (!cmd_line->HasSwitch(switches::kDisableAudioMixer)) {
147 dispatcher = new AudioOutputMixer(this, params, close_delay); 147 dispatcher = new AudioOutputMixer(this, params, close_delay);
148 } else { 148 } else {
149 dispatcher = new AudioOutputDispatcherImpl(this, params, close_delay); 149 dispatcher = new AudioOutputDispatcherImpl(this, params, close_delay);
150 } 150 }
151 } 151 }
152 return new AudioOutputProxy(dispatcher); 152 return new AudioOutputProxy(dispatcher);
153 } 153 }
154 154
155 bool AudioManagerBase::CanShowAudioInputSettings() { 155 bool AudioManagerBase::CanShowAudioInputSettings() {
156 return false; 156 return false;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // So, better crash now than later. 233 // So, better crash now than later.
234 DCHECK(dispatcher->HasOneRef()) << "AudioOutputProxies are still alive"; 234 DCHECK(dispatcher->HasOneRef()) << "AudioOutputProxies are still alive";
235 dispatcher = NULL; 235 dispatcher = NULL;
236 } 236 }
237 } 237 }
238 238
239 output_dispatchers_.clear(); 239 output_dispatchers_.clear();
240 } 240 }
241 241
242 } // namespace media 242 } // namespace media
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_renderer_host_unittest.cc ('k') | media/base/media_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698