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..32f7e356ab53420224784b0e8b580a7c9866b71c 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; |
+ |
tkchin_webrtc
2016/08/24 00:42:20
nit: remove extra line
peah-webrtc
2016/08/25 09:25:08
Done.
|
- (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 { |
tkchin_webrtc
2016/08/24 00:42:20
nit: align :
peah-webrtc
2016/08/25 09:25:08
Done.
|
NSParameterAssert(roomId.length); |
NSParameterAssert(_state == kARDAppClientStateDisconnected); |
_isLoopback = isLoopback; |
_isAudioOnly = isAudioOnly; |
+ _shouldMakeAecDump = shouldMakeAecDump; |
self.state = kARDAppClientStateConnecting; |
#if defined(WEBRTC_IOS) |
@@ -309,6 +313,9 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB. |
_hasReceivedSdp = NO; |
_messageQueue = [NSMutableArray array]; |
#if defined(WEBRTC_IOS) |
+ if (_shouldMakeAecDump) { |
tkchin_webrtc
2016/08/24 00:42:20
is this conditional useful? Could be that it faile
peah-webrtc
2016/08/25 09:25:08
The StopAecDump method does an internal check to s
|
+ [_factory stopAecDump]; |
+ } |
[_peerConnection stopRtcEventLog]; |
#endif |
_peerConnection = nil; |
@@ -562,6 +569,20 @@ static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB. |
RTCLogError(@"Failed to start event logging."); |
} |
} |
+ |
+ // Start aecdump diagnostic recording. |
+ if (_shouldMakeAecDump) { |
+ 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!"); |
+ } |
tkchin_webrtc
2016/08/24 00:42:20
nit: else on same line as }
peah-webrtc
2016/08/25 09:25:08
Done.
|
+ else { |
+ if (![_factory startAecDump:fd fileSizeLimitBytes:-1]) { |
tkchin_webrtc
2016/08/24 00:42:20
nit: remove extra space after fd
peah-webrtc
2016/08/25 09:25:08
Done.
|
+ RTCLogError(@"Failed to create aecdump."); |
+ } |
+ } |
+ } |
#endif |
} |