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

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

Issue 1822543002: Support delayed AudioUnit initialization. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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+Private.h
diff --git a/webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h b/webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h
index 43af7c86e2fa202bbf2a6e20d6fc47673e1102d4..c6738e7a033ccd9856e67c01a941ce20ff157863 100644
--- a/webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h
+++ b/webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h
@@ -14,12 +14,25 @@
NS_ASSUME_NONNULL_BEGIN
+@class RTCAudioSessionConfiguration;
+
@interface RTCAudioSession ()
/** Number of times setActive:YES has succeeded without a balanced call to
* setActive:NO.
*/
-@property(nonatomic, readonly) NSInteger activationCount;
+@property(nonatomic, readonly) int activationCount;
+
+/** The number of times |beginWebRTCSession| was called without a balanced call
+ * to |endWebRTCSession|.
+ */
+@property(nonatomic, readonly) int webRTCSessionCount;
+
+/** The configuration of the audio session before configureWebRTCSession
+ * was first called.
+ */
+@property(nonatomic, strong, nullable)
+ RTCAudioSessionConfiguration *savedConfiguration;
- (BOOL)checkLock:(NSError **)outError;
@@ -29,9 +42,26 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)pushDelegate:(id<RTCAudioSessionDelegate>)delegate;
+/** Signals RTCAudioSession that a WebRTC session is about to begin and
+ * audio configuration is needed. Will configure the audio session for WebRTC
+ * if not already configured and if configuration is not delayed.
+ * Successful calls must be balanced by a call to endWebRTCSession.
+ */
+- (BOOL)beginWebRTCSession:(NSError **)outError;
+
+/** Signals RTCAudioSession that a WebRTC session is about to end and audio
+ * unconfiguration is needed. Will unconfigure the audio session for WebRTC
+ * if this is the last unmatched call and if configuration is not delayed.
+ */
+- (BOOL)endWebRTCSession:(NSError **)outError;
+
+/** Returns a configuration error with the given description. */
+- (NSError *)configurationErrorWithDescription:(NSString *)description;
+
// Properties and methods for tests.
@property(nonatomic, readonly)
std::vector<__weak id<RTCAudioSessionDelegate> > delegates;
+
- (void)notifyDidBeginInterruption;
- (void)notifyDidEndInterruptionWithShouldResumeSession:
(BOOL)shouldResumeSession;
@@ -39,6 +69,10 @@ NS_ASSUME_NONNULL_BEGIN
previousRoute:(AVAudioSessionRouteDescription *)previousRoute;
- (void)notifyMediaServicesWereLost;
- (void)notifyMediaServicesWereReset;
+- (void)notifyShouldConfigure;
+- (void)notifyShouldUnconfigure;
+- (void)notifyDidConfigure;
+- (void)notifyDidUnconfigure;
@end

Powered by Google App Engine
This is Rietveld 408576698