| 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/mac/audio_low_latency_input_mac.h" | 5 #include "media/audio/mac/audio_low_latency_input_mac.h" |
| 6 | 6 |
| 7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 return 0; | 634 return 0; |
| 635 } | 635 } |
| 636 | 636 |
| 637 return static_cast<int>(stream_format.mChannelsPerFrame); | 637 return static_cast<int>(stream_format.mChannelsPerFrame); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void AUAudioInputStream::HandleError(OSStatus err) { | 640 void AUAudioInputStream::HandleError(OSStatus err) { |
| 641 NOTREACHED() << "error " << GetMacOSStatusErrorString(err) | 641 NOTREACHED() << "error " << GetMacOSStatusErrorString(err) |
| 642 << " (" << err << ")"; | 642 << " (" << err << ")"; |
| 643 if (sink_) | 643 if (sink_) |
| 644 sink_->OnError(this, static_cast<int>(err)); | 644 sink_->OnError(this); |
| 645 } | 645 } |
| 646 | 646 |
| 647 bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { | 647 bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { |
| 648 Boolean is_settable = false; | 648 Boolean is_settable = false; |
| 649 AudioObjectPropertyAddress property_address = { | 649 AudioObjectPropertyAddress property_address = { |
| 650 kAudioDevicePropertyVolumeScalar, | 650 kAudioDevicePropertyVolumeScalar, |
| 651 kAudioDevicePropertyScopeInput, | 651 kAudioDevicePropertyScopeInput, |
| 652 static_cast<UInt32>(channel) | 652 static_cast<UInt32>(channel) |
| 653 }; | 653 }; |
| 654 OSStatus result = AudioObjectIsPropertySettable(input_device_id_, | 654 OSStatus result = AudioObjectIsPropertySettable(input_device_id_, |
| 655 &property_address, | 655 &property_address, |
| 656 &is_settable); | 656 &is_settable); |
| 657 return (result == noErr) ? is_settable : false; | 657 return (result == noErr) ? is_settable : false; |
| 658 } | 658 } |
| 659 | 659 |
| 660 } // namespace media | 660 } // namespace media |
| OLD | NEW |