summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-10-03 15:57:29 +0800
committerWu-cheng Li <wuchengli@google.com>2010-10-03 23:25:35 +0800
commitc300a0266d634bb7a1e2df816e97bad2836991ac (patch)
tree678e4ed6d10426db5080ac5c8d68f9727635af74 /src
parentccb9df3be2ded7ee4bbeb54181a787e9001c73ee (diff)
downloadLegacyCamera-c300a0266d634bb7a1e2df816e97bad2836991ac.zip
LegacyCamera-c300a0266d634bb7a1e2df816e97bad2836991ac.tar.gz
LegacyCamera-c300a0266d634bb7a1e2df816e97bad2836991ac.tar.bz2
Pass camera id to CamcorderProfile.hasProfile.
In the future, android.hardware.Camera.Parameters should have a getCameraId. It is easier for apps to know which camera it is now. Change-Id: Iae529c02d89b64a9158a0bdc4b4d0cfd293e7270
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/Camera.java2
-rw-r--r--src/com/android/camera/CameraSettings.java19
-rw-r--r--src/com/android/camera/VideoCamera.java2
3 files changed, 13 insertions, 10 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 7a963b1..2aa2e8e 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -1055,7 +1055,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
private void initializeHeadUpDisplay() {
CameraSettings settings = new CameraSettings(this, mInitialParams,
- CameraHolder.instance().getCameraInfo());
+ mCameraId, CameraHolder.instance().getCameraInfo());
mHeadUpDisplay.initialize(this,
settings.getPreferenceGroup(R.xml.camera_preferences),
getZoomRatios(), mOrientationCompensation);
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index cde3d9d..e187864 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -77,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;
}
@@ -143,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);
@@ -167,7 +169,8 @@ public class CameraSettings {
// Filter out unsupported settings / options
if (videoTimeLapseQuality != null) {
- filterUnsupportedOptions(group, videoTimeLapseQuality, getSupportedTimeLapseProfiles());
+ filterUnsupportedOptions(group, videoTimeLapseQuality,
+ getSupportedTimeLapseProfiles(mCameraId));
}
if (pictureSize != null) {
filterUnsupportedOptions(group, pictureSize, sizeListToStringList(
@@ -198,18 +201,18 @@ 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() {
+ private static List<String> getSupportedTimeLapseProfiles(int cameraId) {
ArrayList<String> supportedProfiles = new ArrayList<String>();
- if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_480P)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_480P)) {
supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_480P));
}
- if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_720P)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_720P)) {
supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_720P));
}
- if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_1080P)) {
+ if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_TIME_LAPSE_1080P)) {
supportedProfiles.add(Integer.toString(CamcorderProfile.QUALITY_TIME_LAPSE_1080P));
}
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index fb71b6a..5c4e621 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -415,7 +415,7 @@ public class VideoCamera extends NoSearchActivity
private void initializeHeadUpDisplay() {
CameraSettings settings = new CameraSettings(this, mParameters,
- CameraHolder.instance().getCameraInfo());
+ mCameraId, CameraHolder.instance().getCameraInfo());
PreferenceGroup group = settings.getPreferenceGroup(R.xml.video_preferences);
if (mIsVideoCaptureIntent) {