Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

Camera2CameraInfo

class Camera2CameraInfo
kotlin.Any
   ↳ androidx.camera.camera2.interop.Camera2CameraInfo

An interface for retrieving Camera2-related camera information.

Summary

Public methods
static Camera2CameraInfo
fromCameraInfo(@NonNull cameraInfo: CameraInfo)

Gets the Camera2CameraInfo from a CameraInfo.

T?
getCameraCharacteristic(@NonNull key: Key<T>)

Gets a camera characteristic value.

String

Gets the string camera ID.

Public methods

fromCameraInfo

@NonNull static fun fromCameraInfo(@NonNull cameraInfo: CameraInfo): Camera2CameraInfo

Gets the Camera2CameraInfo from a CameraInfo.

Parameters
cameraInfo CameraInfo: The CameraInfo to get from.
Return
Camera2CameraInfo The camera information with Camera2 implementation.
Exceptions
IllegalStateException if the camera info does not contain the camera2 information (e.g., if CameraX was not initialized with a androidx.camera.camera2.Camera2Config).

getCameraCharacteristic

@Nullable fun <T : Any!> getCameraCharacteristic(@NonNull key: Key<T>): T?

Gets a camera characteristic value.

The characteristic value is the same as the value in the CameraCharacteristics that would be obtained from android.hardware.camera2.CameraManager#getCameraCharacteristics(String).

Parameters
<T> The type of the characteristic value.
key Key<T>: The CameraCharacteristics.Key of the characteristic.
Return
T? the value of the characteristic.

getCameraId

@NonNull fun getCameraId(): String

Gets the string camera ID.

The camera ID is the same as the camera ID that would be obtained from android.hardware.camera2.CameraManager#getCameraIdList(). The ID that is retrieved is not static and can change depending on the current internal configuration of the androidx.camera.core.Camera from which the CameraInfo was retrieved. The Camera is a logical camera which can be backed by multiple android.hardware.camera2.CameraDevice. However, only one CameraDevice is active at one time. When the CameraDevice changes then the camera id will change.

Return
String the camera ID.
Exceptions
IllegalStateException if the camera info does not contain the camera 2 camera ID (e.g., if CameraX was not initialized with a androidx.camera.camera2.Camera2Config).