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, | 247 return new PCMWaveOutAudioOutputStream(this, params, 3, WAVE_MAPPER); |
248 params, | |
249 media::NumberOfWaveOutBuffers(), | |
250 WAVE_MAPPER); | |
251 } | 248 } |
252 | 249 |
253 // Factory for the implementations of AudioOutputStream for | 250 // Factory for the implementations of AudioOutputStream for |
254 // AUDIO_PCM_LOW_LATENCY mode. Two implementations should suffice most | 251 // AUDIO_PCM_LOW_LATENCY mode. Two implementations should suffice most |
255 // windows user's needs. | 252 // windows user's needs. |
256 // - PCMWaveOutAudioOutputStream: Based on the waveOut API. | 253 // - PCMWaveOutAudioOutputStream: Based on the waveOut API. |
257 // - WASAPIAudioOutputStream: Based on Core Audio (WASAPI) API. | 254 // - WASAPIAudioOutputStream: Based on Core Audio (WASAPI) API. |
258 AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream( | 255 AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream( |
259 const AudioParameters& params) { | 256 const AudioParameters& params) { |
260 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 257 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, | 314 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, |
318 xp_device_id); | 315 xp_device_id); |
319 } | 316 } |
320 | 317 |
321 /// static | 318 /// static |
322 AudioManager* CreateAudioManager() { | 319 AudioManager* CreateAudioManager() { |
323 return new AudioManagerWin(); | 320 return new AudioManagerWin(); |
324 } | 321 } |
325 | 322 |
326 } // namespace media | 323 } // namespace media |
OLD | NEW |