summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2016-09-21 08:10:17 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-21 08:10:17 -0700
commit2c1ba8c24595c2f2228ff6ecaefc5320facec39a (patch)
tree376f40e8abf371f3e575b29f747177ccecaf7727 /src/com/android/camera/VideoModule.java
parentf9a23da1598e7cc2165d278bbac11f3c49e41c34 (diff)
parent610e7ac947d7a71e41b4221e4ccb8157e868d982 (diff)
downloadandroid_packages_apps_Snap-2c1ba8c24595c2f2228ff6ecaefc5320facec39a.tar.gz
android_packages_apps_Snap-2c1ba8c24595c2f2228ff6ecaefc5320facec39a.tar.bz2
android_packages_apps_Snap-2c1ba8c24595c2f2228ff6ecaefc5320facec39a.zip
Merge "SnapdragonCamera:Force close when set video high framerate as HSR240" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 92a2e806f..e8ab677bd 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -80,6 +80,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.HashMap;
import java.lang.reflect.Method;
+import java.util.regex.Pattern;
public class VideoModule implements CameraModule,
VideoController,
@@ -2545,10 +2546,9 @@ public class VideoModule implements CameraModule,
mActivity.getString(R.string.pref_video_time_lapse_frame_interval_default));
int timeLapseInterval = Integer.parseInt(frameIntervalStr);
int rate = 0;
- if (!hfr.equals("off"))
- rate = Integer.parseInt(hfr);
- else
- rate = Integer.parseInt(hsr);
+ if ( isDigit(highFrameRate.substring(3)) ) {
+ rate = Integer.parseInt(highFrameRate.substring(3));
+ }
Log.v(TAG, "rate = "+rate);
if ( (timeLapseInterval != 0) ||
(disMode.equals("enable") && (rate > PERSIST_EIS_MAX_FPS)) ||
@@ -2602,6 +2602,12 @@ public class VideoModule implements CameraModule,
}
}
+ private boolean isDigit(String input) {
+ String ruler = "[1-9][0-9]*";
+ Pattern pattern = Pattern.compile(ruler);
+ return pattern.matcher(input).matches();
+ }
+
@SuppressWarnings("deprecation")
private void setCameraParameters(boolean isFlashDelay) {
Log.d(TAG,"Preview dimension in App->"+mDesiredPreviewWidth+"X"+mDesiredPreviewHeight);