From 27c97af52157672f6201215d2e07497ff6361a8e Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Thu, 20 Oct 2011 18:02:03 +0800 Subject: Reduct latency by starting face detection after preview is displayed. bug:5446617 Change-Id: I3ddbf269ab882360206fecb59f67ff894b950422 --- src/com/android/camera/Camera.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/com/android') 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(); -- cgit v1.1