diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-08-16 21:14:16 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-08-18 00:15:40 +0800 |
commit | b9ac75d3dfc53ab4a0a104da147f1dfd7bc8c12f (patch) | |
tree | 8153bfc44e9bea4256e99a02ce9e97467e24ec1e | |
parent | 2fd1f816cd6911145af5f60476108cd088168ba6 (diff) | |
download | frameworks_base-b9ac75d3dfc53ab4a0a104da147f1dfd7bc8c12f.zip frameworks_base-b9ac75d3dfc53ab4a0a104da147f1dfd7bc8c12f.tar.gz frameworks_base-b9ac75d3dfc53ab4a0a104da147f1dfd7bc8c12f.tar.bz2 |
Add new camera focus mode FOCUS_MODE_CONTINUOUS_PICTURE.
The API is still hidden.
bug:5086125
Change-Id: I69268a95ad6aae249771d3a8dfb423ffe2d87081
-rw-r--r-- | core/java/android/hardware/Camera.java | 33 | ||||
-rw-r--r-- | include/camera/CameraParameters.h | 23 | ||||
-rw-r--r-- | libs/camera/CameraParameters.cpp | 1 |
3 files changed, 43 insertions, 14 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index cab8457..d3dbb8d 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -1613,17 +1613,34 @@ public class Camera { /** * Continuous auto focus mode intended for video recording. The camera - * continuously tries to focus. This is ideal for shooting video. - * Applications still can call {@link - * #takePicture(Camera.ShutterCallback, Camera.PictureCallback, - * Camera.PictureCallback)} in this mode but the subject may not be in - * focus. Auto focus starts when the parameter is set. Applications - * should not call {@link #autoFocus(AutoFocusCallback)} in this mode. - * To stop continuous focus, applications should change the focus mode - * to other modes. + * continuously tries to focus. This is the best choice for video + * recording because the focus changes smoothly . Applications still can + * call {@link #takePicture(Camera.ShutterCallback, + * Camera.PictureCallback, Camera.PictureCallback)} in this mode but the + * subject may not be in focus. Auto focus starts when the parameter is + * set. Applications should not call {@link + * #autoFocus(AutoFocusCallback)} in this mode. To stop continuous + * focus, applications should change the focus mode to other modes. */ public static final String FOCUS_MODE_CONTINUOUS_VIDEO = "continuous-video"; + /** + * Continuous auto focus mode intended for taking pictures. The camera + * continuously tries to focus. The speed of focus change is more + * aggressive than {@link #FOCUS_MODE_CONTINUOUS_VIDEO}. Auto focus + * starts when the parameter is set. If applications call {@link + * #autoFocus(AutoFocusCallback)} in this mode, the focus callback will + * immediately return with a boolean that indicates whether the focus is + * sharp or not. The apps can then decide if they want to take a picture + * immediately or to change the focus mode to auto, and run a full + * autofocus cycle. To stop continuous focus, applications should change + * the focus mode to other modes. + * + * @see #FOCUS_MODE_CONTINUOUS_VIDEO + * @hide + */ + public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture"; + // Indices for focus distance array. /** * The array index of near focus distance for use with diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index b661496..6c91dfc 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -597,13 +597,24 @@ public: // CameraHardwareInterface.autoFocus in this mode. static const char FOCUS_MODE_EDOF[]; // Continuous auto focus mode intended for video recording. The camera - // continuously tries to focus. This is ideal for shooting video. - // Applications still can call CameraHardwareInterface.takePicture in this - // mode but the subject may not be in focus. Auto focus starts when the - // parameter is set. Applications should not call - // CameraHardwareInterface.autoFocus in this mode. To stop continuous focus, - // applications should change the focus mode to other modes. + // continuously tries to focus. This is the best choice for video + // recording because the focus changes smoothly . Applications still can + // call CameraHardwareInterface.takePicture in this mode but the subject may + // not be in focus. Auto focus starts when the parameter is set. + // Applications should not call CameraHardwareInterface.autoFocus in this + // mode. To stop continuous focus, applications should change the focus mode + // to other modes. static const char FOCUS_MODE_CONTINUOUS_VIDEO[]; + // Continuous auto focus mode intended for taking pictures. The camera + // continuously tries to focus. The speed of focus change is more aggressive + // than FOCUS_MODE_CONTINUOUS_VIDEO. Auto focus starts when the parameter is + // set. If applications call autoFocus in this mode, the focus callback will + // immediately return with a boolean that indicates the focus is sharp or + // not. The apps can then decide if they want to take a picture immediately + // or to change the focus mode to auto, and run a full autofocus cycle. To + // stop continuous focus, applications should change the focus mode to other + // modes. + static const char FOCUS_MODE_CONTINUOUS_PICTURE[]; private: DefaultKeyedVector<String8,String8> mMap; diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp index 51b96c1..0eb5d50 100644 --- a/libs/camera/CameraParameters.cpp +++ b/libs/camera/CameraParameters.cpp @@ -160,6 +160,7 @@ const char CameraParameters::FOCUS_MODE_MACRO[] = "macro"; const char CameraParameters::FOCUS_MODE_FIXED[] = "fixed"; const char CameraParameters::FOCUS_MODE_EDOF[] = "edof"; const char CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO[] = "continuous-video"; +const char CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE[] = "continuous-picture"; CameraParameters::CameraParameters() : mMap() |