summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilian Peev <epeevs@codeaurora.org>2015-06-03 16:34:59 +0300
committerArne Coucheron <arco68@gmail.com>2018-01-27 00:41:42 +0100
commit2e5481c2b7fd7b9604970b8416b648765a898775 (patch)
tree8ee9001538d8c6125cc806d10c474023a8efc385
parent2351f5b56a3571b0bb9f75dc4b355a86ceef5709 (diff)
downloadandroid_packages_apps_Snap-2e5481c2b7fd7b9604970b8416b648765a898775.zip
android_packages_apps_Snap-2e5481c2b7fd7b9604970b8416b648765a898775.tar.gz
android_packages_apps_Snap-2e5481c2b7fd7b9604970b8416b648765a898775.tar.bz2
Snapdragon Camera: Use consistent API for preview fps reset
Instead of using preview fps range API during preview framerate reset use the fixed fps API. This is to avoid any inconsistent behavior that can be triggered when using both APIs from MediaRecorder and Snapdragon application side. Change-Id: Ib5251d8ea4d697db9bdea4e5ebf20606b286f54f
-rw-r--r--src/com/android/camera/VideoModule.java8
-rw-r--r--src/com/android/camera/util/CameraUtil.java9
2 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 9d335cf..e3f45d9 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2263,11 +2263,9 @@ public class VideoModule implements CameraModule,
startPreview();
} else {
if (is4KEnabled()) {
- int[] fpsRange = CameraUtil.getMaxPreviewFpsRange(mParameters);
- if (fpsRange.length > 0) {
- mParameters.setPreviewFpsRange(
- fpsRange[Parameters.PREVIEW_FPS_MIN_INDEX],
- fpsRange[Parameters.PREVIEW_FPS_MAX_INDEX]);
+ int fps = CameraUtil.getMaxPreviewFps(mParameters);
+ if (fps > 0) {
+ mParameters.setPreviewFrameRate(fps);
} else {
mParameters.setPreviewFrameRate(30);
}
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 8f40c11..8835661 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -1139,6 +1139,15 @@ public class CameraUtil {
return new int[0];
}
+ public static int getMaxPreviewFps(Parameters params) {
+ List<Integer> frameRates = params.getSupportedPreviewFrameRates();
+ if (frameRates != null && frameRates.size() > 0) {
+ // The list is sorted. Return the last element.
+ return frameRates.get(frameRates.size() - 1).intValue();
+ }
+ return -1;
+ }
+
private static class ImageFileNamer {
private final SimpleDateFormat mFormat;