summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoCamera.java
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-10-24 11:40:50 -0700
committerEino-Ville Talvala <etalvala@google.com>2011-10-25 16:23:54 -0700
commitb11ee09d99c9a817eade2ee502a0ff4727f15c8f (patch)
treeeb72e95bf150cb17fe5ca44779886ec5b0f0aba3 /src/com/android/camera/VideoCamera.java
parentb8bd7ee0f8b0c3e0381ae6364bbeca4f28bdf7a4 (diff)
downloadLegacyCamera-b11ee09d99c9a817eade2ee502a0ff4727f15c8f.zip
LegacyCamera-b11ee09d99c9a817eade2ee502a0ff4727f15c8f.tar.gz
LegacyCamera-b11ee09d99c9a817eade2ee502a0ff4727f15c8f.tar.bz2
Fix video capture intent preview alert for effects.
In effects mode, stopping video record is asynchronous, and dealing with alerts and thumbnails has to be deferred until a done callback from the effectsrecorder. Bug: 5494625 Change-Id: Ic343b672c29515cb77f62b8d3e685d668681fdd1
Diffstat (limited to 'src/com/android/camera/VideoCamera.java')
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 4d09fee..1479bac 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -178,6 +178,7 @@ public class VideoCamera extends ActivityBase
private MediaRecorder mMediaRecorder;
private EffectsRecorder mEffectsRecorder;
+ private boolean mEffectsDisplayResult;
private int mEffectType = EffectsRecorder.EFFECT_NONE;
private Object mEffectParameter = null;
@@ -601,14 +602,15 @@ public class VideoCamera extends ActivityBase
}
private void onStopVideoRecording(boolean valid) {
+ mEffectsDisplayResult = true;
stopVideoRecording();
if (mIsVideoCaptureIntent) {
if (mQuickCapture) {
doReturnToCaller(valid);
- } else {
+ } else if (!effectsActive()) {
showAlert();
}
- } else {
+ } else if (!effectsActive()) {
getThumbnail();
}
}
@@ -925,12 +927,13 @@ public class VideoCamera extends ActivityBase
// This is similar to what mShutterButton.performClick() does,
// but not quite the same.
if (mMediaRecorderRecording) {
+ mEffectsDisplayResult = true;
if (mIsVideoCaptureIntent) {
stopVideoRecording();
- showAlert();
+ if (!effectsActive()) showAlert();
} else {
stopVideoRecording();
- getThumbnail();
+ if (!effectsActive()) getThumbnail();
}
} else {
stopVideoRecording();
@@ -1236,6 +1239,7 @@ public class VideoCamera extends ActivityBase
CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId];
+ mEffectsDisplayResult = false;
mEffectsRecorder = new EffectsRecorder(this);
// TODO: Confirm none of the foll need to go to initializeEffectsRecording()
@@ -1946,8 +1950,20 @@ public class VideoCamera extends ActivityBase
mBgLearningMessageFrame.setVisibility(View.GONE);
checkQualityAndStartPreview();
} else if (effectMsg == EffectsRecorder.EFFECT_MSG_RECORDING_DONE) {
- addVideoToMediaStore();
- getThumbnail();
+ // TODO: This assumes the codepath from onStopVideoRecording. It
+ // does not appear to cause problems for the other codepaths, but
+ // should be properly thought through.
+ if (mEffectsDisplayResult) {
+ addVideoToMediaStore();
+ if (mIsVideoCaptureIntent) {
+ if (!mQuickCapture) {
+ showAlert();
+ }
+ } else {
+ getThumbnail();
+ }
+ }
+ mEffectsDisplayResult = false;
} else if (effectId == EffectsRecorder.EFFECT_BACKDROPPER) {
switch (effectMsg) {
case EffectsRecorder.EFFECT_MSG_STARTED_LEARNING: