summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java51
1 files changed, 12 insertions, 39 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 6a1e3e326..5121a032f 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -96,7 +96,6 @@ public class VideoModule implements CameraModule,
private static final int SHOW_TAP_TO_SNAPSHOT_TOAST = 7;
private static final int SWITCH_CAMERA = 8;
private static final int SWITCH_CAMERA_START_ANIMATION = 9;
- private static final int SET_FOCUS_RATIO = 10;
private static final int SCREEN_DELAY = 2 * 60 * 1000;
@@ -392,11 +391,6 @@ public class VideoModule implements CameraModule,
break;
}
- case SET_FOCUS_RATIO: {
- mUI.getFocusRing().setRadiusRatio((Float)msg.obj);
- break;
- }
-
default:
Log.v(TAG, "Unhandled message: " + msg.what);
break;
@@ -552,27 +546,15 @@ public class VideoModule implements CameraModule,
@Override
public void setFocusParameters() {
- updateCameraParametersFocus();
- mCameraDevice.setParameters(mParameters);
- }
-
- private void updateCameraParametersFocus() {
- setAutoExposureLockIfSupported();
- setAutoWhiteBalanceLockIfSupported();
- setFocusAreasIfSupported();
- setMeteringAreasIfSupported();
- mParameters.setFocusMode(mFocusManager.getFocusMode(true));
- }
-
- private void setFocusAreasIfSupported() {
- if (mFocusAreaSupported) {
+ if (mFocusAreaSupported)
mParameters.setFocusAreas(mFocusManager.getFocusAreas());
- }
- }
-
- private void setMeteringAreasIfSupported() {
- if (mMeteringAreaSupported) {
+ if (mMeteringAreaSupported)
mParameters.setMeteringAreas(mFocusManager.getMeteringAreas());
+ setAutoExposureLockIfSupported();
+ setAutoWhiteBalanceLockIfSupported();
+ if (mFocusAreaSupported || mMeteringAreaSupported) {
+ mParameters.setFocusMode(mFocusManager.getFocusMode(true));
+ mCameraDevice.setParameters(mParameters);
}
}
@@ -858,22 +840,14 @@ public class VideoModule implements CameraModule,
@Override
public void onAutoFocus(
boolean focused, CameraProxy camera) {
+ Log.v(TAG, "AutoFocusCallback, mPaused=" + mPaused);
if (mPaused) return;
- mCameraDevice.refreshParameters();
- mFocusManager.setParameters(mCameraDevice.getParameters());
+ //setCameraState(IDLE);
mFocusManager.onAutoFocus(focused, false);
}
}
- @Override
- public void setFocusRatio(float ratio) {
- mHandler.removeMessages(SET_FOCUS_RATIO);
- Message m = mHandler.obtainMessage(SET_FOCUS_RATIO);
- m.obj = ratio;
- mHandler.sendMessage(m);
- }
-
private void readVideoPreferences() {
// The preference stores values from ListPreference and is thus string type for all values.
// We need to convert it to int manually.
@@ -2564,10 +2538,6 @@ public class VideoModule implements CameraModule,
mParameters.setPreviewFrameRate(mProfile.videoFrameRate);
}
- // Set focus mode
- mFocusManager.overrideFocusMode(null);
- updateCameraParametersFocus();
-
forceFlashOffIfSupported(!mPreviewFocused);
videoWidth = mProfile.videoFrameWidth;
videoHeight = mProfile.videoFrameHeight;
@@ -2607,6 +2577,9 @@ public class VideoModule implements CameraModule,
mParameters.setZoom(mZoomValue);
}
+ // Set focus mode
+ mParameters.setFocusMode(mFocusManager.getFocusMode(true));
+
mParameters.set(CameraUtil.RECORDING_HINT, CameraUtil.TRUE);
// Enable video stabilization. Convenience methods not available in API