Mohammad Elsayed
Mohammad Elsayed

Reputation: 2066

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:

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.

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

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

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

Upvotes: 1

Views: 535

Answers (1)

Eddy Talvala
Eddy Talvala

Reputation: 18117

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).

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.

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.

Upvotes: 2

Related Questions