Skip to content

Commit

Permalink
Merge pull request #8 from googlesamples/caren/merge_ios_improvements
Browse files Browse the repository at this point in the history
iOS Vision Quickstart: Performance inprovement for stream mode.
  • Loading branch information
calren authored Jun 8, 2020
2 parents 734af50 + cc22396 commit f0afc96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class CameraViewController: UIViewController {
output.videoSettings = [
(kCVPixelBufferPixelFormatTypeKey as String): kCVPixelFormatType_32BGRA,
]
output.alwaysDiscardsLateVideoFrames = true
let outputQueue = DispatchQueue(label: Constant.videoDataOutputQueueLabel)
output.setSampleBufferDelegate(self, queue: outputQueue)
guard self.captureSession.canAddOutput(output) else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ - (void)setUpCaptureSessionOutput {
(id)
kCVPixelBufferPixelFormatTypeKey : [NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA]
};
output.alwaysDiscardsLateVideoFrames = YES;
dispatch_queue_t outputQueue = dispatch_queue_create(videoDataOutputQueueLabel.UTF8String, nil);
[output setSampleBufferDelegate:self queue:outputQueue];
if ([self.captureSession canAddOutput:output]) {
Expand Down

0 comments on commit f0afc96

Please sign in to comment.