summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/CameraSettings.java')
-rw-r--r--src/com/android/camera/CameraSettings.java52
1 files changed, 48 insertions, 4 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 99f866991..68069c009 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -276,19 +276,63 @@ public class CameraSettings {
VIDEO_ENCODER_TABLE.put(MediaRecorder.VideoEncoder.MPEG_4_SP, "m4v");
//video qualities
-// VIDEO_QUALITY_TABLE.put("4096x2160", CamcorderProfile.QUALITY_4kDCI);
+ VIDEO_QUALITY_TABLE.put("4096x2160", CamcorderProfile.QUALITY_4KDCI);
VIDEO_QUALITY_TABLE.put("3840x2160", CamcorderProfile.QUALITY_2160P);
VIDEO_QUALITY_TABLE.put("2560x1440", CamcorderProfile.QUALITY_QHD);
VIDEO_QUALITY_TABLE.put("2048x1080", CamcorderProfile.QUALITY_2k);
VIDEO_QUALITY_TABLE.put("1920x1080", CamcorderProfile.QUALITY_1080P);
VIDEO_QUALITY_TABLE.put("1280x720", CamcorderProfile.QUALITY_720P);
VIDEO_QUALITY_TABLE.put("720x480", CamcorderProfile.QUALITY_480P);
-// VIDEO_QUALITY_TABLE.put("640x480", CamcorderProfile.QUALITY_VGA);
+ VIDEO_QUALITY_TABLE.put("640x480", CamcorderProfile.QUALITY_VGA);
VIDEO_QUALITY_TABLE.put("352x288", CamcorderProfile.QUALITY_CIF);
VIDEO_QUALITY_TABLE.put("320x240", CamcorderProfile.QUALITY_QVGA);
VIDEO_QUALITY_TABLE.put("176x144", CamcorderProfile.QUALITY_QCIF);
}
+ // Following maps help find a corresponding time-lapse or high-speed quality
+ // given a normal quality.
+ // Ideally, one should be able to traverse by offsetting +1000, +2000 respectively,
+ // But the profile values are messed-up in AOSP
+ private static final HashMap<Integer, Integer>
+ VIDEO_QUALITY_TO_TIMELAPSE = new HashMap<Integer, Integer>();
+ static {
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_LOW , CamcorderProfile.QUALITY_TIME_LAPSE_LOW );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_HIGH , CamcorderProfile.QUALITY_TIME_LAPSE_HIGH );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_QCIF , CamcorderProfile.QUALITY_TIME_LAPSE_QCIF );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_CIF , CamcorderProfile.QUALITY_TIME_LAPSE_CIF );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_480P , CamcorderProfile.QUALITY_TIME_LAPSE_480P );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_720P , CamcorderProfile.QUALITY_TIME_LAPSE_720P );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_1080P, CamcorderProfile.QUALITY_TIME_LAPSE_1080P);
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_QVGA , CamcorderProfile.QUALITY_TIME_LAPSE_QVGA );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_2160P, CamcorderProfile.QUALITY_TIME_LAPSE_2160P);
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_VGA , CamcorderProfile.QUALITY_TIME_LAPSE_VGA );
+ VIDEO_QUALITY_TO_TIMELAPSE.put(CamcorderProfile.QUALITY_4KDCI, CamcorderProfile.QUALITY_TIME_LAPSE_4KDCI);
+ }
+
+ public static int getTimeLapseQualityFor(int quality) {
+ return VIDEO_QUALITY_TO_TIMELAPSE.get(quality);
+ }
+
+ private static final HashMap<Integer, Integer>
+ VIDEO_QUALITY_TO_HIGHSPEED = new HashMap<Integer, Integer>();
+ static {
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_LOW , CamcorderProfile.QUALITY_HIGH_SPEED_LOW );
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_HIGH , CamcorderProfile.QUALITY_HIGH_SPEED_HIGH );
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_QCIF , -1 ); // does not exist
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_CIF , CamcorderProfile.QUALITY_HIGH_SPEED_CIF );
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_480P , CamcorderProfile.QUALITY_HIGH_SPEED_480P );
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_720P , CamcorderProfile.QUALITY_HIGH_SPEED_720P );
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_1080P, CamcorderProfile.QUALITY_HIGH_SPEED_1080P);
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_QVGA , -1 ); // does not exist
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_2160P, CamcorderProfile.QUALITY_HIGH_SPEED_2160P);
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_VGA , CamcorderProfile.QUALITY_HIGH_SPEED_VGA );
+ VIDEO_QUALITY_TO_HIGHSPEED.put(CamcorderProfile.QUALITY_4KDCI, CamcorderProfile.QUALITY_HIGH_SPEED_4KDCI);
+ }
+
+ public static int getHighSpeedQualityFor(int quality) {
+ return VIDEO_QUALITY_TO_HIGHSPEED.get(quality);
+ }
+
public CameraSettings(Activity activity, Parameters parameters,
int cameraId, CameraInfo[] cameraInfo) {
mContext = activity;
@@ -1203,9 +1247,9 @@ public class CameraSettings {
private static void getFineResolutionQuality(ArrayList<String> supported,
int cameraId,Parameters parameters) {
/*
- if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_4kDCI)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_4KDCI)) {
if (checkSupportedVideoQuality(parameters,4096,2160)) {
- supported.add(Integer.toString(CamcorderProfile.QUALITY_4kDCI));
+ supported.add(Integer.toString(CamcorderProfile.QUALITY_4KDCI));
}
}
*/