From 108708b4873fb05cb029b5bcb29a4e917004ca30 Mon Sep 17 00:00:00 2001
From: Eino-Ville Talvala If you are using the preview data to create video or still images,
+ * strongly consider using {@link android.media.MediaActionSound} to
+ * properly indicate image capture or recording start/stop to the user. Installs a callback to be invoked for every preview frame in addition
* to displaying them on the screen. The callback will be repeatedly called
* for as long as preview is active. This method can be called at any time,
- * even while preview is live. Any other preview callbacks are overridden.
+ * even while preview is live. Any other preview callbacks are
+ * overridden. If you are using the preview data to create video or still images,
+ * strongly consider using {@link android.media.MediaActionSound} to
+ * properly indicate image capture or recording start/stop to the user. Installs a callback to be invoked for the next preview frame in
+ * addition to displaying it on the screen. After one invocation, the
+ * callback is cleared. This method can be called any time, even when
+ * preview is live. Any other preview callbacks are overridden. If you are using the preview data to create video or still images,
+ * strongly consider using {@link android.media.MediaActionSound} to
+ * properly indicate image capture or recording start/stop to the user. Installs a callback to be invoked for every preview frame, using
+ * buffers supplied with {@link #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.
+ * 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
* {@link #addCallbackBuffer(byte[])} at some point -- before or after
- * calling this method -- or no callbacks will received.
+ * calling this method -- or no callbacks will received. The buffer queue will be cleared if this method is called with a null
* callback, {@link #setPreviewCallback(Camera.PreviewCallback)} is called,
- * or {@link #setOneShotPreviewCallback(Camera.PreviewCallback)} is called.
+ * or {@link #setOneShotPreviewCallback(Camera.PreviewCallback)} is
+ * called. If you are using the preview data to create video or still images,
+ * strongly consider using {@link android.media.MediaActionSound} to
+ * properly indicate image capture or recording start/stop to the user.
If autofocus is successful, consider using + * {@link android.media.MediaActionSound} to properly play back an autofocus + * success sound to the user.
+ * * @param cb the callback to run * @see #cancelAutoFocus() * @see android.hardware.Camera.Parameters#setAutoExposureLock(boolean) * @see android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean) + * @see android.media.MediaActionSound */ public final void autoFocus(AutoFocusCallback cb) {