FrameProducer

interface FrameProducer

Defines methods and properties that describe an entity that can produce frames. Although the contract describes a typical camera, other classes can implement it to produce frames from different sources.

Subtypes:

Inheritors

Types

Link copied to clipboard
sealed class Event

Events emitted by the FrameProducer to communicate important state changes, warnings and errors.

Functions

Link copied to clipboard
abstract fun cancelAutoFocus()

Requests the frame producer to cancel any ongoing focus request.

Link copied to clipboard

Gets the support information of the frame producer, if available.

Link copied to clipboard

Returns a unique identifier of the currently opened frame producer, if available.

Link copied to clipboard
abstract fun isInitialized(): Boolean
Link copied to clipboard
abstract fun openCameraInstance(cameraSelectorFilter: CameraSelectorFilter)

Select, open and initialize the frame producer with appropriate configuration.

Link copied to clipboard
abstract fun release()

Releases the frame producer and its associated resources.

Link copied to clipboard
abstract fun requestAutoFocus(meteringPoint: MeteringPoint)

Requests the frame producer to perform a focusing action on a region of interest.

Link copied to clipboard
abstract fun setTorchEnabled(enable: Boolean, torchChangedResultListener: (isSuccessful: Boolean) -> Unit? = null)

Requests the frame producer to change the torch state.

Link copied to clipboard
abstract fun startPreview(surface: Surface, requireTakePictureCapability: Boolean = true)
abstract fun startPreview(surfaceHolder: SurfaceHolder, requireTakePictureCapability: Boolean = true)
abstract fun startPreview(surfaceProvider: Preview.SurfaceProvider, requireTakePictureCapability: Boolean = true)

Initializes a continuous stream of preview frames.

Link copied to clipboard
abstract fun startVideoRecording()

Starts the recording of a video.

Link copied to clipboard
abstract fun stopPreview()

Stops the continuous stream of preview frames.

Link copied to clipboard
abstract fun stopVideoRecording()

Stops the recording of a video.

Link copied to clipboard
abstract fun takePicture()

Requests the frame producer to take a picture.

Properties

Link copied to clipboard
abstract var customFocusMode: Int?

A custom focus mode to use in the frame producer.

Link copied to clipboard

LiveData object to emit the status of the focus, focusing or not.

Link copied to clipboard

LiveData object to emit general events related to the frame producer.

Link copied to clipboard
abstract val pictureFrames: LiveData<Frame?>

LiveData object to emit the frames generated by take picture requests.

Link copied to clipboard
abstract val previewFrames: LiveData<Frame?>

LiveData object to emit the frames generated by the preview.

Link copied to clipboard

LiveData object to emit the status of the torch, True for ON and False for OFF.

Link copied to clipboard

LiveData object to emit the recordings generated by video recording requests.