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_io.h" | 5 #include "media/audio/audio_io.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <objbase.h> // This has to be before initguid.h | 8 #include <objbase.h> // This has to be before initguid.h |
9 #include <initguid.h> | 9 #include <initguid.h> |
10 #include <mmsystem.h> | 10 #include <mmsystem.h> |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 // Factory for the implementations of AudioOutputStream for AUDIO_PCM_LINEAR | 238 // Factory for the implementations of AudioOutputStream for AUDIO_PCM_LINEAR |
239 // mode. | 239 // mode. |
240 // - PCMWaveOutAudioOutputStream: Based on the waveOut API. | 240 // - PCMWaveOutAudioOutputStream: Based on the waveOut API. |
241 AudioOutputStream* AudioManagerWin::MakeLinearOutputStream( | 241 AudioOutputStream* AudioManagerWin::MakeLinearOutputStream( |
242 const AudioParameters& params) { | 242 const AudioParameters& params) { |
243 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 243 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
244 if (params.channels() > kWinMaxChannels) | 244 if (params.channels() > kWinMaxChannels) |
245 return NULL; | 245 return NULL; |
246 | 246 |
247 return new PCMWaveOutAudioOutputStream(this, params, 3, WAVE_MAPPER); | 247 return new PCMWaveOutAudioOutputStream(this, |
| 248 params, |
| 249 media::NumberOfWaveOutBuffers(), |
| 250 WAVE_MAPPER); |
248 } | 251 } |
249 | 252 |
250 // Factory for the implementations of AudioOutputStream for | 253 // Factory for the implementations of AudioOutputStream for |
251 // AUDIO_PCM_LOW_LATENCY mode. Two implementations should suffice most | 254 // AUDIO_PCM_LOW_LATENCY mode. Two implementations should suffice most |
252 // windows user's needs. | 255 // windows user's needs. |
253 // - PCMWaveOutAudioOutputStream: Based on the waveOut API. | 256 // - PCMWaveOutAudioOutputStream: Based on the waveOut API. |
254 // - WASAPIAudioOutputStream: Based on Core Audio (WASAPI) API. | 257 // - WASAPIAudioOutputStream: Based on Core Audio (WASAPI) API. |
255 AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream( | 258 AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream( |
256 const AudioParameters& params) { | 259 const AudioParameters& params) { |
257 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 260 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, | 317 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, |
315 xp_device_id); | 318 xp_device_id); |
316 } | 319 } |
317 | 320 |
318 /// static | 321 /// static |
319 AudioManager* CreateAudioManager() { | 322 AudioManager* CreateAudioManager() { |
320 return new AudioManagerWin(); | 323 return new AudioManagerWin(); |
321 } | 324 } |
322 | 325 |
323 } // namespace media | 326 } // namespace media |
OLD | NEW |