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 #include <CoreServices/CoreServices.h> | 6 #include <CoreServices/CoreServices.h> |
7 #include <mach/mach.h> | 7 #include <mach/mach.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 << "AudioUnitGetProperty(kAudioOutputUnitProperty_IsRunning) failed"; | 1017 << "AudioUnitGetProperty(kAudioOutputUnitProperty_IsRunning) failed"; |
1018 return (error == noErr && is_running); | 1018 return (error == noErr && is_running); |
1019 } | 1019 } |
1020 | 1020 |
1021 void AUAudioInputStream::HandleError(OSStatus err) { | 1021 void AUAudioInputStream::HandleError(OSStatus err) { |
1022 // Log the latest OSStatus error message and also change the sign of the | 1022 // Log the latest OSStatus error message and also change the sign of the |
1023 // error if no callbacks are active. I.e., the sign of the error message | 1023 // error if no callbacks are active. I.e., the sign of the error message |
1024 // carries one extra level of information. | 1024 // carries one extra level of information. |
1025 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.InputErrorMac", | 1025 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.InputErrorMac", |
1026 GetInputCallbackIsActive() ? err : (err * -1)); | 1026 GetInputCallbackIsActive() ? err : (err * -1)); |
1027 NOTREACHED() << "error " << GetMacOSStatusErrorString(err) << " (" << err | 1027 NOTREACHED() << "error " << logging::DescriptionFromOSStatus(err) << " (" |
1028 << ")"; | 1028 << err << ")"; |
1029 if (sink_) | 1029 if (sink_) |
1030 sink_->OnError(this); | 1030 sink_->OnError(this); |
1031 } | 1031 } |
1032 | 1032 |
1033 bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { | 1033 bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { |
1034 Boolean is_settable = false; | 1034 Boolean is_settable = false; |
1035 AudioObjectPropertyAddress property_address = { | 1035 AudioObjectPropertyAddress property_address = { |
1036 kAudioDevicePropertyVolumeScalar, kAudioDevicePropertyScopeInput, | 1036 kAudioDevicePropertyVolumeScalar, kAudioDevicePropertyScopeInput, |
1037 static_cast<UInt32>(channel)}; | 1037 static_cast<UInt32>(channel)}; |
1038 OSStatus result = AudioObjectIsPropertySettable( | 1038 OSStatus result = AudioObjectIsPropertySettable( |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 } | 1193 } |
1194 DVLOG(1) << "property: " << device_property << " (" | 1194 DVLOG(1) << "property: " << device_property << " (" |
1195 << FourCharFormatCodeToString(device_property) << ")" | 1195 << FourCharFormatCodeToString(device_property) << ")" |
1196 << " changed: " << change_count; | 1196 << " changed: " << change_count; |
1197 LogDevicePropertyChange(startup_failed, uma_result); | 1197 LogDevicePropertyChange(startup_failed, uma_result); |
1198 } | 1198 } |
1199 device_property_changes_map_.clear(); | 1199 device_property_changes_map_.clear(); |
1200 } | 1200 } |
1201 | 1201 |
1202 } // namespace media | 1202 } // namespace media |
OLD | NEW |