8000 fix: Fix crashes for FlutterRPScreenRecorder stop. · fotiDim/flutter-webrtc@cde014d · GitHub
[go: up one dir, main page]

Skip to content

Commit cde014d

Browse files
committed
fix: Fix crashes for FlutterRPScreenRecorder stop.
1 parent 9b928ce commit cde014d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

common/darwin/Classes/FlutterRPScreenRecorder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
-(void)startCapture;
66

7+
// Stops the capture session asynchronously and notifies callback on completion.
8+
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler;
9+
710
-(void)stopCapture;
811

912
@end

common/darwin/Classes/FlutterRPScreenRecorder.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ -(void)stopCapture
5454
}
5555
}
5656

57+
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler
58+
{
59+
[self stopCapture];
60+
if(completionHandler != nil) {
61+
completionHandler();
62+
}
63+
}
64+
5765
-(void)handleSourceBuffer:(CMSampleBufferRef)sampleBuffer sampleType:(RPSampleBufferType)sampleType
5866
{
5967
if (CMSampleBufferGetNumSamples(sampleBuffer) != 1 || !CMSampleBufferIsValid(sampleBuffer) ||

0 commit comments

Comments
 (0)
0