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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 RTCLog(@"Configuring audio session for WebRTC."); | 681 RTCLog(@"Configuring audio session for WebRTC."); |
682 | 682 |
683 // Configure the AVAudioSession and activate it. | 683 // Configure the AVAudioSession and activate it. |
684 // Provide an error even if there isn't one so we can log it. | 684 // Provide an error even if there isn't one so we can log it. |
685 NSError *error = nil; | 685 NSError *error = nil; |
686 RTCAudioSessionConfiguration *webRTCConfig = | 686 RTCAudioSessionConfiguration *webRTCConfig = |
687 [RTCAudioSessionConfiguration webRTCConfiguration]; | 687 [RTCAudioSessionConfiguration webRTCConfiguration]; |
688 if (![self setConfiguration:webRTCConfig active:YES error:&error]) { | 688 if (![self setConfiguration:webRTCConfig active:YES error:&error]) { |
689 RTCLogError(@"Failed to set WebRTC audio configuration: %@", | 689 RTCLogError(@"Failed to set WebRTC audio configuration: %@", |
690 error.localizedDescription); | 690 error.localizedDescription); |
691 [self unconfigureWebRTCSession:nil]; | 691 // Do not call setActive:NO if setActive:YES failed. |
692 if (outError) { | 692 if (outError) { |
693 *outError = error; | 693 *outError = error; |
694 } | 694 } |
695 return NO; | 695 return NO; |
696 } | 696 } |
697 | 697 |
698 // Ensure that the device currently supports audio input. | 698 // Ensure that the device currently supports audio input. |
699 // TODO(tkchin): Figure out if this is really necessary. | 699 // TODO(tkchin): Figure out if this is really necessary. |
700 if (!self.inputAvailable) { | 700 if (!self.inputAvailable) { |
701 RTCLogError(@"No audio input path is available!"); | 701 RTCLogError(@"No audio input path is available!"); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 - (void)notifyDidStopPlayOrRecord { | 874 - (void)notifyDidStopPlayOrRecord { |
875 for (auto delegate : self.delegates) { | 875 for (auto delegate : self.delegates) { |
876 SEL sel = @selector(audioSessionDidStopPlayOrRecord:); | 876 SEL sel = @selector(audioSessionDidStopPlayOrRecord:); |
877 if ([delegate respondsToSelector:sel]) { | 877 if ([delegate respondsToSelector:sel]) { |
878 [delegate audioSessionDidStopPlayOrRecord:self]; | 878 [delegate audioSessionDidStopPlayOrRecord:self]; |
879 } | 879 } |
880 } | 880 } |
881 } | 881 } |
882 | 882 |
883 @end | 883 @end |
OLD | NEW |