Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm

Issue 2813493004: Added audioSessionDidActivate and audioSessionDidDectivate (Closed)
Patch Set: remove code not for this cl Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 return; 780 return;
781 } 781 }
782 _canPlayOrRecord = canPlayOrRecord; 782 _canPlayOrRecord = canPlayOrRecord;
783 shouldNotify = YES; 783 shouldNotify = YES;
784 } 784 }
785 if (shouldNotify) { 785 if (shouldNotify) {
786 [self notifyDidChangeCanPlayOrRecord:canPlayOrRecord]; 786 [self notifyDidChangeCanPlayOrRecord:canPlayOrRecord];
787 } 787 }
788 } 788 }
789 789
790 - (void)audioSessionDidActivate:(AVAudioSession *)session {
791 if (_session != session) {
792 RTCLogError(@"audioSessionDidActivate called on different AVAudioSession");
793 }
794 [self incrementActivationCount];
795 self.isActive = YES;
796 }
797
798 - (void)audioSessionDidDeactivate:(AVAudioSession *)session {
799 if (_session != session) {
800 RTCLogError(@"audioSessionDidDeactivate called on different AVAudioSession") ;
801 }
802 self.isActive = NO;
803 [self decrementActivationCount];
804 }
805
790 - (void)notifyDidBeginInterruption { 806 - (void)notifyDidBeginInterruption {
791 for (auto delegate : self.delegates) { 807 for (auto delegate : self.delegates) {
792 SEL sel = @selector(audioSessionDidBeginInterruption:); 808 SEL sel = @selector(audioSessionDidBeginInterruption:);
793 if ([delegate respondsToSelector:sel]) { 809 if ([delegate respondsToSelector:sel]) {
794 [delegate audioSessionDidBeginInterruption:self]; 810 [delegate audioSessionDidBeginInterruption:self];
795 } 811 }
796 } 812 }
797 } 813 }
798 814
799 - (void)notifyDidEndInterruptionWithShouldResumeSession: 815 - (void)notifyDidEndInterruptionWithShouldResumeSession:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 - (void)notifyDidStopPlayOrRecord { 874 - (void)notifyDidStopPlayOrRecord {
859 for (auto delegate : self.delegates) { 875 for (auto delegate : self.delegates) {
860 SEL sel = @selector(audioSessionDidStopPlayOrRecord:); 876 SEL sel = @selector(audioSessionDidStopPlayOrRecord:);
861 if ([delegate respondsToSelector:sel]) { 877 if ([delegate respondsToSelector:sel]) {
862 [delegate audioSessionDidStopPlayOrRecord:self]; 878 [delegate audioSessionDidStopPlayOrRecord:self];
863 } 879 }
864 } 880 }
865 } 881 }
866 882
867 @end 883 @end
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/ios/objc/RTCAudioSession.h ('k') | webrtc/modules/audio_device/ios/objc/RTCAudioSessionTest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698