summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorPannag Sanketi <psanketi@google.com>2011-10-19 23:03:21 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-19 23:03:21 -0700
commite0b66a87432f452bf4a10ef5e0d835113a8ab69d (patch)
tree1ee6f81ddcdbd0e274d403acf5eda877701131d5 /src/com
parent0c1ec7e8cd43de1a4b4cb650b759dd0cbe123eaa (diff)
parentdb1596dc704d2085a3f2f7b5652e6cb43696c265 (diff)
downloadLegacyCamera-e0b66a87432f452bf4a10ef5e0d835113a8ab69d.zip
LegacyCamera-e0b66a87432f452bf4a10ef5e0d835113a8ab69d.tar.gz
LegacyCamera-e0b66a87432f452bf4a10ef5e0d835113a8ab69d.tar.bz2
Merge "Support for max duration recording with effect" into ics-mr0
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/EffectsRecorder.java19
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java
index 8b63ceb..e4d613a 100644
--- a/src/com/android/camera/EffectsRecorder.java
+++ b/src/com/android/camera/EffectsRecorder.java
@@ -91,6 +91,7 @@ public class EffectsRecorder {
private FileDescriptor mFd;
private int mOrientationHint = 0;
private long mMaxFileSize = 0;
+ private int mMaxDurationMs = 0;
private int mCameraFacing = Camera.CameraInfo.CAMERA_FACING_BACK;
private int mEffect = EFFECT_NONE;
@@ -234,6 +235,23 @@ public class EffectsRecorder {
mMaxFileSize = maxFileSize;
}
+ /**
+ * Sets the maximum recording duration (in ms) for the next recording session
+ * Setting it to zero (the default) disables the limit.
+ */
+ public synchronized void setMaxDuration(int maxDurationMs) {
+ switch (mState) {
+ case STATE_RECORD:
+ throw new RuntimeException("setMaxDuration cannot be called while recording!");
+ case STATE_RELEASED:
+ throw new RuntimeException("setMaxDuration called on an already released recorder!");
+ default:
+ break;
+ }
+ mMaxDurationMs = maxDurationMs;
+ }
+
+
public void setCaptureRate(double fps) {
switch (mState) {
case STATE_RECORD:
@@ -639,6 +657,7 @@ public class EffectsRecorder {
recorder.setInputValue("errorListener", mErrorListener);
}
recorder.setInputValue("maxFileSize", mMaxFileSize);
+ recorder.setInputValue("maxDurationMs", mMaxDurationMs);
recorder.setInputValue("recording", true);
if (mRecordSound != null) mRecordSound.play();
mState = STATE_RECORD;
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index d3109ea..e3de79d 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -1316,6 +1316,7 @@ public class VideoCamera extends ActivityBase
maxFileSize = requestedSizeLimit;
}
mEffectsRecorder.setMaxFileSize(maxFileSize);
+ mEffectsRecorder.setMaxDuration(mMaxVideoDurationInMs);
}