Index: webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm |
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm |
index 9c9fd75ac0908c815d3f40e0327a0c2229849e76..e6635cd5857149b8a2f39aa7a0ffd54963dfcd05 100644 |
--- a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm |
+++ b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm |
@@ -48,6 +48,25 @@ |
return self; |
} |
+ |
+- (BOOL) startAecDump:(NSString *)filename { |
+ int fd = open(filename.UTF8String, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); |
+ if (fd < 0) { |
+ NSAssert(_nativeFactory, @"Failed to create the aecdump file!"); |
tkchin_webrtc
2016/08/19 17:31:42
Why is there an assert on the factory here? Should
peah-webrtc
2016/08/23 11:45:15
That would definitely make sense. I moved this cod
|
+ return false; |
tkchin_webrtc
2016/08/19 17:31:42
BOOL is YES or NO.
return NO;
peah-webrtc
2016/08/23 11:45:15
Done.
|
+ } |
+ |
+ // Pass the file to the recorder. The file ownership |
+ // is passed to the recorder, and the recorder |
+ // closes the file when needed. |
+ return _nativeFactory->StartAecDump(fd, -1); |
+} |
+ |
+- (void)stopAecDump { |
+ // The file is closed by the call below. |
+ _nativeFactory->StopAecDump(); |
+} |
+ |
- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints: |
(nullable RTCMediaConstraints *)constraints { |
return [[RTCAVFoundationVideoSource alloc] initWithFactory:self |