webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
#import <RTCAudioSession.h>
Class Methods | |
(instancetype) | + sharedInstance |
(instancetype) | + sharedInstance |
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.
RTCAudioSession also coordinates activation so that the audio session is activated only once. See |setActive:error:|.
Adds a delegate, which is held weakly.
|
implementation |
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.
|
implementation |
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.
|
implementation |
|
implementation |
|
implementation |
Returns a configuration error with the given description.
|
implementation |
Returns a configuration error with the given description.
|
implementation |
Configure the audio session for WebRTC. This call will fail if the session is already configured. On other failures, we will attempt to restore the previously used audio session configuration. |lockForConfiguration| must be called first. Successful calls to configureWebRTCSession must be matched by calls to |unconfigureWebRTCSession|.
|
implementation |
Configure the audio session for WebRTC. This call will fail if the session is already configured. On other failures, we will attempt to restore the previously used audio session configuration. |lockForConfiguration| must be called first. Successful calls to configureWebRTCSession must be matched by calls to |unconfigureWebRTCSession|.
|
implementation |
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.
|
implementation |
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.
- (void) lockForConfiguration |
Request exclusive access to the audio session for configuration. This call will block if the lock is held by another object.
- (void) lockForConfiguration |
Request exclusive access to the audio session for configuration. This call will block if the lock is held by another object.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
- (instancetype) NS_UNAVAILABLE |
- (instancetype) NS_UNAVAILABLE |
- (BOOL) overrideOutputAudioPort: | (AVAudioSessionPortOverride) | portOverride | |
error: | (NSError **) | outError | |
- (BOOL) overrideOutputAudioPort: | (AVAudioSessionPortOverride) | portOverride | |
error: | (NSError **) | outError | |
Adds the delegate to the list of delegates, and places it at the front of the list. This delegate will be notified before other delegates of audio events.
Adds the delegate to the list of delegates, and places it at the front of the list. This delegate will be notified before other delegates of audio events.
If |active|, activates the audio session if it isn't already active. Successful calls must be balanced with a setActive:NO when activation is no longer required. If not |active|, deactivates the audio session if one is active and this is the last balanced call. When deactivating, the AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation option is passed to AVAudioSession.
If |active|, activates the audio session if it isn't already active. Successful calls must be balanced with a setActive:NO when activation is no longer required. If not |active|, deactivates the audio session if one is active and this is the last balanced call. When deactivating, the AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation option is passed to AVAudioSession.
- (BOOL) setCategory: | (NSString *) | category | |
withOptions: | (AVAudioSessionCategoryOptions) | options | |
error: | (NSError **) | outError | |
- (BOOL) setCategory: | (NSString *) | category | |
withOptions: | (AVAudioSessionCategoryOptions) | options | |
error: | (NSError **) | outError | |
- (BOOL) setConfiguration: | (RTCAudioSessionConfiguration *) | configuration | |
active: | (BOOL) | active | |
error: | (NSError **) | outError | |
Convenience method that calls both setConfiguration and setActive. |lockForConfiguration| must be called first.
Provided by category RTCAudioSession(Configuration).
- (BOOL) setConfiguration: | (RTCAudioSessionConfiguration *) | configuration | |
active: | (BOOL) | active | |
error: | (NSError **) | outError | |
Convenience method that calls both setConfiguration and setActive. |lockForConfiguration| must be called first.
Provided by category RTCAudioSession(Configuration).
- (BOOL) setConfiguration: | (RTCAudioSessionConfiguration *) | configuration | |
error: | (NSError **) | outError | |
Applies the configuration to the current session. Attempts to set all properties even if previous ones fail. Only the last error will be returned. |lockForConfiguration| must be called first.
Provided by category RTCAudioSession(Configuration).
- (BOOL) setConfiguration: | (RTCAudioSessionConfiguration *) | configuration | |
error: | (NSError **) | outError | |
Applies the configuration to the current session. Attempts to set all properties even if previous ones fail. Only the last error will be returned. |lockForConfiguration| must be called first.
Provided by category RTCAudioSession(Configuration).
- (BOOL) setInputDataSource: | (AVAudioSessionDataSourceDescription *) | dataSource | |
error: | (NSError **) | outError | |
- (BOOL) setInputDataSource: | (AVAudioSessionDataSourceDescription *) | dataSource | |
error: | (NSError **) | outError | |
- (BOOL) setInputGain: | (float) | gain | |
error: | (NSError **) | outError | |
- (BOOL) setInputGain: | (float) | gain | |
error: | (NSError **) | outError | |
- (BOOL) setOutputDataSource: | (AVAudioSessionDataSourceDescription *) | dataSource | |
error: | (NSError **) | outError | |
- (BOOL) setOutputDataSource: | (AVAudioSessionDataSourceDescription *) | dataSource | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredInput: | (AVAudioSessionPortDescription *) | inPort | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredInput: | (AVAudioSessionPortDescription *) | inPort | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredInputNumberOfChannels: | (NSInteger) | count | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredInputNumberOfChannels: | (NSInteger) | count | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredIOBufferDuration: | (NSTimeInterval) | duration | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredIOBufferDuration: | (NSTimeInterval) | duration | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredOutputNumberOfChannels: | (NSInteger) | count | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredOutputNumberOfChannels: | (NSInteger) | count | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredSampleRate: | (double) | sampleRate | |
error: | (NSError **) | outError | |
- (BOOL) setPreferredSampleRate: | (double) | sampleRate | |
error: | (NSError **) | outError | |
+ (instancetype) sharedInstance |
Default constructor.
+ (instancetype) sharedInstance |
Default constructor.
|
implementation |
Unconfigures the session for WebRTC. This will attempt to restore the audio session to the settings used before |configureWebRTCSession| was called. |lockForConfiguration| must be called first.
|
implementation |
Unconfigures the session for WebRTC. This will attempt to restore the audio session to the settings used before |configureWebRTCSession| was called. |lockForConfiguration| must be called first.
- (void) unlockForConfiguration |
Relinquishes exclusive access to the audio session.
- (void) unlockForConfiguration |
Relinquishes exclusive access to the audio session.
|
readnonatomicassignimplementation |
Number of times setActive:YES has succeeded without a balanced call to setActive:NO.
|
readatomicassignimplementation |
Convenience BOOL that checks useManualAudio and isAudioEnebled.
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readnonatomicassignimplementation |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readnonatomicassign |
Our best guess at whether the session is active based on results of calls to AVAudioSession.
|
readwritenonatomicassign |
This property is only effective if useManualAudio is YES. Represents permission for WebRTC to initialize the VoIP audio unit. When set to NO, if the VoIP audio unit used by WebRTC is active, it will be stopped and uninitialized. This will stop incoming and outgoing audio. When set to YES, WebRTC will initialize and start the audio unit when it is needed (e.g. due to establishing an audio connection). This property was introduced to work around an issue where if an AVPlayer is playing audio while the VoIP audio unit is initialized, its audio would be either cut off completely or played at a reduced volume. By preventing the audio unit from being initialized until after the audio has completed, we are able to prevent the abrupt cutoff.
|
readwritenonatomicassignimplementation |
Tracks whether we have been sent an interruption event that hasn't been matched by either an interrupted end event or a foreground event.
|
readnonatomicassign |
Whether RTCAudioSession is currently locked for configuration.
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readatomicassign |
|
readnonatomicassign |
Convenience property to access the AVAudioSession singleton. Callers should not call setters on AVAudioSession directly, but other method invocations are fine.
|
readwritenonatomicassign |
If YES, WebRTC will not initialize the audio unit automatically when an audio track is ready for playout or recording. Instead, applications should call setIsAudioEnabled. If NO, WebRTC will initialize the audio unit as soon as an audio track is ready for playout or recording.
|
readnonatomicassignimplementation |
The number of times |beginWebRTCSession| was called without a balanced call to |endWebRTCSession|.