diff options
author | Doris Liu <tianliu@google.com> | 2013-08-13 15:01:52 -0700 |
---|---|---|
committer | Doris Liu <tianliu@google.com> | 2013-08-13 15:01:52 -0700 |
commit | 386057407167d69636d441a287e8ebef9708c533 (patch) | |
tree | 6cf64db12c987d63848f908119538d999bb99473 | |
parent | 57549631449fab8cd4d8dffe730bee4d5c4d8890 (diff) | |
download | android_packages_apps_Snap-386057407167d69636d441a287e8ebef9708c533.tar.gz android_packages_apps_Snap-386057407167d69636d441a287e8ebef9708c533.tar.bz2 android_packages_apps_Snap-386057407167d69636d441a287e8ebef9708c533.zip |
Check for device support before taking video snapshots
Bug: 9496097
Change-Id: I6f5d0489848b583fac3b1fd3b605351002be08ba
-rw-r--r-- | src/com/android/camera/VideoModule.java | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index b28b66ffd..29fa79879 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -421,25 +421,32 @@ public class VideoModule implements CameraModule, return; } - MediaSaveService s = mActivity.getMediaSaveService(); - if (mPaused || mSnapshotInProgress || effectsActive() || s == null || s.isQueueFull()) { - return; - } + takeASnapshot(); + } - // Set rotation and gps data. - int rotation = CameraUtil.getJpegRotation(mCameraId, mOrientation); - mParameters.setRotation(rotation); - Location loc = mLocationManager.getCurrentLocation(); - CameraUtil.setGpsParameters(mParameters, loc); - mCameraDevice.setParameters(mParameters); + private void takeASnapshot() { + // only take snapshots if video snapshot is supported by device + if (CameraUtil.isVideoSnapshotSupported(mParameters) && !mIsVideoCaptureIntent) { + MediaSaveService s = mActivity.getMediaSaveService(); + if (mPaused || mSnapshotInProgress || effectsActive() || s == null || s.isQueueFull()) { + return; + } - Log.v(TAG, "Video snapshot start"); - mCameraDevice.takePicture(mHandler, - null, null, null, new JpegPictureCallback(loc)); - showVideoSnapshotUI(true); - mSnapshotInProgress = true; - UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA, - UsageStatistics.ACTION_CAPTURE_DONE, "VideoSnapshot"); + // Set rotation and gps data. + int rotation = CameraUtil.getJpegRotation(mCameraId, mOrientation); + mParameters.setRotation(rotation); + Location loc = mLocationManager.getCurrentLocation(); + CameraUtil.setGpsParameters(mParameters, loc); + mCameraDevice.setParameters(mParameters); + + Log.v(TAG, "Video snapshot start"); + mCameraDevice.takePicture(mHandler, + null, null, null, new JpegPictureCallback(loc)); + showVideoSnapshotUI(true); + mSnapshotInProgress = true; + UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA, + UsageStatistics.ACTION_CAPTURE_DONE, "VideoSnapshot"); + } } @Override |