| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 LOGI() << "InitPlayOrRecord"; | 790 LOGI() << "InitPlayOrRecord"; |
| 791 | 791 |
| 792 // There should be no audio unit at this point. | 792 // There should be no audio unit at this point. |
| 793 if (!CreateAudioUnit()) { | 793 if (!CreateAudioUnit()) { |
| 794 return false; | 794 return false; |
| 795 } | 795 } |
| 796 | 796 |
| 797 RTCAudioSession* session = [RTCAudioSession sharedInstance]; | 797 RTCAudioSession* session = [RTCAudioSession sharedInstance]; |
| 798 // Subscribe to audio session events. | 798 // Subscribe to audio session events. |
| 799 [session pushDelegate:audio_session_observer_]; | 799 [session pushDelegate:audio_session_observer_]; |
| 800 is_interrupted_ = session.isInterrupted ? true : false; |
| 800 | 801 |
| 801 // Lock the session to make configuration changes. | 802 // Lock the session to make configuration changes. |
| 802 [session lockForConfiguration]; | 803 [session lockForConfiguration]; |
| 803 NSError* error = nil; | 804 NSError* error = nil; |
| 804 if (![session beginWebRTCSession:&error]) { | 805 if (![session beginWebRTCSession:&error]) { |
| 805 [session unlockForConfiguration]; | 806 [session unlockForConfiguration]; |
| 806 RTCLogError(@"Failed to begin WebRTC session: %@", | 807 RTCLogError(@"Failed to begin WebRTC session: %@", |
| 807 error.localizedDescription); | 808 error.localizedDescription); |
| 808 return false; | 809 return false; |
| 809 } | 810 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 836 | 837 |
| 837 // All I/O should be stopped or paused prior to deactivating the audio | 838 // All I/O should be stopped or paused prior to deactivating the audio |
| 838 // session, hence we deactivate as last action. | 839 // session, hence we deactivate as last action. |
| 839 [session lockForConfiguration]; | 840 [session lockForConfiguration]; |
| 840 UnconfigureAudioSession(); | 841 UnconfigureAudioSession(); |
| 841 [session endWebRTCSession:nil]; | 842 [session endWebRTCSession:nil]; |
| 842 [session unlockForConfiguration]; | 843 [session unlockForConfiguration]; |
| 843 } | 844 } |
| 844 | 845 |
| 845 } // namespace webrtc | 846 } // namespace webrtc |
| OLD | NEW |