OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 format.mBitsPerChannel = 8 * kBytesPerSample; | 427 format.mBitsPerChannel = 8 * kBytesPerSample; |
428 return format; | 428 return format; |
429 } | 429 } |
430 | 430 |
431 void VoiceProcessingAudioUnit::DisposeAudioUnit() { | 431 void VoiceProcessingAudioUnit::DisposeAudioUnit() { |
432 if (vpio_unit_) { | 432 if (vpio_unit_) { |
433 switch (state_) { | 433 switch (state_) { |
434 case kStarted: | 434 case kStarted: |
435 Stop(); | 435 Stop(); |
436 // Fall through. | 436 // Fall through. |
437 RTC_FALLTHROUGH(); | 437 FALLTHROUGH(); |
438 case kInitialized: | 438 case kInitialized: |
439 Uninitialize(); | 439 Uninitialize(); |
440 break; | 440 break; |
441 case kUninitialized: | 441 case kUninitialized: |
442 RTC_FALLTHROUGH(); | 442 FALLTHROUGH(); |
443 case kInitRequired: | 443 case kInitRequired: |
444 break; | 444 break; |
445 } | 445 } |
446 | 446 |
447 RTCLog(@"Disposing audio unit."); | 447 RTCLog(@"Disposing audio unit."); |
448 OSStatus result = AudioComponentInstanceDispose(vpio_unit_); | 448 OSStatus result = AudioComponentInstanceDispose(vpio_unit_); |
449 if (result != noErr) { | 449 if (result != noErr) { |
450 RTCLogError(@"AudioComponentInstanceDispose failed. Error=%ld.", | 450 RTCLogError(@"AudioComponentInstanceDispose failed. Error=%ld.", |
451 (long)result); | 451 (long)result); |
452 } | 452 } |
453 vpio_unit_ = nullptr; | 453 vpio_unit_ = nullptr; |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 } // namespace webrtc | 457 } // namespace webrtc |
OLD | NEW |