CameraDeviceSetupCompat


interface CameraDeviceSetupCompat


Interface for checking if a SessionConfiguration is supported by the device.

This interface is a compatible version of the CameraDevice.CameraDeviceSetup class.

Implementations of this interface must be able to check if a SessionConfiguration is supported. They will check both the output streams and the session parameters, then return whether the combination works for the given camera. For example, a camera device may support HDR and 60FPS frame rate, but not both at the same time.

Summary

Nested types

Result of a isSessionConfigurationSupported query.

Public functions

isSessionConfigurationSupported

Added in 1.4.0
fun isSessionConfigurationSupported(sessionConfig: SessionConfiguration): CameraDeviceSetupCompat.SupportQueryResult

Checks if the SessionConfiguration is supported.

Parameters
sessionConfig: SessionConfiguration

The SessionConfiguration to check.

Throws
android.hardware.camera2.CameraAccessException

if the camera device is no longer connected or has encountered a fatal error.

isSessionConfigurationSupported

Added in 1.5.0-alpha06
fun isSessionConfigurationSupported(
    sessionConfig: SessionConfigurationCompat
): CameraDeviceSetupCompat.SupportQueryResult

Checks if the SessionConfigurationCompat is supported.

This method and the compat classes are provided to allow querying camera device capabilities without the need to call openCamera. It should only be used for devices that do not support CameraDevice.CameraDeviceSetup and will throw an IllegalStateException when used for a cameraId for which isCameraDeviceSetupSupported returns true.

Note that the condition above means that this method does not query camera2's isSessionConfigurationSupported, so the returned getSource will never be SOURCE_ANDROID_FRAMEWORK

Parameters
sessionConfig: SessionConfigurationCompat

The SessionConfigurationCompat to check.

Throws
java.lang.IllegalStateException

if the camera device supports android.hardware.camera2.CameraDevice.CameraDeviceSetup