Chromium Code Reviews| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 DVLOG(1) << "Close"; | 530 DVLOG(1) << "Close"; |
| 531 // It is valid to call Close() before calling open or Start(). | 531 // It is valid to call Close() before calling open or Start(). |
| 532 // It is also valid to call Close() after Start() has been called. | 532 // It is also valid to call Close() after Start() has been called. |
| 533 if (IsRunning()) { | 533 if (IsRunning()) { |
| 534 Stop(); | 534 Stop(); |
| 535 } | 535 } |
| 536 // Uninitialize and dispose the audio unit. | 536 // Uninitialize and dispose the audio unit. |
| 537 CloseAudioUnit(); | 537 CloseAudioUnit(); |
| 538 // Disable the listener for device property changes. | 538 // Disable the listener for device property changes. |
| 539 DeRegisterDeviceChangeListener(); | 539 DeRegisterDeviceChangeListener(); |
| 540 // Check if any device property changes are added by filtering out a selected | 540 // Add more UMA stats but only if AGC was activated, i.e. for e.g. WebRTC |
| 541 // set of the |device_property_changes_map_| map. Add UMA stats if valuable | 541 // audio input streams. |
| 542 // data is found. | 542 if (GetAutomaticGainControl()) { |
| 543 AddDevicePropertyChangesToUMA(false); | 543 // Check if any device property changes are added by filtering out a |
| 544 // selected set of the |device_property_changes_map_| map. Add UMA stats | |
| 545 // if valuable data is found. | |
| 546 AddDevicePropertyChangesToUMA(false); | |
| 547 // Log if call to Start() was deferred or not. To be compared with | |
|
Ilya Sherman
2016/03/02 22:57:24
nit: s/Log if ... or not/Log whether ...
henrika (OOO until Aug 14)
2016/03/03 09:44:39
Done.
| |
| 548 // Media.Audio.InputStartWasDeferredMac which logs the same value but only | |
| 549 // when input audio fail to start. | |
|
Ilya Sherman
2016/03/02 22:57:24
nit: s/fail/fails
henrika (OOO until Aug 14)
2016/03/03 09:44:39
Done.
| |
| 550 UMA_HISTOGRAM_BOOLEAN("Media.Audio.InputStartWasDeferredAudioWorkedMac", | |
| 551 start_was_deferred_); | |
| 552 // Log if a change of I/O buffer size was required. To be compared with | |
| 553 // Media.Audio.InputBufferSizeWasChangedMac which logs the same value but | |
| 554 // only when input audio fail to start. | |
| 555 UMA_HISTOGRAM_BOOLEAN("Media.Audio.InputBufferSizeWasChangedAudioWorkedMac", | |
| 556 buffer_size_was_changed_); | |
| 557 // TODO(henrika): possibly add more values here... | |
| 558 } | |
| 544 // Inform the audio manager that we have been closed. This will cause our | 559 // Inform the audio manager that we have been closed. This will cause our |
| 545 // destruction. | 560 // destruction. |
| 546 manager_->ReleaseInputStream(this); | 561 manager_->ReleaseInputStream(this); |
| 547 } | 562 } |
| 548 | 563 |
| 549 double AUAudioInputStream::GetMaxVolume() { | 564 double AUAudioInputStream::GetMaxVolume() { |
| 550 // Verify that we have a valid device. | 565 // Verify that we have a valid device. |
| 551 if (input_device_id_ == kAudioObjectUnknown) { | 566 if (input_device_id_ == kAudioObjectUnknown) { |
| 552 NOTREACHED() << "Device ID is unknown"; | 567 NOTREACHED() << "Device ID is unknown"; |
| 553 return 0.0; | 568 return 0.0; |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1228 } | 1243 } |
| 1229 DVLOG(1) << "property: " << device_property << " (" | 1244 DVLOG(1) << "property: " << device_property << " (" |
| 1230 << FourCharFormatCodeToString(device_property) << ")" | 1245 << FourCharFormatCodeToString(device_property) << ")" |
| 1231 << " changed: " << change_count; | 1246 << " changed: " << change_count; |
| 1232 LogDevicePropertyChange(startup_failed, uma_result); | 1247 LogDevicePropertyChange(startup_failed, uma_result); |
| 1233 } | 1248 } |
| 1234 device_property_changes_map_.clear(); | 1249 device_property_changes_map_.clear(); |
| 1235 } | 1250 } |
| 1236 | 1251 |
| 1237 } // namespace media | 1252 } // namespace media |
| OLD | NEW |