summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoCamera.java
diff options
context:
space:
mode:
authorPannag Sanketi <psanketi@google.com>2011-11-14 21:48:17 -0800
committerPannag Sanketi <psanketi@google.com>2011-11-15 13:25:11 -0800
commit87e72ba9d89f8b83b1356f17077b9652346a29d4 (patch)
tree344aa57a41727486f3b44423e22e6f7f9dcaddf1 /src/com/android/camera/VideoCamera.java
parent34238165cfdf04584587360dfcf21109bf09e144 (diff)
downloadpackages_apps_LegacyCamera-87e72ba9d89f8b83b1356f17077b9652346a29d4.tar.gz
packages_apps_LegacyCamera-87e72ba9d89f8b83b1356f17077b9652346a29d4.tar.bz2
packages_apps_LegacyCamera-87e72ba9d89f8b83b1356f17077b9652346a29d4.zip
Start Effects Recording only after preview loads
Start Effects Recording only after we get SurfaceTexture Callback in EffectsRecorder, and hence preview loaded. Disable the shutter button on creation, and re-enable it on the preview callback. Else, one could potentially start the recording before the preview loads, leading to a wrong state information and an eventual crash. Related Bugs: 5605173, 5605658 Change-Id: I2ed766997294c165ce6c262cf47f124493d0c5ec
Diffstat (limited to 'src/com/android/camera/VideoCamera.java')
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index f725f438..6a82187f 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -432,6 +432,16 @@ public class VideoCamera extends ActivityBase
mShutterButton.setOnShutterButtonListener(this);
mShutterButton.requestFocus();
+ // Disable the shutter button if effects are ON since it might take
+ // a little more time for the effects preview to be ready. We do not
+ // want to allow recording before that happens. The shutter button
+ // will be enabled when we get the message from effectsrecorder that
+ // the preview is running. This becomes critical when the camera is
+ // swapped.
+ if (effectsActive()) {
+ mShutterButton.setEnabled(false);
+ }
+
mRecordingTimeView = (TextView) findViewById(R.id.recording_time);
mRecordingTimeRect = (RotateLayout) findViewById(R.id.recording_time_rect);
mOrientationListener = new MyOrientationEventListener(this);
@@ -641,6 +651,7 @@ public class VideoCamera extends ActivityBase
@Override
public void onShutterButtonClick() {
if (collapseCameraControls()) return;
+
boolean stop = mMediaRecorderRecording;
if (stop) {
@@ -1992,6 +2003,9 @@ public class VideoCamera extends ActivityBase
}
}
mEffectsDisplayResult = false;
+ } else if (effectMsg == EffectsRecorder.EFFECT_MSG_PREVIEW_RUNNING) {
+ // Enable the shutter button once the preview is complete.
+ mShutterButton.setEnabled(true);
} else if (effectId == EffectsRecorder.EFFECT_BACKDROPPER) {
switch (effectMsg) {
case EffectsRecorder.EFFECT_MSG_STARTED_LEARNING: