diff options
author | jinwu <jinwu@codeaurora.org> | 2018-07-18 10:33:20 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-07-17 19:43:41 -0700 |
commit | e453ddc6aee7c4d686acc8fabc60960c16fa66c5 (patch) | |
tree | 6979d1684d06f2887ebb9ae0248366f79d6237e0 /src | |
parent | 9d930f1d75e2866abd3f1571ac9c4862efab3bcd (diff) | |
download | android_packages_apps_Snap-e453ddc6aee7c4d686acc8fabc60960c16fa66c5.tar.gz android_packages_apps_Snap-e453ddc6aee7c4d686acc8fabc60960c16fa66c5.tar.bz2 android_packages_apps_Snap-e453ddc6aee7c4d686acc8fabc60960c16fa66c5.zip |
Add a property to set video snapshot size
Set this property persist.sys.camera.video.snapshotsize to change
to change video snapshot size.
Change-Id: I7184037b74a1d974f959a933eea4fe41aa19f454
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index e2d72c0ed..76a524239 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -75,6 +75,7 @@ import android.os.Looper; import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.SystemClock; +import android.os.SystemProperties; import android.provider.MediaStore; import android.util.Log; import android.util.Range; @@ -3794,18 +3795,30 @@ public class CaptureModule implements CameraModule, PhotoController, if (isVideoSize1080P(mVideoSnapshotSize)) { updateHFRSetting(); mHighSpeedFPSRange = new Range(mHighSpeedCaptureRate, mHighSpeedCaptureRate); + Log.d(TAG,"updateVideoSnapshotSize " + mHighSpeedCaptureRate); boolean is60FPS = ((int)mHighSpeedFPSRange.getUpper() == 60); // if video is 1080p encode except 60fps, VideoSnapShotSize set 16M(5312x2988) if (!is60FPS) { mVideoSnapshotSize = new Size(5312, 2988); } } + String videoSnapshot = getVideoSnapshotSize(); + String[] sourceStrArray = videoSnapshot.split("x"); + if (sourceStrArray != null && sourceStrArray.length >= 2) { + int width = Integer.parseInt(sourceStrArray[0]); + int height = Integer.parseInt(sourceStrArray[1]); + mVideoSnapshotSize = new Size(width, height); + } Log.d(TAG, "updateVideoSnapshotSize final video snapShot size = " + mVideoSnapshotSize.getWidth() + ", " + mVideoSnapshotSize.getHeight()); Size[] thumbSizes = mSettingsManager.getSupportedThumbnailSizes(getMainCameraId()); mVideoSnapshotThumbSize = getOptimalPreviewSize(mVideoSnapshotSize, thumbSizes); // get largest thumb size } + private String getVideoSnapshotSize(){ + return SystemProperties.get("persist.sys.camera.video.snapshotsize", ""); + } + private boolean isVideoSize1080P(Size size) { return (size.getHeight() == 1080 && size.getWidth() == 1920); } |