summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher R. Palmer <crpalmer@gmail.com>2016-01-14 05:17:44 -0500
committerSteve Kondik <steve@cyngn.com>2016-11-02 12:22:29 -0700
commit6d1cb70ef064f0530e31d0641d7b65f7b9ed2b78 (patch)
tree59f589744df635483fe8310d541bd3096b565465
parentc5a2df2a01acaf05a6979a8d5354026c47db49c7 (diff)
downloadandroid_packages_apps_Snap-6d1cb70ef064f0530e31d0641d7b65f7b9ed2b78.tar.gz
android_packages_apps_Snap-6d1cb70ef064f0530e31d0641d7b65f7b9ed2b78.tar.bz2
android_packages_apps_Snap-6d1cb70ef064f0530e31d0641d7b65f7b9ed2b78.zip
Snap: Actually select the highest quality video by default
Prior to this commit Snap assumes that the HAL returns the list of supported video sizes in descending order of quality and simply picks the first one from the list as the default quality. Instead, find the first matching entry of pref_video_quality_entryvalues that the HAL indicated was supported. Change-Id: Ifea79e0e16a9015557539e098317536a32b9ff1f
-rw-r--r--src/com/android/camera/CameraSettings.java9
-rw-r--r--src/com/android/camera/VideoModule.java2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 0d5908a8e..64ab5f7a7 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -426,11 +426,18 @@ public class CameraSettings {
}
public static String getSupportedHighestVideoQuality(
- int cameraId, Parameters parameters) {
+ Context context, int cameraId, Parameters parameters) {
// When launching the camera app first time, we will set the video quality
// to the first one (i.e. highest quality) in the supported list
List<String> supported = getSupportedVideoQualities(cameraId,parameters);
assert (supported != null) : "No supported video quality is found";
+ for (String candidate : context.getResources().getStringArray(
+ R.array.pref_video_quality_entryvalues)) {
+ if (supported.indexOf(candidate) >= 0) {
+ return candidate;
+ }
+ }
+ Log.w(TAG, "No supported video size matches, using the first reported size");
return supported.get(0);
}
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 21dd832b9..e3967459f 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -952,7 +952,7 @@ public class VideoModule implements CameraModule,
} else {
// check for highest quality supported
videoQuality = CameraSettings.getSupportedHighestVideoQuality(
- mCameraId, mParameters);
+ mActivity, mCameraId, mParameters);
}
mPreferences.edit().putString(CameraSettings.KEY_VIDEO_QUALITY, videoQuality).apply();
}