| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 void AUAudioInputStream::Stop() { | 281 void AUAudioInputStream::Stop() { |
| 282 if (!started_) | 282 if (!started_) |
| 283 return; | 283 return; |
| 284 StopAgc(); | 284 StopAgc(); |
| 285 OSStatus result = AudioOutputUnitStop(audio_unit_); | 285 OSStatus result = AudioOutputUnitStop(audio_unit_); |
| 286 DCHECK_EQ(result, noErr); | 286 DCHECK_EQ(result, noErr); |
| 287 started_ = false; | 287 started_ = false; |
| 288 sink_ = NULL; | 288 sink_ = NULL; |
| 289 fifo_.Clear(); |
| 289 | 290 |
| 290 OSSTATUS_DLOG_IF(ERROR, result != noErr, result) | 291 OSSTATUS_DLOG_IF(ERROR, result != noErr, result) |
| 291 << "Failed to stop acquiring data"; | 292 << "Failed to stop acquiring data"; |
| 292 } | 293 } |
| 293 | 294 |
| 294 void AUAudioInputStream::Close() { | 295 void AUAudioInputStream::Close() { |
| 295 // It is valid to call Close() before calling open or Start(). | 296 // It is valid to call Close() before calling open or Start(). |
| 296 // It is also valid to call Close() after Start() has been called. | 297 // It is also valid to call Close() after Start() has been called. |
| 297 if (started_) { | 298 if (started_) { |
| 298 Stop(); | 299 Stop(); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 kAudioDevicePropertyScopeInput, | 647 kAudioDevicePropertyScopeInput, |
| 647 static_cast<UInt32>(channel) | 648 static_cast<UInt32>(channel) |
| 648 }; | 649 }; |
| 649 OSStatus result = AudioObjectIsPropertySettable(input_device_id_, | 650 OSStatus result = AudioObjectIsPropertySettable(input_device_id_, |
| 650 &property_address, | 651 &property_address, |
| 651 &is_settable); | 652 &is_settable); |
| 652 return (result == noErr) ? is_settable : false; | 653 return (result == noErr) ? is_settable : false; |
| 653 } | 654 } |
| 654 | 655 |
| 655 } // namespace media | 656 } // namespace media |
| OLD | NEW |