diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-10-20 18:02:03 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-10-20 18:13:47 +0800 |
commit | 27c97af52157672f6201215d2e07497ff6361a8e (patch) | |
tree | fc7d87a4bc8c6e54a9c04a39d17dab634d0b4e0b /src | |
parent | e0b66a87432f452bf4a10ef5e0d835113a8ab69d (diff) | |
download | packages_apps_LegacyCamera-27c97af52157672f6201215d2e07497ff6361a8e.zip packages_apps_LegacyCamera-27c97af52157672f6201215d2e07497ff6361a8e.tar.gz packages_apps_LegacyCamera-27c97af52157672f6201215d2e07497ff6361a8e.tar.bz2 |
Reduct latency by starting face detection after preview is displayed.
bug:5446617
Change-Id: I3ddbf269ab882360206fecb59f67ff894b950422
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 589a5c8..e3b1450 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -385,6 +385,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, Util.initializeScreenBrightness(getWindow(), getContentResolver()); installIntentFilter(); initializeZoom(); + startFaceDetection(); // Show the tap to focus toast if this is the first start. if (mFocusAreaSupported && mPreferences.getBoolean(CameraSettings.KEY_TAP_TO_FOCUS_PROMPT_SHOWN, true)) { @@ -700,6 +701,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, enableCameraControls(true); startPreview(); + startFaceDetection(); } if (!mIsImageCaptureIntent) { @@ -1258,6 +1260,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, public void onReviewRetakeClicked(View v) { hidePostCaptureAlert(); startPreview(); + startFaceDetection(); } @OnClickAttr @@ -1462,6 +1465,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, initializeCapabilities(); resetExposureCompensation(); startPreview(); + startFaceDetection(); } catch (CameraHardwareException e) { Util.showErrorAndFinish(this, R.string.cannot_connect_camera); return; @@ -1683,6 +1687,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, // display rotation in onCreate may not be what we want. if (mCameraState == PREVIEW_STOPPED) { startPreview(); + startFaceDetection(); } else { if (Util.getDisplayRotation(this) != mDisplayRotation) { setDisplayOrientation(); @@ -1779,7 +1784,6 @@ public class Camera extends ActivityBase implements FocusManager.Listener, throw new RuntimeException("startPreview failed", ex); } - startFaceDetection(); mZoomState = ZOOM_STOPPED; mCameraState = IDLE; mFocusManager.onPreviewStarted(); |