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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 sample_rate = input_params.sample_rate(); | 496 sample_rate = input_params.sample_rate(); |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 int user_buffer_size = GetUserBufferSize(); | 500 int user_buffer_size = GetUserBufferSize(); |
501 if (user_buffer_size) | 501 if (user_buffer_size) |
502 buffer_size = user_buffer_size; | 502 buffer_size = user_buffer_size; |
503 | 503 |
504 return AudioParameters( | 504 return AudioParameters( |
505 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels, | 505 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels, |
506 sample_rate, bits_per_sample, buffer_size); | 506 sample_rate, bits_per_sample, buffer_size, AudioParameters::NO_EFFECTS); |
507 } | 507 } |
508 | 508 |
509 AudioInputStream* AudioManagerWin::CreatePCMWaveInAudioInputStream( | 509 AudioInputStream* AudioManagerWin::CreatePCMWaveInAudioInputStream( |
510 const AudioParameters& params, | 510 const AudioParameters& params, |
511 const std::string& device_id) { | 511 const std::string& device_id) { |
512 std::string xp_device_id = device_id; | 512 std::string xp_device_id = device_id; |
513 if (device_id != AudioManagerBase::kDefaultDeviceId && | 513 if (device_id != AudioManagerBase::kDefaultDeviceId && |
514 enumeration_type_ == kMMDeviceEnumeration) { | 514 enumeration_type_ == kMMDeviceEnumeration) { |
515 xp_device_id = ConvertToWinXPInputDeviceId(device_id); | 515 xp_device_id = ConvertToWinXPInputDeviceId(device_id); |
516 if (xp_device_id.empty()) { | 516 if (xp_device_id.empty()) { |
517 DLOG(ERROR) << "Cannot find a waveIn device which matches the device ID " | 517 DLOG(ERROR) << "Cannot find a waveIn device which matches the device ID " |
518 << device_id; | 518 << device_id; |
519 return NULL; | 519 return NULL; |
520 } | 520 } |
521 } | 521 } |
522 | 522 |
523 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, | 523 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, |
524 xp_device_id); | 524 xp_device_id); |
525 } | 525 } |
526 | 526 |
527 /// static | 527 /// static |
528 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { | 528 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { |
529 return new AudioManagerWin(audio_log_factory); | 529 return new AudioManagerWin(audio_log_factory); |
530 } | 530 } |
531 | 531 |
532 } // namespace media | 532 } // namespace media |
OLD | NEW |