简体   繁体   English

相机 2 手动检查是否支持 ISO 和 SHUTTER_SPEED

[英]Camera 2 manually checking if ISO and SHUTTER_SPEED are supported

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:我试图检查是否支持不同镜头的shutter_speed和iso,但我不知道如何,一开始我以为我正在像这样正确检查:

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)

then was checking for if(canReadSensorSettings && hasManualSensor) //then manual exposure can be enabled for this lens.然后正在检查 if(canReadSensorSettings && hasManualSensor) //然后可以为此镜头启用手动曝光。

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 和 Shutter_Speed

My question again what is the correct way to check for ISO and SHTTER_SPEED support for a camera device.我再次提出问题,检查相机设备的 ISO 和 SHTTER_SPEED 支持的正确方法是什么。

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顺便说一句,我已经看到了这个并且无法从中获取它,可能解决方案在此链接中,但我无法获取: https : //developer.android.com/reference/android/hardware/camera2/CameraCharacteristics。 html#REQUEST_AVAILABLE_CAPABILITIES

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 功能,也可能允许更改曝光/ISO 值(请注意,列出 MANUAL_SENSOR 意味着 READ_SENSOR_SETTINGS 也将始终存在,因此您只需检查 MANUAL_SENSOR)。

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 的所有要求,因此可能有一些控件不起作用,或者与 API 要求的工作方式不同。

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.因此,为了可靠性,如果未列出 MANUAL_SENSOR 功能,我不会尝试使用手动设置,除非您要自己测试每个设备以确保一切正常。 Sticking to devices that list MANUAL_SENSOR means they are compliance tested to work as expected with manual controls.坚持使用列出 MANUAL_SENSOR 的设备意味着它们经过合规性测试,可以通过手动控制按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM