summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-09-03 15:10:44 -0700
committerWu-cheng Li <wuchengli@google.com>2010-09-03 15:10:44 -0700
commit91561bdb6ab42d5a262201fb4044bdc5949ca07c (patch)
tree30d4db0043fcdff4340938869123f4c4da1f450f /src
parent3c7f489d9ea86e6f37b596469173cd3ceca3ad58 (diff)
downloadLegacyCamera-91561bdb6ab42d5a262201fb4044bdc5949ca07c.zip
LegacyCamera-91561bdb6ab42d5a262201fb4044bdc5949ca07c.tar.gz
LegacyCamera-91561bdb6ab42d5a262201fb4044bdc5949ca07c.tar.bz2
Fix the crash when video quality changes.
Stop the preview in surfaceChanged before restarting the preview. bug:2974865 Change-Id: Ie6b99c2650ee4900a277da87006950e984358d6f
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/VideoCamera.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 1d19561..cb0bb02 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -639,6 +639,10 @@ public class VideoCamera extends NoSearchActivity
}
mCameraDevice.lock();
+ if (mPreviewing == true) {
+ mCameraDevice.stopPreview();
+ mPreviewing = false;
+ }
setPreviewDisplay(mSurfaceHolder);
Util.setCameraDisplayOrientation(this, mCameraId, mCameraDevice);
setCameraParameters();
@@ -805,6 +809,10 @@ public class VideoCamera extends NoSearchActivity
mHandler.sendEmptyMessage(INIT_RECORDER);
} else {
stopVideoRecording();
+ // If video quality changes, the surface will change. But we need to
+ // initialize the recorder here. So collpase the head-up display to
+ // keep the state of recorder consistent.
+ mHeadUpDisplay.collapse();
restartPreview();
initializeRecorder();
}