public final class CameraInfo

  1. Object
  2. CameraInfo

Describes a physical camera available on the device.

Returned by Camera#getCameras() and Camera#getDefault(CameraFacing). Instances are immutable and may be passed to Camera#open(CameraInfo, CameraSessionOptions).

Constructors

public CameraInfo(String id, CameraFacing facing, Dimension[] photoSizes, Dimension[] previewSizes, boolean hasFlash, boolean hasAutoFocus)Used by platform implementations.

Methods

public String getId()Opaque, platform-specific identifier.
public CameraFacing getFacing()Direction this camera faces relative to the device screen.
public Dimension[] getPhotoSizes()Supported still-photo resolutions, largest first.
public Dimension[] getPreviewSizes()Supported preview/frame-stream resolutions.
public boolean hasFlash()True if this camera has a flash/torch the application can drive via CameraSession#setFlashMode(FlashMode).
public boolean hasAutoFocus()True if this camera supports tap-to-focus / autofocus.

Inherited methods

Constructor details

CameraInfo

public CameraInfo(String id, CameraFacing facing, Dimension[] photoSizes, Dimension[] previewSizes, boolean hasFlash, boolean hasAutoFocus)
Used by platform implementations. Application code obtains instances through Camera#getCameras().

Method details

getId

public String getId()
Opaque, platform-specific identifier. Stable for the lifetime of the process.

getFacing

public CameraFacing getFacing()
Direction this camera faces relative to the device screen.

getPhotoSizes

public Dimension[] getPhotoSizes()
Supported still-photo resolutions, largest first. May be empty on platforms (e.g. the JavaSE simulator) that don’t expose a discrete list.

getPreviewSizes

public Dimension[] getPreviewSizes()
Supported preview/frame-stream resolutions. May be empty on platforms that don’t expose a discrete list.

hasFlash

public boolean hasFlash()
True if this camera has a flash/torch the application can drive via CameraSession#setFlashMode(FlashMode).

hasAutoFocus

public boolean hasAutoFocus()
True if this camera supports tap-to-focus / autofocus.