diff options
Diffstat (limited to 'src/com/android/camera/CameraSettings.java')
-rw-r--r-- | src/com/android/camera/CameraSettings.java | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index f4f27e6..62642ef 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -39,6 +39,8 @@ public class CameraSettings { public static final String KEY_LOCAL_VERSION = "pref_local_version_key"; public static final String KEY_RECORD_LOCATION = RecordLocationPreference.KEY; public static final String KEY_VIDEO_QUALITY = "pref_video_quality_key"; + public static final String KEY_VIDEO_TIME_LAPSE_QUALITY = "pref_video_time_lapse_quality_key"; + public static final String KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL = "pref_video_time_lapse_frame_interval_key"; public static final String KEY_PICTURE_SIZE = "pref_camera_picturesize_key"; public static final String KEY_JPEG_QUALITY = "pref_camera_jpegquality_key"; public static final String KEY_FOCUS_MODE = "pref_camera_focusmode_key"; @@ -75,11 +77,13 @@ public class CameraSettings { private final Context mContext; private final Parameters mParameters; private final CameraInfo[] mCameraInfo; + private final int mCameraId; public CameraSettings(Activity activity, Parameters parameters, - CameraInfo[] cameraInfo) { + int cameraId, CameraInfo[] cameraInfo) { mContext = activity; mParameters = parameters; + mCameraId = cameraId; mCameraInfo = cameraInfo; } @@ -133,6 +137,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); @@ -140,7 +145,7 @@ public class CameraSettings { ListPreference flashMode = group.findPreference(KEY_FLASH_MODE); ListPreference focusMode = group.findPreference(KEY_FOCUS_MODE); ListPreference exposure = group.findPreference(KEY_EXPOSURE); - IconListPreference cameraId = + IconListPreference cameraIdPref = (IconListPreference)group.findPreference(KEY_CAMERA_ID); ListPreference videoFlashMode = group.findPreference(KEY_VIDEOCAMERA_FLASH_MODE); @@ -163,6 +168,10 @@ public class CameraSettings { } // Filter out unsupported settings / options + if (videoTimeLapseQuality != null) { + filterUnsupportedOptions(group, videoTimeLapseQuality, + getSupportedTimeLapseProfiles(mCameraId)); + } if (pictureSize != null) { filterUnsupportedOptions(group, pictureSize, sizeListToStringList( mParameters.getSupportedPictureSizes())); @@ -192,7 +201,22 @@ public class CameraSettings { videoFlashMode, mParameters.getSupportedFlashModes()); } if (exposure != null) buildExposureCompensation(group, exposure); - if (cameraId != null) buildCameraId(group, cameraId); + if (cameraIdPref != null) buildCameraId(group, cameraIdPref); + } + + private static List<String> getSupportedTimeLapseProfiles(int cameraId) { + ArrayList<String> supportedProfiles = new ArrayList<String>(); + if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_480P)) { + supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_480P)); + } + if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_720P)) { + supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_720P)); + } + if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_1080P)) { + supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_1080P)); + } + + return supportedProfiles; } private void buildExposureCompensation( |