| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/mac_logging.h" | 10 #include "base/mac/mac_logging.h" |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 input_device_id_, &property_address, 0, nullptr, &size, &stream_format); | 768 input_device_id_, &property_address, 0, nullptr, &size, &stream_format); |
| 769 if (result != noErr) { | 769 if (result != noErr) { |
| 770 DLOG(WARNING) << "Could not get stream format"; | 770 DLOG(WARNING) << "Could not get stream format"; |
| 771 return 0; | 771 return 0; |
| 772 } | 772 } |
| 773 | 773 |
| 774 return static_cast<int>(stream_format.mChannelsPerFrame); | 774 return static_cast<int>(stream_format.mChannelsPerFrame); |
| 775 } | 775 } |
| 776 | 776 |
| 777 void AUAudioInputStream::HandleError(OSStatus err) { | 777 void AUAudioInputStream::HandleError(OSStatus err) { |
| 778 UMA_HISTOGRAM_SPARSE_SLOWLY("Media.InputErrorMac", err); |
| 778 NOTREACHED() << "error " << GetMacOSStatusErrorString(err) | 779 NOTREACHED() << "error " << GetMacOSStatusErrorString(err) |
| 779 << " (" << err << ")"; | 780 << " (" << err << ")"; |
| 780 if (sink_) | 781 if (sink_) |
| 781 sink_->OnError(this); | 782 sink_->OnError(this); |
| 782 } | 783 } |
| 783 | 784 |
| 784 bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { | 785 bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { |
| 785 Boolean is_settable = false; | 786 Boolean is_settable = false; |
| 786 AudioObjectPropertyAddress property_address = { | 787 AudioObjectPropertyAddress property_address = { |
| 787 kAudioDevicePropertyVolumeScalar, | 788 kAudioDevicePropertyVolumeScalar, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 manager_->low_latency_input_streams()); | 849 manager_->low_latency_input_streams()); |
| 849 UMA_HISTOGRAM_COUNTS_1000("Media.Audio.NumberOfBasicInputStreamsMac", | 850 UMA_HISTOGRAM_COUNTS_1000("Media.Audio.NumberOfBasicInputStreamsMac", |
| 850 manager_->basic_input_streams()); | 851 manager_->basic_input_streams()); |
| 851 // TODO(henrika): this value will currently always report true. It should be | 852 // TODO(henrika): this value will currently always report true. It should be |
| 852 // fixed when we understand the problem better. | 853 // fixed when we understand the problem better. |
| 853 UMA_HISTOGRAM_BOOLEAN("Media.Audio.AutomaticGainControlMac", | 854 UMA_HISTOGRAM_BOOLEAN("Media.Audio.AutomaticGainControlMac", |
| 854 GetAutomaticGainControl()); | 855 GetAutomaticGainControl()); |
| 855 } | 856 } |
| 856 | 857 |
| 857 } // namespace media | 858 } // namespace media |
| OLD | NEW |