diff options
| author | Wei-Ta Chen <weita@google.com> | 2011-09-16 11:44:25 -0700 |
|---|---|---|
| committer | Wei-Ta Chen <weita@google.com> | 2011-09-16 11:59:05 -0700 |
| commit | d3105c578427ac7507ca32ff1de4a92962de2357 (patch) | |
| tree | 9028fa0280190fe13517249f0f37e0801f01ea1f /src | |
| parent | 6c5b20113ba9f91352f32e5a53df66aec0ec761a (diff) | |
| download | LegacyCamera-d3105c578427ac7507ca32ff1de4a92962de2357.zip LegacyCamera-d3105c578427ac7507ca32ff1de4a92962de2357.tar.gz LegacyCamera-d3105c578427ac7507ca32ff1de4a92962de2357.tar.bz2 | |
Set the focus mode to infinity in the Panorama mode.
Bug: 5320359
Change-Id: Iff431595bcc23a64cba93c5ac77bb3f34008b6b8
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/camera/panorama/PanoramaActivity.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java index 00613c7..d459740 100644 --- a/src/com/android/camera/panorama/PanoramaActivity.java +++ b/src/com/android/camera/panorama/PanoramaActivity.java @@ -164,6 +164,10 @@ public class PanoramaActivity extends Activity implements private float[] mTransformMatrix; private float mHorizontalViewAngle; + // Prefer FOCUS_MODE_INFINITY to FOCUS_MODE_CONTINUOUS_VIDEO because of + // getting a better image quality by the former. + private String mTargetFocusMode = Parameters.FOCUS_MODE_INFINITY; + private PanoOrientationEventListener mOrientationEventListener; // The value could be 0, 1, 2, 3 for the 4 different orientations measured in clockwise // respectively. @@ -346,6 +350,15 @@ public class PanoramaActivity extends Activity implements parameters.setPreviewFpsRange(minFps, maxFps); Log.v(TAG, "preview fps: " + minFps + ", " + maxFps); + List<String> supportedFocusModes = parameters.getSupportedFocusModes(); + if (supportedFocusModes.indexOf(mTargetFocusMode) >= 0) { + parameters.setFocusMode(mTargetFocusMode); + } else { + // Use the default focus mode and log a message + Log.w(TAG, "Cannot set the focus mode to " + mTargetFocusMode + + " becuase the mode is not supported."); + } + parameters.setRecordingHint(false); mHorizontalViewAngle = ((mDeviceOrientation % 2) == 0) ? |
