AVCaptureDevice的isLowLightBoostSupported总是在5S iOS7.1上返回false(对于automaticEnablesLowLightBoostWhenAvailable)

我试图在iOS相机应用程序中启用AVCaptureDevice的automaticEnablesLowLightBoostWhenAvailable,但我完全无法让AVCaptureDevice的isLowLightBoostSupported返回true。

问题:是否需要做任何事情才能使低光增强api超出锁定配置范围? 是否有任何已知的原因,isLowLightBoostSupported将在完全更新的现代系统上始终返回false(对于所有设备)?

我正在使用iOS 7.1测试5S。

为了简化这个问题,我已将更改移植到Apple的AVCam测试应用程序中。 AVCam中的差异是这样的:

diff --git a/AVCam/AVCam/AVCamViewController.mb/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]; + } + } }); } 

为了进一步说明,我已将该代码放在github的AVCam在线环境中 。

我已经浏览了文档和SO,试图找到答案。 以下是一些教育我当前代码的东西:

  • iPhone 5的低光增强模式
  • AVCaptureDevice低光增强不起作用
  • https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html#//apple_ref/occ/instp/AVCaptureDevice/lowLightBoostSupported

我还尝试将AVCaptureSession实例的sessionPreset设置为所有AVCaptureSessionPresetHigh,AVCaptureSessionPresetPhoto和AVCaptureSessionPresetLow,对isLowLightBoostSupported的状态没有可观察到的影响。

感谢您阅读本文 – 并提供任何帮助! 🙂

据我所知,5S不支持低光增强模式。 我对Apple对此的决定没有任何了解,但我猜测5S上相机/传感器的改进足够好,以至于他们觉得该设备上不需要低光增强。

所以,你所看到的不是错误。 只是有些设备支持该function(iPhone 5),有些则不支持(iPhone 5S)。

我发布了兼容设备列表,但我没有更新的iPod Touch和一些iPad可以测试它。 我猜iPhone 5c确实支持它,因为该设备基本上是一个重新assembly的iPhone 5,但我再没有一个可以测试。