Added in API level 1
Deprecated in API level 21

PreviewCallback

interface PreviewCallback
android.hardware.Camera.PreviewCallback

Callback interface used to deliver copies of preview frames as they are displayed.

Summary

Public methods
abstract Unit
onPreviewFrame(data: ByteArray!, camera: Camera!)

Called as preview frames are displayed.

Public methods

onPreviewFrame

Added in API level 1
abstract fun onPreviewFrame(
    data: ByteArray!,
    camera: Camera!
): Unit

Deprecated: Deprecated in Java.

Called as preview frames are displayed. This callback is invoked on the event thread open(int) was called from.

If using the android.graphics.ImageFormat#YV12 format, refer to the equations in Camera.Parameters#setPreviewFormat for the arrangement of the pixel data in the preview callback buffers.

Parameters
data ByteArray!: the contents of the preview frame in the format defined by android.graphics.ImageFormat, which can be queried with android.hardware.Camera.Parameters#getPreviewFormat(). If android.hardware.Camera.Parameters#setPreviewFormat(int) is never called, the default will be the YCbCr_420_SP (NV21) format.
camera Camera!: the Camera service object.