| 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/win/wavein_input_win.h" | 5 #include "media/audio/win/wavein_input_win.h" |
| 6 | 6 |
| 7 #pragma comment(lib, "winmm.lib") | 7 #pragma comment(lib, "winmm.lib") |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 | 222 |
| 223 bool PCMWaveInAudioInputStream::GetAutomaticGainControl() { | 223 bool PCMWaveInAudioInputStream::GetAutomaticGainControl() { |
| 224 // TODO(henrika): Add AGC support when volume control has been added. | 224 // TODO(henrika): Add AGC support when volume control has been added. |
| 225 NOTIMPLEMENTED(); | 225 NOTIMPLEMENTED(); |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void PCMWaveInAudioInputStream::HandleError(MMRESULT error) { | 229 void PCMWaveInAudioInputStream::HandleError(MMRESULT error) { |
| 230 DLOG(WARNING) << "PCMWaveInAudio error " << error; | 230 DLOG(WARNING) << "PCMWaveInAudio error " << error; |
| 231 callback_->OnError(this, error); | 231 callback_->OnError(this); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void PCMWaveInAudioInputStream::QueueNextPacket(WAVEHDR *buffer) { | 234 void PCMWaveInAudioInputStream::QueueNextPacket(WAVEHDR *buffer) { |
| 235 MMRESULT res = ::waveInAddBuffer(wavein_, buffer, sizeof(WAVEHDR)); | 235 MMRESULT res = ::waveInAddBuffer(wavein_, buffer, sizeof(WAVEHDR)); |
| 236 if (res != MMSYSERR_NOERROR) | 236 if (res != MMSYSERR_NOERROR) |
| 237 HandleError(res); | 237 HandleError(res); |
| 238 } | 238 } |
| 239 | 239 |
| 240 bool PCMWaveInAudioInputStream::GetDeviceId(UINT* device_index) { | 240 bool PCMWaveInAudioInputStream::GetDeviceId(UINT* device_index) { |
| 241 // Deliver the default input device id (WAVE_MAPPER) if the default | 241 // Deliver the default input device id (WAVE_MAPPER) if the default |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ::SetEvent(obj->stopped_event_); | 310 ::SetEvent(obj->stopped_event_); |
| 311 } | 311 } |
| 312 } else if (msg == WIM_CLOSE) { | 312 } else if (msg == WIM_CLOSE) { |
| 313 // Intentionaly no-op for now. | 313 // Intentionaly no-op for now. |
| 314 } else if (msg == WIM_OPEN) { | 314 } else if (msg == WIM_OPEN) { |
| 315 // Intentionaly no-op for now. | 315 // Intentionaly no-op for now. |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 } // namespace media | 319 } // namespace media |
| OLD | NEW |