Disable Auto Focus on iPhone 3G S
2 answers
The following code should work for what you want:
NSArray *devices = [AVCaptureDevice devices];
NSError *error;
for (AVCaptureDevice *device in devices) {
if (([device hasMediaType:AVMediaTypeVideo]) &&
([device position] == AVCaptureDevicePositionBack) ) {
[device lockForConfiguration:&error];
if ([device isFocusModeSupported:AVCaptureFocusModeLocked]) {
device.focusMode = AVCaptureFocusModeLocked;
NSLog(@"Focus locked");
}
[device unlockForConfiguration];
}
}
Visible here !
+1
source to share
Generally, your application should not change this setting, if your users do not want to use autofocus, then they can disable it, but your application should not make a choice for them.
Is there a good reason why you need to control this? Does this interfere with your desired functionality in some way?
0
source to share