summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-15 05:13:30 +0200
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-17 22:58:04 +0200
commit28c3ed1b3e7770358359fba023848caa4200884b (patch)
tree5b45f16be7407392a1ee1f23417287a48636f6db
parent83b1417a21598337aed8311bdb98d45c2b112aa0 (diff)
downloadandroid_packages_apps_Snap-28c3ed1b3e7770358359fba023848caa4200884b.zip
android_packages_apps_Snap-28c3ed1b3e7770358359fba023848caa4200884b.tar.gz
android_packages_apps_Snap-28c3ed1b3e7770358359fba023848caa4200884b.tar.bz2
Snap: Fix filtering of unsupported HFR/HSR modes
Change-Id: I7721613f10a24cbd36eb0a3c5b0a46a98e828679
-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 3d5f765..949c1a5 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -873,9 +873,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) {
@@ -1246,6 +1246,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>();