onPreviewFrame

abstract fun onPreviewFrame(frame: Array<Byte>, width: Int, height: Int, format: Int)

Called as preview frames are displayed. This callback is invoked on the main thread so no intensive operation should be performed to avoid blocking the UI.

Parameters

frame

the contents of the preview frame

width

width of the frame

height

height of the frame

format

format of the frame as defined in android.graphics.ImageFormat