I'm attempting to enable AVCaptureDevice's automaticallyEnablesLowLightBoostWhenAvailable in an iOS camera app, but I've been utterly unable to make AVCaptureDevice's isLowLightBoostSupported return true.
Question: Is there anything that needs to be done to enable the low light boost api beyond locking for configuration? Is there any known reason that isLowLightBoostSupported would always return false (for all devices) on a fully updated, modern, system?
I'm testing on a 5S with iOS 7.1.
For the sake of simplicity in this question, I've ported the changes into Apple's AVCam test app. The diff in AVCam is as such:
diff --git a/AVCam/AVCam/AVCamViewController.m b/AVCam/AVCam/AVCamViewController.m
index 84a2c77..4e15fc4 100644
--- a/AVCam/AVCam/AVCamViewController.m
+++ b/AVCam/AVCam/AVCamViewController.m
@@ -175,6 +175,18 @@ static void * SessionRunningAndDeviceAuthorizedContext = &SessionRunningAndDevic
[session addOutput:stillImageOutput];
[self setStillImageOutput:stillImageOutput];
}
+
+ if ([videoDevice respondsToSelector:@selector(isLowLightBoostSupported)]) {
+ if ([videoDevice lockForConfiguration:nil]) {
+ if (videoDevice.isLowLightBoostSupported) {
+ videoDevice.automaticallyEnablesLowLightBoostWhenAvailable = YES;
+ NSLog(@"was supported");
+ } else {
+ NSLog(@"was not supported");
+ }
+ [videoDevice unlockForConfiguration];
+ }
+ }
});
}
I've put that code in the context of AVCam online at github for further clarity.
I've trawled through the docs and SO to try to find an answer. Here are some things that have educated my current code:
- iPhone 5's low light boost mode
- AVCaptureDevice Low Light Boost Does Not work
- https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html#//apple_ref/occ/instp/AVCaptureDevice/lowLightBoostSupported
I've also attempted to set the AVCaptureSession instance's sessionPreset to all of AVCaptureSessionPresetHigh, AVCaptureSessionPresetPhoto, and AVCaptureSessionPresetLow with no observable effect on the the state of isLowLightBoostSupported.
Thanks for reading through this - and for any help you can give! :)