| 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/audio_low_latency_input_win.h" | 5 #include "media/audio/win/audio_low_latency_input_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "media/audio/audio_util.h" | 10 #include "media/audio/audio_util.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 // Disable MMCSS. | 439 // Disable MMCSS. |
| 440 if (mm_task && !avrt::AvRevertMmThreadCharacteristics(mm_task)) { | 440 if (mm_task && !avrt::AvRevertMmThreadCharacteristics(mm_task)) { |
| 441 PLOG(WARNING) << "Failed to disable MMCSS"; | 441 PLOG(WARNING) << "Failed to disable MMCSS"; |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 | 444 |
| 445 void WASAPIAudioInputStream::HandleError(HRESULT err) { | 445 void WASAPIAudioInputStream::HandleError(HRESULT err) { |
| 446 NOTREACHED() << "Error code: " << err; | 446 NOTREACHED() << "Error code: " << err; |
| 447 if (sink_) | 447 if (sink_) |
| 448 sink_->OnError(this, static_cast<int>(err)); | 448 sink_->OnError(this); |
| 449 } | 449 } |
| 450 | 450 |
| 451 HRESULT WASAPIAudioInputStream::SetCaptureDevice() { | 451 HRESULT WASAPIAudioInputStream::SetCaptureDevice() { |
| 452 ScopedComPtr<IMMDeviceEnumerator> enumerator; | 452 ScopedComPtr<IMMDeviceEnumerator> enumerator; |
| 453 HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), | 453 HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), |
| 454 NULL, | 454 NULL, |
| 455 CLSCTX_INPROC_SERVER, | 455 CLSCTX_INPROC_SERVER, |
| 456 __uuidof(IMMDeviceEnumerator), | 456 __uuidof(IMMDeviceEnumerator), |
| 457 enumerator.ReceiveVoid()); | 457 enumerator.ReceiveVoid()); |
| 458 if (SUCCEEDED(hr)) { | 458 if (SUCCEEDED(hr)) { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 return hr; | 628 return hr; |
| 629 | 629 |
| 630 // Obtain a reference to the ISimpleAudioVolume interface which enables | 630 // Obtain a reference to the ISimpleAudioVolume interface which enables |
| 631 // us to control the master volume level of an audio session. | 631 // us to control the master volume level of an audio session. |
| 632 hr = audio_client_->GetService(__uuidof(ISimpleAudioVolume), | 632 hr = audio_client_->GetService(__uuidof(ISimpleAudioVolume), |
| 633 simple_audio_volume_.ReceiveVoid()); | 633 simple_audio_volume_.ReceiveVoid()); |
| 634 return hr; | 634 return hr; |
| 635 } | 635 } |
| 636 | 636 |
| 637 } // namespace media | 637 } // namespace media |
| OLD | NEW |