Chromium Code Reviews| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 DCHECK(GetMessageLoop()->BelongsToCurrentThread()); | 150 DCHECK(GetMessageLoop()->BelongsToCurrentThread()); |
| 151 | 151 |
| 152 AudioOutputDispatchersMap::iterator it = output_dispatchers_.find(params); | 152 AudioOutputDispatchersMap::iterator it = output_dispatchers_.find(params); |
| 153 if (it != output_dispatchers_.end()) | 153 if (it != output_dispatchers_.end()) |
| 154 return new AudioOutputProxy(it->second); | 154 return new AudioOutputProxy(it->second); |
| 155 | 155 |
| 156 base::TimeDelta close_delay = | 156 base::TimeDelta close_delay = |
| 157 base::TimeDelta::FromSeconds(kStreamCloseDelaySeconds); | 157 base::TimeDelta::FromSeconds(kStreamCloseDelaySeconds); |
| 158 | 158 |
| 159 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 159 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 160 if (cmd_line->HasSwitch(switches::kEnableAudioOutputResampler) && | 160 if (!cmd_line->HasSwitch(switches::kDisableAudioOutputResampler) && |
| 161 params.format() == AudioParameters::AUDIO_PCM_LOW_LATENCY) { | 161 params.format() == AudioParameters::AUDIO_PCM_LOW_LATENCY) { |
|
scherkus (not reviewing)
2012/09/13 12:43:09
to confirm -- this will affect web audio + web rtc
DaleCurtis
2012/09/14 09:04:44
Henrik says WebRTC will be okay since it uses the
| |
| 162 scoped_refptr<AudioOutputDispatcher> dispatcher = new AudioOutputResampler( | 162 scoped_refptr<AudioOutputDispatcher> dispatcher = new AudioOutputResampler( |
| 163 this, params, | 163 this, params, |
| 164 GetPreferredLowLatencyOutputStreamParameters(params.channel_layout()), | 164 GetPreferredLowLatencyOutputStreamParameters(params.channel_layout()), |
| 165 close_delay); | 165 close_delay); |
| 166 output_dispatchers_[params] = dispatcher; | 166 output_dispatchers_[params] = dispatcher; |
| 167 return new AudioOutputProxy(dispatcher); | 167 return new AudioOutputProxy(dispatcher); |
| 168 } | 168 } |
| 169 | 169 |
| 170 #if defined(ENABLE_AUDIO_MIXER) | 170 #if defined(ENABLE_AUDIO_MIXER) |
| 171 // TODO(dalecurtis): Browser side mixing has a couple issues that must be | 171 // TODO(dalecurtis): Browser side mixing has a couple issues that must be |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 AudioParameters AudioManagerBase::GetPreferredLowLatencyOutputStreamParameters( | 281 AudioParameters AudioManagerBase::GetPreferredLowLatencyOutputStreamParameters( |
| 282 ChannelLayout channel_layout) { | 282 ChannelLayout channel_layout) { |
| 283 // TODO(dalecurtis): This should include bits per channel and channel layout | 283 // TODO(dalecurtis): This should include bits per channel and channel layout |
| 284 // eventually. | 284 // eventually. |
| 285 return AudioParameters( | 285 return AudioParameters( |
| 286 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, | 286 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, |
| 287 GetAudioHardwareSampleRate(), 16, GetAudioHardwareBufferSize()); | 287 GetAudioHardwareSampleRate(), 16, GetAudioHardwareBufferSize()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace media | 290 } // namespace media |
| OLD | NEW |