CameraDeviceSetupCompat


public 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 methods

isSessionConfigurationSupported

Added in 1.4.0
abstract @NonNull CameraDeviceSetupCompat.SupportQueryResult isSessionConfigurationSupported(
    @NonNull SessionConfiguration sessionConfig
)

Checks if the SessionConfiguration is supported.

Parameters
@NonNull SessionConfiguration sessionConfig

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
abstract @NonNull CameraDeviceSetupCompat.SupportQueryResult isSessionConfigurationSupported(
    @NonNull SessionConfigurationCompat sessionConfig
)

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
@NonNull SessionConfigurationCompat sessionConfig

The SessionConfigurationCompat to check.

Throws
java.lang.IllegalStateException

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