Camera2CameraInfo

public final class Camera2CameraInfo
extends Object

java.lang.Object
   ↳ androidx.camera.camera2.interop.Camera2CameraInfo


Provides ability to extract Camera2-related camera information from CameraInfo.

Summary

Public methods

static String extractCameraId(CameraInfo cameraInfo)

Returns the string camera ID for this camera.

Inherited methods

Public methods

extractCameraId

public static String extractCameraId (CameraInfo cameraInfo)

Returns the string camera ID for this camera.

The camera ID is the same as the camera ID that would be obtained from CameraManager.getCameraIdList().

Parameters
cameraInfo CameraInfo: The CameraInfo to extract the camera ID from.

Returns
String the camera ID.

Throws
IllegalStateException if the camera info does not contain the camera 2 camera ID (e.g., if CameraX was not initialized with a Camera2Config).