diff options
author | Sascha Haeberling <haeberling@google.com> | 2013-08-06 14:31:52 -0700 |
---|---|---|
committer | Sascha Haeberling <haeberling@google.com> | 2013-08-06 14:58:07 -0700 |
commit | 37f3611bbdc787c996a99894dcef7d8fb77e3f7c (patch) | |
tree | 4dc08a60a543dc4d2b0672a8c0cc4efdc30b52ad /src/com/android/camera/VideoModule.java | |
parent | 8fe71f31bc8ab1b634566a3060e041e22e9b2e41 (diff) | |
download | android_packages_apps_Snap-37f3611bbdc787c996a99894dcef7d8fb77e3f7c.tar.gz android_packages_apps_Snap-37f3611bbdc787c996a99894dcef7d8fb77e3f7c.tar.bz2 android_packages_apps_Snap-37f3611bbdc787c996a99894dcef7d8fb77e3f7c.zip |
This adds the following four CLs to Camera2:
http://ag/339319
http://ag/338974
http://ag/338401
http://ag/324149
Adapted to work in Camera2 and adding a .gitignore so that temporary
Eclipse files and folders are not submitted.
Change-Id: I40295c7f0139f76270c44f0ca395c0574a288569
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index aa085af0e..1516cb5d0 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -92,8 +92,6 @@ public class VideoModule implements CameraModule, private static final int SHOW_TAP_TO_SNAPSHOT_TOAST = 7; private static final int SWITCH_CAMERA = 8; private static final int SWITCH_CAMERA_START_ANIMATION = 9; - private static final int HIDE_SURFACE_VIEW = 10; - private static final int CAPTURE_ANIMATION_DONE = 11; private static final int SCREEN_DELAY = 2 * 60 * 1000; @@ -107,7 +105,6 @@ public class VideoModule implements CameraModule, private static final String EXTRA_QUICK_CAPTURE = "android.intent.extra.quickCapture"; - private static final int MIN_THUMB_SIZE = 64; // module fields private CameraActivity mActivity; private boolean mPaused; @@ -200,9 +197,7 @@ public class VideoModule implements CameraModule, @Override public void onMediaSaved(Uri uri) { if (uri != null) { - mActivity.sendBroadcast( - new Intent(Util.ACTION_NEW_VIDEO, uri)); - Util.broadcastNewPicture(mActivity, uri); + mActivity.notifyNewMedia(uri); } } }; @@ -212,7 +207,7 @@ public class VideoModule implements CameraModule, @Override public void onMediaSaved(Uri uri) { if (uri != null) { - Util.broadcastNewPicture(mActivity, uri); + mActivity.notifyNewMedia(uri); } } }; @@ -295,11 +290,6 @@ public class VideoModule implements CameraModule, break; } - case CAPTURE_ANIMATION_DONE: { - mUI.enablePreviewThumb(false); - break; - } - default: Log.v(TAG, "Unhandled message: " + msg.what); break; @@ -555,16 +545,12 @@ public class VideoModule implements CameraModule, // back to use SurfaceTexture for preview and we need to stop then start // the preview. This will cause the preview flicker since the preview // will not be continuous for a short period of time. - // TODO: need to get the capture animation to work - // ((CameraScreenNail) mActivity.mCameraScreenNail).animateCapture(mDisplayRotation); - - mUI.enablePreviewThumb(true); - // Make sure to disable the thumbnail preview after the - // animation is done to disable the click target. - mHandler.removeMessages(CAPTURE_ANIMATION_DONE); - mHandler.sendEmptyMessageDelayed(CAPTURE_ANIMATION_DONE, - CaptureAnimManager.getAnimationDuration()); + mUI.animateFlash(); + Bitmap bitmap = getVideoThumbnail(); + if (bitmap != null) { + mUI.animateCapture(bitmap); + } } } } @@ -1425,7 +1411,7 @@ public class VideoModule implements CameraModule, private void startVideoRecording() { Log.v(TAG, "startVideoRecording"); - mUI.enablePreviewThumb(false); + mUI.cancelAnimations(); mUI.setSwipingEnabled(false); mActivity.updateStorageSpaceAndHint(); @@ -1502,8 +1488,7 @@ public class VideoModule implements CameraModule, UsageStatistics.ACTION_CAPTURE_START, "Video"); } - private void showCaptureResult() { - mIsInReviewMode = true; + private Bitmap getVideoThumbnail() { Bitmap bitmap = null; if (mVideoFileDescriptor != null) { bitmap = Thumbnail.createVideoThumbnailBitmap(mVideoFileDescriptor.getFileDescriptor(), @@ -1518,9 +1503,16 @@ public class VideoModule implements CameraModule, CameraInfo[] info = CameraHolder.instance().getCameraInfo(); boolean mirror = (info[mCameraId].facing == CameraInfo.CAMERA_FACING_FRONT); bitmap = Util.rotateAndMirror(bitmap, 0, mirror); - mUI.showReviewImage(bitmap); } + return bitmap; + } + private void showCaptureResult() { + mIsInReviewMode = true; + Bitmap bitmap = getVideoThumbnail(); + if (bitmap != null) { + mUI.showReviewImage(bitmap); + } mUI.showReviewControls(); mUI.enableCameraControls(false); mUI.showTimeLapseUI(false); @@ -2086,7 +2078,7 @@ public class VideoModule implements CameraModule, if (mParameters == null) return; if (Util.isVideoSnapshotSupported(mParameters) && !mIsVideoCaptureIntent) { if (enabled) { - // TODO: ((CameraScreenNail) mActivity.mCameraScreenNail).animateCapture(mDisplayRotation); + mUI.animateFlash(); } else { mUI.showPreviewBorder(enabled); } |