public final class CameraSessionOptions

  1. Object
  2. CameraSessionOptions

Configuration for a CameraSession. Fluent builder.

All sizes are advisory; the platform may snap to its nearest supported resolution.

Constructors

public CameraSessionOptions()

Methods

public CameraSessionOptions previewSize(int width, int height)Requested preview / frame-stream resolution.
public CameraSessionOptions photoSize(int width, int height)Requested still-photo resolution.
public CameraSessionOptions frameFormat(FrameFormat format)Format for frames delivered to FrameListener.
public CameraSessionOptions frameMaxFps(int fps)Cap on frame delivery rate to FrameListeners.
public CameraSessionOptions captureAudio(boolean b)Whether to capture audio for video recording.
public CameraSessionOptions enableStabilization(boolean b)Whether to request optical/electronic stabilization when supported.
public int getPreviewWidth()Requested preview width, or 0 to let the platform pick.
public int getPreviewHeight()Requested preview height, or 0 to let the platform pick.
public int getPhotoWidth()Requested still-photo width, or 0 to use the camera default.
public int getPhotoHeight()Requested still-photo height, or 0 to use the camera default.
public FrameFormat getFrameFormat()Pixel format requested for FrameListener delivery.
public int getFrameMaxFps()Cap on frames-per-second delivered to listeners; 0 means uncapped.
public boolean isCaptureAudio()True if the session should request the microphone for video recording.
public boolean isStabilizationEnabled()True if optical/electronic stabilization was requested.

Inherited methods

Constructor details

CameraSessionOptions

public CameraSessionOptions()

Method details

previewSize

public CameraSessionOptions previewSize(int width, int height)
Requested preview / frame-stream resolution. The platform may snap to its nearest supported size. Pass 0 for either dimension to let the platform pick.

photoSize

public CameraSessionOptions photoSize(int width, int height)
Requested still-photo resolution. The platform may snap to its nearest supported size. Pass 0 for either dimension to use the camera’s default photo size.

frameFormat

public CameraSessionOptions frameFormat(FrameFormat format)
Format for frames delivered to FrameListener. Default FrameFormat#JPEG.

frameMaxFps

public CameraSessionOptions frameMaxFps(int fps)
Cap on frame delivery rate to FrameListeners. Default 15. Set to 0 to deliver every frame the camera produces.

captureAudio

public CameraSessionOptions captureAudio(boolean b)
Whether to capture audio for video recording. Default true. When false, no microphone permission is requested at session open.

enableStabilization

public CameraSessionOptions enableStabilization(boolean b)
Whether to request optical/electronic stabilization when supported. Default false.

getPreviewWidth

public int getPreviewWidth()
Requested preview width, or 0 to let the platform pick.

getPreviewHeight

public int getPreviewHeight()
Requested preview height, or 0 to let the platform pick.

getPhotoWidth

public int getPhotoWidth()
Requested still-photo width, or 0 to use the camera default.

getPhotoHeight

public int getPhotoHeight()
Requested still-photo height, or 0 to use the camera default.

getFrameFormat

public FrameFormat getFrameFormat()
Pixel format requested for FrameListener delivery.

getFrameMaxFps

public int getFrameMaxFps()
Cap on frames-per-second delivered to listeners; 0 means uncapped.

isCaptureAudio

public boolean isCaptureAudio()
True if the session should request the microphone for video recording.

isStabilizationEnabled

public boolean isStabilizationEnabled()
True if optical/electronic stabilization was requested.