CameraId.Companion


public static class CameraId.Companion


Summary

Public methods

static final @NonNull CameraId
fromCamera1Id(int value)

Creates a CameraId from a legacy Camera1 camera identifier integer.

static final @NonNull CameraId

Creates a CameraId from a Camera2 camera identifier string.

Public methods

fromCamera1Id

Added in 1.7.0-alpha03
public static final @NonNull CameraId fromCamera1Id(int value)

Creates a CameraId from a legacy Camera1 camera identifier integer.

Camera1 identifiers are typically zero-based indices used with android.hardware.Camera.open(int).

Parameters
int value

The Camera1 integer identifier.

Returns
@NonNull CameraId

A CameraId representing the given identifier as a string.

fromCamera2Id

Added in 1.7.0-alpha03
public static final @NonNull CameraId fromCamera2Id(@NonNull String value)

Creates a CameraId from a Camera2 camera identifier string.

Camera2 identifiers are typically obtained from android.hardware.camera2.CameraManager.getCameraIdList().

Parameters
@NonNull String value

The Camera2 identifier string.

Returns
@NonNull CameraId

A CameraId representing the given identifier.

Throws
IllegalArgumentException

if value is empty.