diff options
-rw-r--r-- | res/xml/capture_preferences.xml | 7 | ||||
-rw-r--r-- | res/xml/setting_menu_preferences.xml | 10 | ||||
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 23 | ||||
-rw-r--r-- | src/com/android/camera/SettingsManager.java | 1 |
4 files changed, 14 insertions, 27 deletions
diff --git a/res/xml/capture_preferences.xml b/res/xml/capture_preferences.xml index 5ddb60c89..64633c362 100644 --- a/res/xml/capture_preferences.xml +++ b/res/xml/capture_preferences.xml @@ -257,13 +257,6 @@ camera:title="@string/pref_camera_facedetection_title"/> <ListPreference - camera:defaultValue="@string/setting_on_value" - 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 camera:defaultValue="off" camera:key="pref_camera2_trackingfocus_key" camera:entries="@array/pref_camera2_trackingfocus_entries" diff --git a/res/xml/setting_menu_preferences.xml b/res/xml/setting_menu_preferences.xml index 2b4d2bfa4..a0c1ac7dc 100644 --- a/res/xml/setting_menu_preferences.xml +++ b/res/xml/setting_menu_preferences.xml @@ -239,16 +239,6 @@ android:title="@string/pref_video_time_lapse_frame_interval_title" /> <ListPreference - android:defaultValue="@string/pref_camera2_videosnap_default" - android:entries="@array/pref_camera2_videosnap_entries" - android:entryValues="@array/pref_camera2_videosnap_entryvalues" - android:icon="@drawable/auto_snapshot_size" - android:key="pref_camera2_videosnap_key" - android:layout="@layout/preference" - android:summary="%s" - android:title="@string/pref_camera2_videosnap_title" /> - - <ListPreference android:defaultValue="@string/pref_camera_hfr_default" android:entries="@array/pref_camera_hfr_entries" android:entryValues="@array/pref_camera_hfr_entryvalues" diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 1b319ad8f..14705597c 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -2308,15 +2308,16 @@ public class CaptureModule implements CameraModule, PhotoController, } 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(); } } + private boolean is4kSize(Size size) { + return (size.getHeight() >= 2160 || size.getWidth() >= 3840); + } + private void updateMaxVideoDuration() { String minutesStr = mSettingsManager.getValue(SettingsManager.KEY_VIDEO_DURATION); int minutes = Integer.parseInt(minutesStr); @@ -3286,9 +3287,6 @@ public class CaptureModule implements CameraModule, PhotoController, case SettingsManager.KEY_VIDEO_QUALITY: updateVideoSize(); continue; - case SettingsManager.KEY_AUTO_VIDEOSNAP_SIZE: - updateVideoSnapshotSize(); - continue; case SettingsManager.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL: updateTimeLapseSetting(); continue; @@ -3432,6 +3430,13 @@ public class CaptureModule implements CameraModule, PhotoController, 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) { diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java index 61b70483a..b2b2e7cfc 100644 --- a/src/com/android/camera/SettingsManager.java +++ b/src/com/android/camera/SettingsManager.java @@ -113,7 +113,6 @@ public class SettingsManager implements ListMenu.SettingsListener { public static final String KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL = "pref_camera2_video_time_lapse_frame_interval_key"; public static final String KEY_FACE_DETECTION = "pref_camera2_facedetection_key"; - public static final String KEY_AUTO_VIDEOSNAP_SIZE = "pref_camera2_videosnap_key"; public static final String KEY_VIDEO_HIGH_FRAME_RATE = "pref_camera2_hfr_key"; public static final String KEY_SELFIE_FLASH = "pref_selfie_flash_key"; public static final String KEY_SHUTTER_SOUND = "pref_camera2_shutter_sound_key"; |