summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware/Camera.java
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-03-05 11:00:43 -0800
committerEino-Ville Talvala <etalvala@google.com>2012-03-12 09:12:27 -0700
commit108708b4873fb05cb029b5bcb29a4e917004ca30 (patch)
treea723f7c817f331e93dc31b8b580ee6769d9223e3 /core/java/android/hardware/Camera.java
parentc4ffe77a710880416a7cf7c20277311bab2d7abc (diff)
downloadframeworks_base-108708b4873fb05cb029b5bcb29a4e917004ca30.zip
frameworks_base-108708b4873fb05cb029b5bcb29a4e917004ca30.tar.gz
frameworks_base-108708b4873fb05cb029b5bcb29a4e917004ca30.tar.bz2
Add references to MediaActionSound in Camera documentation.
Also includes a few minor doc cleanups. Change-Id: I1742a50f92ceb2b14761e8306891e545a3cf49dd
Diffstat (limited to 'core/java/android/hardware/Camera.java')
-rw-r--r--core/java/android/hardware/Camera.java55
1 files changed, 42 insertions, 13 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 2775c7b..6cf3b2b 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -437,6 +437,13 @@ public class Camera {
* instances of the same camera, or across multiple runs of the same
* program.
*
+ * <p>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.</p>
+ *
+ * @see android.media.MediaActionSound
+ * @see android.graphics.SurfaceTexture
+ * @see android.view.TextureView
* @param surfaceTexture the {@link SurfaceTexture} to which the preview
* images are to be sent or null to remove the current preview surface
* texture
@@ -512,13 +519,19 @@ public class Camera {
public native final boolean previewEnabled();
/**
- * Installs a callback to be invoked for every preview frame in addition
+ * <p>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.</p>
+ *
+ * <p>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.</p>
*
* @param cb a callback object that receives a copy of each preview frame,
* or null to stop receiving callbacks.
+ * @see android.media.MediaActionSound
*/
public final void setPreviewCallback(PreviewCallback cb) {
mPreviewCallback = cb;
@@ -530,13 +543,18 @@ public class Camera {
}
/**
- * 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.
+ * <p>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.</p>
+ *
+ * <p>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.</p>
*
* @param cb a callback object that receives a copy of the next preview frame,
* or null to stop receiving callbacks.
+ * @see android.media.MediaActionSound
*/
public final void setOneShotPreviewCallback(PreviewCallback cb) {
mPreviewCallback = cb;
@@ -548,24 +566,30 @@ public class Camera {
private native final void setHasPreviewCallback(boolean installed, boolean manualBuffer);
/**
- * Installs a callback to be invoked for every preview frame, using buffers
- * supplied with {@link #addCallbackBuffer(byte[])}, in addition to
+ * <p>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.</p>
*
* <p>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.</p>
*
- * The buffer queue will be cleared if this method is called with a null
+ * <p>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.</p>
+ *
+ * <p>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.</p>
*
* @param cb a callback object that receives a copy of the preview frame,
* or null to stop receiving callbacks and clear the buffer queue.
* @see #addCallbackBuffer(byte[])
+ * @see android.media.MediaActionSound
*/
public final void setPreviewCallbackWithBuffer(PreviewCallback cb) {
mPreviewCallback = cb;
@@ -834,10 +858,15 @@ public class Camera {
* the focus position. Applications must call cancelAutoFocus to reset the
* focus.</p>
*
+ * <p>If autofocus is successful, consider using
+ * {@link android.media.MediaActionSound} to properly play back an autofocus
+ * success sound to the user.</p>
+ *
* @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)
{