I am creating an app that locks the camera focus for video recording purposes. I want to lock the focus to infinity without having the user manually adjust the focus. Is this possible? Thanks!
That is the way to disable focus, it locks it for all the time:
// Find a suitable capture device
AVCaptureDevice *cameraDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
// SETUP FOCUS MODE
if ([cameraDevice lockForConfiguration:nil]) {
[cameraDevice setFocusMode:AVCaptureFocusModeLocked];
[cameraDevice unlockForConfiguration];
}
else{
NSLog(@"error while configuring focusMode");
}
What do you mean "lock the focus to infinity"?