diff options
-rw-r--r-- | res/xml/capture_preferences.xml | 11 | ||||
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 20 |
2 files changed, 16 insertions, 15 deletions
diff --git a/res/xml/capture_preferences.xml b/res/xml/capture_preferences.xml index cd8443331..58a616026 100644 --- a/res/xml/capture_preferences.xml +++ b/res/xml/capture_preferences.xml @@ -264,19 +264,12 @@ camera:singleIcon="@drawable/ic_settings_facerec" camera:title="@string/pref_camera_facedetection_title"/> - <ListPreference - camera:defaultValue="@string/pref_camera2_videosnap_default" - camera:entries="@array/pref_camera2_videosnap_entries" - camera:entryValues="@array/pref_camera2_videosnap_entryvalues" - camera:key="pref_camera2_videosnap_key" - camera:title="@string/pref_camera2_videosnap_title" /> - - <ListPreference + <IconListPreference camera:defaultValue="off" camera:key="pref_camera2_trackingfocus_key" camera:entries="@array/pref_camera2_trackingfocus_entries" camera:entryValues="@array/pref_camera2_trackingfocus_entryvalues" - camera:title="@string/pref_camera2_trackingfocus_title"/> + camera:title="@string/pref_camera2_trackingfocus_title" /> <IconListPreference camera:defaultValue="@string/pref_camera_hfr_default" diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index b6968f6f9..6505a4a5c 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -2322,17 +2322,18 @@ public class CaptureModule extends BaseModule<CaptureUI> implements PhotoControl } private void updateVideoSnapshotSize() { - String auto = mSettingsManager.getValue(SettingsManager.KEY_AUTO_VIDEOSNAP_SIZE); - if (auto != null && auto.equals("enable")) { - Size[] sizes = mSettingsManager.getSupportedOutputSize(getMainCameraId(), ImageFormat.JPEG); - mVideoSnapshotSize = getMaxSizeWithRatio(sizes, mVideoSize); - } else { - mVideoSnapshotSize = mPictureSize; + mVideoSnapshotSize = mPictureSize; + if (is4kSize(mVideoSize) && is4kSize(mVideoSnapshotSize)) { + mVideoSnapshotSize = getMaxPictureSizeLessThan4k(); } Size[] thumbSizes = mSettingsManager.getSupportedThumbnailSizes(getMainCameraId()); mVideoSnapshotThumbSize = getOptimalPreviewSize(mVideoSnapshotSize, thumbSizes, 0, 0); // get largest thumb size } + private boolean is4kSize(Size size) { + return (size.getHeight() >= 2160 || size.getWidth() >= 3840); + } + private void updateMaxVideoDuration() { String minutesStr = mSettingsManager.getValue(SettingsManager.KEY_VIDEO_DURATION); if (minutesStr == null) { @@ -3404,6 +3405,13 @@ public class CaptureModule extends BaseModule<CaptureUI> implements PhotoControl return optimal; } + private Size getMaxPictureSizeLessThan4k() { + Size[] sizes = mSettingsManager.getSupportedOutputSize(getMainCameraId(), ImageFormat.JPEG); + for (Size size : sizes) { + if (!is4kSize(size)) return size; + } + return sizes[sizes.length - 1]; + } private Size getMaxSizeWithRatio(Size[] sizes, Size reference) { float ratio = (float) reference.getWidth() / reference.getHeight(); for (Size size : sizes) { |