Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
pass error to delegate when vision capture fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Rudolfsky committed Aug 13, 2018
1 parent 4ec9849 commit d06d440
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/PBJVision.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static CGFloat const PBJVideoBitRate1280x750 = 5000000 * 8; // 40bmps
- (void)visionWillStartWritingVideo:(PBJVision *)vision fileURL:(NSURL *)fileURL;
- (void)visionWillEndVideoCapture:(PBJVision *)vision; // called before capturedVideo delegate method
- (void)vision:(PBJVision *)vision capturedVideo:(NSDictionary *)videoDict error:(NSError *)error;
- (void)visionCaptureDidFail:(PBJVision *)vision;
- (void)visionCaptureDidFail:(PBJVision *)vision error:(NSError *)error;


// video capture progress
Expand Down
8 changes: 4 additions & 4 deletions Source/PBJVision.m
Original file line number Diff line number Diff line change
Expand Up @@ -2610,8 +2610,8 @@ - (void)mediaWriterDidObserveVideoAuthorizationStatusDenied:(PBJMediaWriter *)me
- (void)mediaWriterDidObserveAssetWriterFailed:(PBJMediaWriter *)mediaWriter withError:(NSError *)error
{
[self _executeBlockOnMainQueue:^{
if ([_delegate respondsToSelector:@selector(visionCaptureDidFail:)]) {
[_delegate visionCaptureDidFail:self];
if ([_delegate respondsToSelector:@selector(visionCaptureDidFail:error:)]) {
[_delegate visionCaptureDidFail:self error:error];
}
}];

Expand Down Expand Up @@ -2773,8 +2773,8 @@ - (void)_writeVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer
_totalISO = 0;
if(![_mediaWriter startWritingAtTime:time]) {
[self _executeBlockOnMainQueue:^{
if ([_delegate respondsToSelector:@selector(visionCaptureDidFail:)]) {
[_delegate visionCaptureDidFail:self];
if ([_delegate respondsToSelector:@selector(visionCaptureDidFail:error:)]) {
[_delegate visionCaptureDidFail:self error:_mediaWriter.error];
}
}];
return;
Expand Down

0 comments on commit d06d440

Please sign in to comment.