diff options
author | Nipun Kwatra <nkwatra@google.com> | 2010-09-12 00:25:48 -0700 |
---|---|---|
committer | Nipun Kwatra <nkwatra@google.com> | 2010-09-13 15:23:56 -0700 |
commit | 035376721081f70aaf41d3da31aa50b479624ef0 (patch) | |
tree | 8cee2fc55009c9876352c9fe08c9693a708cd23c /src/com/android/camera/CameraSettings.java | |
parent | 430d55def5d87aa9f35d135eac319eb905912693 (diff) | |
download | LegacyCamera-035376721081f70aaf41d3da31aa50b479624ef0.tar.gz LegacyCamera-035376721081f70aaf41d3da31aa50b479624ef0.tar.bz2 LegacyCamera-035376721081f70aaf41d3da31aa50b479624ef0.zip |
Filter out unsupported time lapse resolutions.
- Filtering out unsupported resolutions.
- Added getSupportedTimeLapseProfiles() to find the list of supported
time lapse profiles.
- added CamcorderProfile quality level values to the
pref_video_time_lapse_quality_entryvalues in arrays.xml
- removed getVideoTimeLapseQuality as can use the quality values directly.
- Use the newly added time lapse profiles for setting resolution values.
Change-Id: I0776a38e0a9bd19fff772878869e1c0504aadc8d
Diffstat (limited to 'src/com/android/camera/CameraSettings.java')
-rw-r--r-- | src/com/android/camera/CameraSettings.java | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index 6e0c7e14..34c38a52 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -55,16 +55,6 @@ public class CameraSettings { private static final String VIDEO_QUALITY_MMS = "mms"; private static final String VIDEO_QUALITY_YOUTUBE = "youtube"; - private static final String VIDEO_TIME_LAPSE_QUALITY_LOW= "low"; - private static final String VIDEO_TIME_LAPSE_QUALITY_HIGH= "high"; - private static final String VIDEO_TIME_LAPSE_QUALITY_720P = "720p"; - private static final String VIDEO_TIME_LAPSE_QUALITY_1080P = "1080p"; - - public static final int TIME_LAPSE_VIDEO_QUALITY_LOW = 1; - public static final int TIME_LAPSE_VIDEO_QUALITY_HIGH = 2; - public static final int TIME_LAPSE_VIDEO_QUALITY_720P = 3; - public static final int TIME_LAPSE_VIDEO_QUALITY_1080P = 4; - public static final String EXPOSURE_DEFAULT_VALUE = "0"; public static final int CURRENT_VERSION = 4; @@ -145,6 +135,7 @@ public class CameraSettings { private void initPreference(PreferenceGroup group) { ListPreference videoQuality = group.findPreference(KEY_VIDEO_QUALITY); + ListPreference videoTimeLapseQuality = group.findPreference(KEY_VIDEO_TIME_LAPSE_QUALITY); ListPreference pictureSize = group.findPreference(KEY_PICTURE_SIZE); ListPreference whiteBalance = group.findPreference(KEY_WHITE_BALANCE); ListPreference colorEffect = group.findPreference(KEY_COLOR_EFFECT); @@ -175,6 +166,9 @@ public class CameraSettings { } // Filter out unsupported settings / options + if (videoTimeLapseQuality != null) { + filterUnsupportedOptions(group, videoTimeLapseQuality, getSupportedTimeLapseProfiles()); + } if (pictureSize != null) { filterUnsupportedOptions(group, pictureSize, sizeListToStringList( mParameters.getSupportedPictureSizes())); @@ -207,6 +201,21 @@ public class CameraSettings { if (cameraId != null) buildCameraId(group, cameraId); } + private static List<String> getSupportedTimeLapseProfiles() { + ArrayList<String> supportedProfiles = new ArrayList<String>(); + if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_480P)) { + supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_480P)); + } + if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_720P)) { + supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_720P)); + } + if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_1080P)) { + supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_1080P)); + } + + return supportedProfiles; + } + private void buildExposureCompensation( PreferenceGroup group, ListPreference exposure) { int max = mParameters.getMaxExposureCompensation(); @@ -378,20 +387,6 @@ public class CameraSettings { quality) || VIDEO_QUALITY_HIGH.equals(quality); } - public static int getVideoTimeLapseQuality(String quality) { - if (VIDEO_TIME_LAPSE_QUALITY_LOW.equals(quality)) { - return TIME_LAPSE_VIDEO_QUALITY_LOW; - } else if (VIDEO_TIME_LAPSE_QUALITY_HIGH.equals(quality)) { - return TIME_LAPSE_VIDEO_QUALITY_HIGH; - } else if (VIDEO_TIME_LAPSE_QUALITY_720P.equals(quality)) { - return TIME_LAPSE_VIDEO_QUALITY_720P; - } else if (VIDEO_TIME_LAPSE_QUALITY_1080P.equals(quality)) { - return TIME_LAPSE_VIDEO_QUALITY_1080P; - } else { - throw new IllegalArgumentException("Unknown quality" + quality); - } - } - public static int getVidoeDurationInMillis(String quality) { if (VIDEO_QUALITY_MMS.equals(quality)) { return MMS_VIDEO_DURATION * 1000; |