diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-05-14 11:49:34 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-05-14 11:54:46 +0800 |
commit | d55a5e92d6065bd36a60925221d8cc9a773572eb (patch) | |
tree | 058b560c087cf46af2c2dbe922c8c0576dede976 /src | |
parent | 77e110b93d904a19d9d454c825688cf1706f2392 (diff) | |
download | LegacyCamera-d55a5e92d6065bd36a60925221d8cc9a773572eb.zip LegacyCamera-d55a5e92d6065bd36a60925221d8cc9a773572eb.tar.gz LegacyCamera-d55a5e92d6065bd36a60925221d8cc9a773572eb.tar.bz2 |
Restart preview after recording to avoid the bug in driver.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index efd465d..034836b 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -474,7 +474,12 @@ public class VideoCamera extends Activity implements View.OnClickListener, private void startPreview() { Log.v(TAG, "startPreview"); if (mPreviewing) { - // After recording a video, preview is not stopped. So just return. + // We should just return here, but we stop and start again to avoid + // the bug in driver. + mCameraDevice.lock(); + mCameraDevice.stopPreview(); + mCameraDevice.startPreview(); + mCameraDevice.unlock(); return; } @@ -509,8 +514,8 @@ public class VideoCamera extends Activity implements View.OnClickListener, mCameraDevice.unlock(); } - private void stopPreview() { - Log.v(TAG, "stopPreview"); + private void closeCamera() { + Log.v(TAG, "closeCamera"); if (mCameraDevice == null) { Log.d(TAG, "already stopped."); return; @@ -556,7 +561,7 @@ public class VideoCamera extends Activity implements View.OnClickListener, mStorageHint = null; } - stopPreview(); + closeCamera(); mHandler.removeMessages(UPDATE_LAST_VIDEO); } |