# Print output for @column tags ?> Camera.PreviewCallback - Android SDK | Android Developers

Most visited


Recently visited


Camera.PreviewCallback

public static interface Camera.PreviewCallback

android.hardware.Camera.PreviewCallback


This interface is deprecated.
We recommend using the new android.hardware.camera2 API for new applications.

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

See also:

Summary


Public methods

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

Called as preview frames are displayed.

Public methods


onPreviewFrame

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

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

If using the 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 byte: the contents of the preview frame in the format defined by ImageFormat, which can be queried with Camera.Parameters.getPreviewFormat(). If Camera.Parameters.setPreviewFormat(int) is never called, the default will be the YCbCr_420_SP (NV21) format.

camera Camera: the Camera service object.

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.