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

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

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/objc/RTCAudioSession.h
diff --git a/webrtc/modules/audio_device/ios/objc/RTCAudioSession.h b/webrtc/modules/audio_device/ios/objc/RTCAudioSession.h
index 199fd17b285684d8b4e8cb5ed732249d32f7e2fb..155929cfc7d6fd1735cdb364b3cd8fe9710c36bb 100644
--- a/webrtc/modules/audio_device/ios/objc/RTCAudioSession.h
+++ b/webrtc/modules/audio_device/ios/objc/RTCAudioSession.h
@@ -76,6 +76,21 @@ RTC_EXPORT
@end
+/** This is a protocol used to inform RTCAudioSession when the audio session
+ * activation state has changed outside of RTCAudioSession. The current known use
+ * case of this is when CallKit activates the audio session for the application
+ */
+RTC_EXPORT
+@protocol RTCAudioSessionActivationDelegate <NSObject>
+
+/** Called when the audio session is activated outside of the app by iOS. */
+- (void)audioSessionDidActivate:(AVAudioSession *)session;
+
+/** Called when the audio session is deactivated outside of the app by iOS. */
+- (void)audioSessionDidDeactivate:(AVAudioSession *)session;
+
+@end
+
/** Proxy class for AVAudioSession that adds a locking mechanism similar to
* AVCaptureDevice. This is used to that interleaving configurations between
* WebRTC and the application layer are avoided.
@@ -84,7 +99,7 @@ RTC_EXPORT
* activated only once. See |setActive:error:|.
*/
RTC_EXPORT
-@interface RTCAudioSession : NSObject
+@interface RTCAudioSession : NSObject <RTCAudioSessionActivationDelegate>
/** Convenience property to access the AVAudioSession singleton. Callers should
* not call setters on AVAudioSession directly, but other method invocations
@@ -199,7 +214,6 @@ RTC_EXPORT
error:(NSError **)outError;
- (BOOL)setOutputDataSource:(AVAudioSessionDataSourceDescription *)dataSource
error:(NSError **)outError;
-
@end
@interface RTCAudioSession (Configuration)
« no previous file with comments | « no previous file | webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698