Android.Hardware.Camera.SetPreviewCallbackWithBuffer Method

Syntax

[Android.Runtime.Register("setPreviewCallbackWithBuffer", "(Landroid/hardware/Camera$PreviewCallback;)V", "")]
public void SetPreviewCallbackWithBuffer (Camera.IPreviewCallback cb)

See Also

Camera.AddCallbackBuffer(Byte[])
Android.Media.MediaActionSound

Parameters

cb
a callback object that receives a copy of the preview frame, or null to stop receiving callbacks and clear the buffer queue.

Remarks

Installs a callback to be invoked for every preview frame, using buffers supplied with Camera.AddCallbackBuffer(Byte[]), in addition to displaying them on the screen. The callback will be repeatedly called for as long as preview is active and buffers are available. Any other preview callbacks are overridden.

The purpose of this method is to improve preview efficiency and frame rate by allowing preview frame memory reuse. You must call Camera.AddCallbackBuffer(Byte[]) at some point -- before or after calling this method -- or no callbacks will received.

The buffer queue will be cleared if this method is called with a null callback, Camera.SetPreviewCallback(.IPreviewCallback) is called, or Camera.SetOneShotPreviewCallback(.IPreviewCallback) is called.

If you are using the preview data to create video or still images, strongly consider using Android.Media.MediaActionSound to properly indicate image capture or recording start/stop to the user.

[Android Documentation]

Requirements

Namespace: Android.Hardware
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8