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

Unified Diff: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m

Issue 2253013006: Adding AecDump functionality to AppRTCDemo for iOS (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changes in response to reviewer comments Created 4 years, 4 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/examples/objc/AppRTCDemo/ARDAppClient.m
diff --git a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
index 43eb6f4ad2fff30c4534ec9bea438b015c6d890e..a9dd8b15fbcd377e4099f7e53c6db92e0d81d119 100644
--- a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
+++ b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
@@ -129,6 +129,8 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
_defaultPeerConnectionConstraints;
@synthesize isLoopback = _isLoopback;
@synthesize isAudioOnly = _isAudioOnly;
+@synthesize shouldMakeAecDump = _shouldMakeAecDump;
+@synthesize isAecDumpActive = _isAecDumpActive;
- (instancetype)init {
if (self = [super init]) {
@@ -220,11 +222,13 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
- (void)connectToRoomWithId:(NSString *)roomId
isLoopback:(BOOL)isLoopback
- isAudioOnly:(BOOL)isAudioOnly {
+ isAudioOnly:(BOOL)isAudioOnly
+ shouldMakeAecDump:(BOOL)shouldMakeAecDump {
NSParameterAssert(roomId.length);
NSParameterAssert(_state == kARDAppClientStateDisconnected);
_isLoopback = isLoopback;
_isAudioOnly = isAudioOnly;
+ _shouldMakeAecDump = shouldMakeAecDump;
self.state = kARDAppClientStateConnecting;
#if defined(WEBRTC_IOS)
@@ -309,6 +313,10 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
_hasReceivedSdp = NO;
_messageQueue = [NSMutableArray array];
#if defined(WEBRTC_IOS)
+ if (_isAecDumpActive) {
+ [_factory stopAecDump];
+ _isAecDumpActive = NO;
+ }
[_peerConnection stopRtcEventLog];
#endif
_peerConnection = nil;
@@ -562,6 +570,22 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
RTCLogError(@"Failed to start event logging.");
}
}
+
+ // Start aecdump diagnostic recording.
+ if (_shouldMakeAecDump) {
+ _isAecDumpActive = YES;
+ NSString *filePath = [self documentsFilePathForFileName:@"audio.aecdump"];
+ int fd = open(filePath.UTF8String, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ RTCLogError(@"Failed to create the aecdump file!");
+ _isAecDumpActive = NO;
+ } else {
+ if (![_factory startAecDumpWithFileDescriptor:fd maxFileSizeInBytes:-1]) {
+ RTCLogError(@"Failed to create aecdump.");
+ _isAecDumpActive = NO;
+ }
+ }
+ }
#endif
}
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/ARDAppClient.h ('k') | webrtc/examples/objc/AppRTCDemo/ARDAppClient+Internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698