相机 2 手动检查是否支持 ISO 和 SHUTTER_SPEED [英] Camera 2 manually checking if ISO and SHUTTER_SPEED are supported

查看:36
本文介绍了相机 2 手动检查是否支持 ISO 和 SHUTTER_SPEED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图检查是否支持不同镜头的shutter_speed和iso,但我不知道如何,一开始我以为我是这样正确检查的:

I was trying to check if the shutter_speed and iso for different lenses are supported but I don't know how, at the beginning I thought I was checking for that correctly like this:

val capabilities = characteristics.get(REQUEST_AVAILABLE_CAPABILITIES)!!
val canReadSensorSettings = capabilities.contains(
            REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS)
val hasManualSensor = capabilities.contains(
            REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)

然后正在检查 if(canReadSensorSettings && hasManualSensor)//然后可以为此镜头启用手动曝光.

then was checking for if(canReadSensorSettings && hasManualSensor) //then manual exposure can be enabled for this lens.

我认为它有效然后发现在某些前置镜头上这两个值都是错误的但我仍然可以更改 ISO 和 Shutter_Speed

I thought it was working then figured out that on some front lenses both of those values are false but I still can change the ISO and Shutter_Speed

我再次提出问题,检查相机设备的 ISO 和 SHTTER_SPEED 支持的正确方法是什么.

My question again what is the correct way to check for ISO and SHTTER_SPEED support for a camera device.

顺便说一句,我已经看到了这个,但无法从中获取,可能解决方案在此链接中,但我无法获取:https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#REQUEST_AVAILABLE_CAPABILITIES

btw, I have seen this and can't get it from it, probably the solution is in this link but I can't get it: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#REQUEST_AVAILABLE_CAPABILITIES

推荐答案

有些设备可能允许更改曝光/ISO 值,即使它们没有列出 MANUAL_SENSOR 功能(请注意,列出 MANUAL_SENSOR 意味着 READ_SENSOR_SETTINGS 也将始终是那里,所以你可以检查MANUAL_SENSOR).

It's possible some devices allow changing of exposure/ISO values even if they don't list MANUAL_SENSOR capability (note that MANUAL_SENSOR being listed means that READ_SENSOR_SETTINGS will always also be there, so you can just check for MANUAL_SENSOR).

这意味着它们在某种程度上不满足 MANUAL_SENSOR 的所有要求,因此可能有一些控件不起作用,或者与 API 要求的工作方式不同.

That would mean they don't meet all the requirements for MANUAL_SENSOR, in some way, so there may be some controls that don't work, or work differently than the API requires.

因此,为了可靠性,如果未列出 MANUAL_SENSOR 功能,我不会尝试使用手动设置,除非您要自己测试每个设备以确保一切正常.坚持使用列出 MANUAL_SENSOR 的设备意味着它们经过合规性测试,可以通过手动控制按预期工作.

So for reliability, I would not try to use manual settings if MANUAL_SENSOR capability isn't listed, unless you're going to test each device yourself to make sure things actually work. Sticking to devices that list MANUAL_SENSOR means they are compliance tested to work as expected with manual controls.

这篇关于相机 2 手动检查是否支持 ISO 和 SHUTTER_SPEED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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