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

Camera2CameraInfoImpl

class Camera2CameraInfoImpl : CameraInfoInternal
kotlin.Any
   ↳ androidx.camera.camera2.internal.Camera2CameraInfoImpl

Implementation of the CameraInfoInternal interface that exposes parameters through camera2.

Summary

Public methods

String

String

Returns the implementation type of the camera, this depends on the CameraXConfig used in the initialization of CameraX.

Int?

Int
getSensorRotationDegrees(relativeRotation: Int)

Int

LiveData<Int!>

LiveData<ZoomState!>

Boolean

Public methods

getCameraId

@NonNull fun getCameraId(): String

getImplementationType

@NonNull fun getImplementationType(): String

Returns the implementation type of the camera, this depends on the CameraXConfig used in the initialization of CameraX.

When the CameraX configuration is androidx.camera.camera2.Camera2Config, the return value depends on whether the device is legacy (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL == CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY).

Return
String IMPLEMENTATION_TYPE_CAMERA2_LEGACY if the device is legacy, otherwise IMPLEMENTATION_TYPE_CAMERA2.

getLensFacing

@Nullable fun getLensFacing(): Int?

getSensorRotationDegrees

fun getSensorRotationDegrees(relativeRotation: Int): Int

getSensorRotationDegrees

fun getSensorRotationDegrees(): Int

getTorchState

@NonNull fun getTorchState(): LiveData<Int!>

getZoomState

@NonNull fun getZoomState(): LiveData<ZoomState!>

hasFlashUnit

fun hasFlashUnit(): Boolean