diff options
author | Chih-Chung Chang <chihchung@google.com> | 2011-11-04 11:59:19 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-04 11:59:19 +0000 |
commit | 3300723ee68dfb28871fcf30864d2f73946ab660 (patch) | |
tree | 578ea8ee0bc5285ae6f0bfcbe8b08d1a84a94b22 /src/com/android/camera/VideoCamera.java | |
parent | c661613fc809c9623327408d052221f81dac0dfd (diff) | |
parent | 93b9c8aca92b2a6a651c562c71b8c414458c1419 (diff) | |
download | LegacyCamera-3300723ee68dfb28871fcf30864d2f73946ab660.zip LegacyCamera-3300723ee68dfb28871fcf30864d2f73946ab660.tar.gz LegacyCamera-3300723ee68dfb28871fcf30864d2f73946ab660.tar.bz2 |
am 93b9c8ac: Merge "5554028: Select video snapshot resolution based on the video recording aspect ratio." into ics-mr0
* commit '93b9c8aca92b2a6a651c562c71b8c414458c1419':
5554028: Select video snapshot resolution based on the video recording aspect ratio.
Diffstat (limited to 'src/com/android/camera/VideoCamera.java')
-rwxr-xr-x | src/com/android/camera/VideoCamera.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 2cc07a5..0b946c4 100755 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1914,15 +1914,18 @@ public class VideoCamera extends ActivityBase } // Set picture size. - String pictureSize = mPreferences.getString( - CameraSettings.KEY_PICTURE_SIZE, null); - if (pictureSize == null) { - CameraSettings.initialCameraPictureSize(this, mParameters); - } else { - List<Size> supported = mParameters.getSupportedPictureSizes(); - CameraSettings.setCameraPictureSize( - pictureSize, supported, mParameters); - } + // The logic here is different from the logic in still-mode camera. + // There we determine the preview size based on the picture size, but + // here we determine the picture size based on the preview size. + List<Size> supported = mParameters.getSupportedPictureSizes(); + Size optimalSize = Util.getOptimalVideoSnapshotPictureSize(supported, + (double) mDesiredPreviewWidth / mDesiredPreviewHeight); + Size original = mParameters.getPictureSize(); + if (!original.equals(optimalSize)) { + mParameters.setPictureSize(optimalSize.width, optimalSize.height); + } + Log.v(TAG, "Video snapshot size is " + optimalSize.width + "x" + + optimalSize.height); // Set JPEG quality. int jpegQuality = CameraProfile.getJpegEncodingQualityParameter(mCameraId, |