diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2011-10-11 12:41:58 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2011-10-12 10:34:10 -0700 |
commit | 037abb8bb064c2878858c9b69978f6754f242627 (patch) | |
tree | 0def5073e8e5023a5b76bd76f85a4358a91464d9 /core/java/android/hardware/Camera.java | |
parent | 99f36683a4f2c218d52922ae7c2a0c0b3f2890ed (diff) | |
download | frameworks_base-037abb8bb064c2878858c9b69978f6754f242627.zip frameworks_base-037abb8bb064c2878858c9b69978f6754f242627.tar.gz frameworks_base-037abb8bb064c2878858c9b69978f6754f242627.tar.bz2 |
Add video stabilization control to Camera parameters.
Hardware video stabilization reduces camera shake in preview
and in recorded videos. It has no effect on still image capture.
Convenience accessor methods hidden for now.
Change-Id: Ie18450bff662b2ef98b85d19719beefc180975fc
Diffstat (limited to 'core/java/android/hardware/Camera.java')
-rw-r--r-- | core/java/android/hardware/Camera.java | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index d65e6df..9bd4a3b 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -1464,6 +1464,8 @@ public class Camera { private static final String KEY_MAX_NUM_DETECTED_FACES_SW = "max-num-detected-faces-sw"; private static final String KEY_RECORDING_HINT = "recording-hint"; private static final String KEY_VIDEO_SNAPSHOT_SUPPORTED = "video-snapshot-supported"; + private static final String KEY_VIDEO_STABILIZATION = "video-stabilization"; + private static final String KEY_VIDEO_STABILIZATION_SUPPORTED = "video-stabilization-supported"; // Parameter key suffix for supported values. private static final String SUPPORTED_VALUES_SUFFIX = "-values"; @@ -2443,7 +2445,7 @@ public class Camera { * * @param value new white balance. * @see #getWhiteBalance() - * @see #setAutoWhiteBalanceLock() + * @see #setAutoWhiteBalanceLock(boolean) */ public void setWhiteBalance(String value) { set(KEY_WHITE_BALANCE, value); @@ -3208,6 +3210,59 @@ public class Camera { return TRUE.equals(str); } + /** + * <p>Enables and disables video stabilization. Use + * {@link #isVideoStabilizationSupported} to determine if calling this + * method is valid.</p> + * + * <p>Video stabilization reduces the shaking due to the motion of the + * camera in both the preview stream and in recorded videos, including + * data received from the preview callback. It does not reduce motion + * blur in images captured with + * {@link Camera#takePicture takePicture}.</p> + * + * <p>Video stabilization can be enabled and disabled while preview or + * recording is active, but toggling it may cause a jump in the video + * stream that may be undesirable in a recorded video.</p> + * + * @param toggle Set to true to enable video stabilization, and false to + * disable video stabilization. + * @see #isVideoStabilizationSupported() + * @see #getVideoStabilization() + * @hide + */ + public void setVideoStabilization(boolean toggle) { + set(KEY_VIDEO_STABILIZATION, toggle ? TRUE : FALSE); + } + + /** + * Get the current state of video stabilization. See + * {@link #setVideoStabilization} for details of video stabilization. + * + * @return true if video stabilization is enabled + * @see #isVideoStabilizationSupported() + * @see #setVideoStabilization(boolean) + * @hide + */ + public boolean getVideoStabilization() { + String str = get(KEY_VIDEO_STABILIZATION); + return TRUE.equals(str); + } + + /** + * Returns true if video stabilization is supported. See + * {@link #setVideoStabilization} for details of video stabilization. + * + * @return true if video stabilization is supported + * @see #setVideoStabilization(boolean) + * @see #getVideoStabilization() + * @hide + */ + public boolean isVideoStabilizationSupported() { + String str = get(KEY_VIDEO_STABILIZATION_SUPPORTED); + return TRUE.equals(str); + } + // Splits a comma delimited string to an ArrayList of String. // Return null if the passing string is null or the size is 0. private ArrayList<String> split(String str) { |