Merge "Refresh parameters during recording." into gb-ub-photos-bryce
diff --git a/src/com/android/camera/CameraManager.java b/src/com/android/camera/CameraManager.java
index b354654..af4b13f 100644
--- a/src/com/android/camera/CameraManager.java
+++ b/src/com/android/camera/CameraManager.java
@@ -72,6 +72,7 @@
private static final int SET_PREVIEW_DISPLAY_ASYNC = 22;
private static final int SET_PREVIEW_CALLBACK = 23;
private static final int ENABLE_SHUTTER_SOUND = 24;
+ private static final int REFRESH_PARAMETERS = 25;
private Handler mCameraHandler;
private android.hardware.Camera mCamera;
@@ -247,6 +248,10 @@
enableShutterSound((msg.arg1 == 1) ? true : false);
return;
+ case REFRESH_PARAMETERS:
+ mParametersIsDirty = true;
+ return;
+
default:
throw new RuntimeException("Invalid CameraProxy message=" + msg.what);
}
@@ -446,6 +451,10 @@
return mParameters;
}
+ public void refreshParameters() {
+ mCameraHandler.sendEmptyMessage(REFRESH_PARAMETERS);
+ }
+
public void enableShutterSound(boolean enable) {
mCameraHandler.obtainMessage(
ENABLE_SHUTTER_SOUND, (enable ? 1 : 0), 0).sendToTarget();
diff --git a/src/com/android/camera/NewVideoModule.java b/src/com/android/camera/NewVideoModule.java
index 3fc7485..f8c36c5 100644
--- a/src/com/android/camera/NewVideoModule.java
+++ b/src/com/android/camera/NewVideoModule.java
@@ -1507,6 +1507,9 @@
AccessibilityUtils.makeAnnouncement(mUI.getShutterButton(),
mActivity.getString(R.string.video_recording_started));
+ // The parameters might have been altered by MediaRecorder already.
+ // We need to force mCameraDevice to refresh before getting it.
+ mCameraDevice.refreshParameters();
// The parameters may have been changed by MediaRecorder upon starting
// recording. We need to alter the parameters if we support camcorder
// zoom. To reduce latency when setting the parameters during zoom, we
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 09a406c..2b30ba4 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1532,6 +1532,9 @@
AccessibilityUtils.makeAnnouncement(mActivity.getShutterButton(),
mActivity.getString(R.string.video_recording_started));
+ // The parameters might have been altered by MediaRecorder already.
+ // We need to force mCameraDevice to refresh before getting it.
+ mActivity.mCameraDevice.refreshParameters();
// The parameters may have been changed by MediaRecorder upon starting
// recording. We need to alter the parameters if we support camcorder
// zoom. To reduce latency when setting the parameters during zoom, we