Focus improvements #186

parent 6e3718c2
......@@ -473,6 +473,17 @@ parentViewController:(UIViewController*)parentViewController
}
// set focus params if available to improve focusing
[device lockForConfiguration:&error];
if (error == nil) {
if([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus]) {
[device setFocusMode:AVCaptureFocusModeContinuousAutoFocus];
}
if([device isAutoFocusRangeRestrictionSupported]) {
[device setAutoFocusRangeRestriction:AVCaptureAutoFocusRangeRestrictionNear];
}
}
[device unlockForConfiguration];
AVCaptureDeviceInput* input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
if (!input) return @"unable to obtain video capture device input";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment