gpt4 book ai didi

ios - AVCaptureDevice 的 isLowLightBoostSupported 在 5S iOS 7.1 上始终返回 false(用于自动启用 LowLightBoost WhenAvailable)

转载 作者:可可西里 更新时间:2023-11-01 05:54:21 24 4
gpt4 key购买 nike

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

问题:除了锁定配置之外,是否需要执行任何操作才能启用弱光增强 API?是否有任何已知原因导致 isL​​owLightBoostSupported 在完全更新的现代系统上始终返回 false(对于所有设备)?

我正在 iOS 7.1 的 5S 上进行测试。

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

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];
+ }
+ }
});
}

我输入了 that code in the context of AVCam online at github为了进一步明确。

我已经浏览了文档,所以试图找到答案。以下是一些对我当前代码有用的东西:

我还尝试将 AVCaptureSession 实例的 sessionPreset 设置为所有 AVCaptureSessionPresetHigh、AVCaptureSessionPresetPhoto 和 AVCaptureSessionPresetLow,但对 isLowLightBoostSupported 的状态没有明显影响。

感谢您阅读本文 - 并感谢您提供的任何帮助! :)

最佳答案

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

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

我会发布一个兼容设备列表,但我没有较新的 iPod Touch 和一些 iPad 无法对其进行测试。我猜 iPhone 5c 确实支持它,因为该设备基本上是经过重新设计的 iPhone 5,但同样我没有可以测试的设备。

关于ios - AVCaptureDevice 的 isLowLightBoostSupported 在 5S iOS 7.1 上始终返回 false(用于自动启用 LowLightBoost WhenAvailable),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22487518/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com