Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
Added in API level 1
public static interface

Camera.PreviewCallback

android.hardware.Camera.PreviewCallback

Summary

Public Methods
abstract void onPreviewFrame (byte[] data, Camera camera)
Called as preview frames are displayed.

Public Methods

public abstract void onPreviewFrame (byte[] data, Camera camera)

Added in API level 1

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

If using the YV12 format, refer to the equations in setPreviewFormat(int) for the arrangement of the pixel data in the preview callback buffers.

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