AVCaptureDevice的isLowLightBoostSupported总是在5S iOS7.1上返回false(对于automaticEnablesLowLightBoostWhenAvailable) [英] AVCaptureDevice's isLowLightBoostSupported always returns false on 5S iOS7.1 (for automaticallyEnablesLowLightBoostWhenAvailable)

查看:173
本文介绍了AVCaptureDevice的isLowLightBoostSupported总是在5S iOS7.1上返回false(对于automaticEnablesLowLightBoostWhenAvailable)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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?

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

I'm testing on a 5S with iOS 7.1.

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

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

我把在github上的AVCam在线环境中的代码,以进一步明确。

我'通过文档和SO搜索,试图找到答案。以下是一些教育我当前代码的事情:

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

我还尝试将AVCaptureSession实例的sessionPreset设置为所有AVCaptureSessionPresetHigh,AVCaptureSessionPresetPhoto和AVCaptureSessionPresetLow,没有ob isLowLightBoostSupported状态的可服务效果。

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! :)

推荐答案

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

From what I understand the 5S does not support low light boost mode. I don't have any insight into Apple's decision on this, but I'm guessing the improvements made to the camera/sensor on the 5S were good enough that they felt low light boost was not needed on that device.

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

So, what you're seeing is not an error. It's simply that some devices support that feature (the iPhone 5), and some do not (the iPhone 5S).

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

I'd post a list of compatible devices, but I don't have newer iPod Touches and some iPads to be able to test it. I'd guess the iPhone 5c does support it since that device is basically a reskinned iPhone 5, but again I don't have one to test.

这篇关于AVCaptureDevice的isLowLightBoostSupported总是在5S iOS7.1上返回false(对于automaticEnablesLowLightBoostWhenAvailable)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆