The second Android 11 Developer Preview is now available, test it out and share your feedback.

Camera2CameraInfo

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

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

Summary

Public methods

static String
extractCameraId(@NonNull cameraInfo: CameraInfo)

Returns the string camera ID for this camera.

Public methods

extractCameraId

@NonNull static fun extractCameraId(@NonNull cameraInfo: CameraInfo): String

Returns the string camera ID for this camera.

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

Parameters
cameraInfo CameraInfo: The CameraInfo to extract the camera ID from.
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).