Notify delegates about audio glitches in real time

Bug: webrtc:7819
Change-Id: I72ec77d216ce386dd45aef68eeac833b3a75b670
Reviewed-on: https://chromium-review.googlesource.com/543239
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Henrik Andreasson <henrika@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18778}
This commit is contained in:
Anders Carlsson
2017-06-26 15:34:47 +02:00
committed by Commit Bot
parent 93ad1f7f1b
commit 121ea329ba
5 changed files with 34 additions and 1 deletions

View File

@ -90,6 +90,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)notifyDidChangeCanPlayOrRecord:(BOOL)canPlayOrRecord;
- (void)notifyDidStartPlayOrRecord;
- (void)notifyDidStopPlayOrRecord;
- (void)notifyDidDetectPlayoutGlitch:(int64_t)totalNumberOfGlitches;
@end

View File

@ -914,4 +914,13 @@ NSString * const kRTCAudioSessionOutputVolumeSelector = @"outputVolume";
}
}
- (void)notifyDidDetectPlayoutGlitch:(int64_t)totalNumberOfGlitches {
for (auto delegate : self.delegates) {
SEL sel = @selector(audioSession:didDetectPlayoutGlitch:);
if ([delegate respondsToSelector:sel]) {
[delegate audioSession:self didDetectPlayoutGlitch:totalNumberOfGlitches];
}
}
}
@end

View File

@ -78,6 +78,12 @@ RTC_EXPORT
- (void)audioSession:(RTCAudioSession *)audioSession
didChangeOutputVolume:(float)outputVolume;
/** Called when the audio device detects a playout glitch. The argument is the
* number of glitches detected so far in the current audio playout session.
*/
- (void)audioSession:(RTCAudioSession *)audioSession
didDetectPlayoutGlitch:(int64_t)totalNumberOfGlitches;
@end
/** This is a protocol used to inform RTCAudioSession when the audio session