summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-15 05:13:30 +0200
committerZhao Wei Liew <zhaoweiliew@gmail.com>2017-02-11 01:45:42 +0000
commit3ff33285506a7c95f39f48f9284c786380a524bc (patch)
tree4bc026a07c1d6a6d78b985d89c6fb682ac5e93ee
parent7cd1d08c2dfd1b7e644793feb3b666acaae30aca (diff)
downloadandroid_packages_apps_Snap-3ff33285506a7c95f39f48f9284c786380a524bc.zip
android_packages_apps_Snap-3ff33285506a7c95f39f48f9284c786380a524bc.tar.gz
android_packages_apps_Snap-3ff33285506a7c95f39f48f9284c786380a524bc.tar.bz2
Snap: Fix filtering of unsupported HFR/HSR modes
Change-Id: I7721613f10a24cbd36eb0a3c5b0a46a98e828679 (cherry picked from commit 678971d123ba3255e47f6f5a7911fef6d69e3821)
-rw-r--r--src/com/android/camera/CameraSettings.java28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index b9ff5fd..c822744 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -1011,9 +1011,9 @@ public class CameraSettings {
getSupportedSeeMoreModes(mParameters));
}
- if ((videoHfrMode != null) &&
- (mParameters.getSupportedHfrSizes() == null)) {
- filterUnsupportedOptions(group, videoHfrMode, null);
+ if (videoHfrMode != null) {
+ filterUnsupportedOptions(group, videoHfrMode, getSupportedHighFrameRateModes(
+ mParameters));
}
if (videoQuality != null) {
@@ -1411,6 +1411,28 @@ public class CameraSettings {
writePreferredCameraId(preferences, currentCameraId);
}
+ public static List<String> getSupportedHighFrameRateModes(Parameters params) {
+ ArrayList<String> supported = new ArrayList<String>();
+ List<String> supportedModes = params.getSupportedVideoHighFrameRateModes();
+ String hsr = params.get(KEY_VIDEO_HSR);
+
+ if (supportedModes == null) {
+ return null;
+ }
+
+ for (String highFrameRateMode : supportedModes) {
+ if (highFrameRateMode.equals("off")) {
+ supported.add(highFrameRateMode);
+ } else {
+ supported.add("hfr" + highFrameRateMode);
+ if (hsr != null) {
+ supported.add("hsr" + highFrameRateMode);
+ }
+ }
+ }
+ return supported;
+ }
+
public static ArrayList<String> getSupportedVideoQualities(int cameraId,
Parameters parameters) {
ArrayList<String> supported = new ArrayList<String>();