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

Unified Diff: webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm

Issue 2813493004: Added audioSessionDidActivate and audioSessionDidDectivate (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/external/webrtc into activeCount 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm
diff --git a/webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm b/webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm
index 4ce24e7c3fd56b7d2472d91b236862c26dd8b860..8ebd640305a0bfd5b21a86a29eef1dad95382d95 100644
--- a/webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm
+++ b/webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm
@@ -688,7 +688,7 @@ NSInteger const kRTCAudioSessionErrorConfiguration = -2;
if (![self setConfiguration:webRTCConfig active:YES error:&error]) {
RTCLogError(@"Failed to set WebRTC audio configuration: %@",
error.localizedDescription);
- [self unconfigureWebRTCSession:nil];
+ // Don't call unconfigureWebRTCSession if the audio session wasn't configured successfully
if (outError) {
*outError = error;
}
@@ -787,6 +787,22 @@ NSInteger const kRTCAudioSessionErrorConfiguration = -2;
}
}
+- (void)audioSessionDidActivate:(AVAudioSession *)session {
+ if (_session != session) {
+ RTCLogError(@"audioSessionDidActivate called on different AVAudioSession");
+ }
+ [self incrementActivationCount];
+ self.isActive = YES;
+}
+
+- (void)audioSessionDidDeactivate:(AVAudioSession *)session {
+ if (_session != session) {
+ RTCLogError(@"audioSessionDidDeactivate called on different AVAudioSession");
+ }
+ self.isActive = NO;
+ [self decrementActivationCount];
+}
+
- (void)notifyDidBeginInterruption {
for (auto delegate : self.delegates) {
SEL sel = @selector(audioSessionDidBeginInterruption:);

Powered by Google App Engine
This is Rietveld 408576698