summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorPannag Sanketi <psanketi@google.com>2011-10-19 23:06:02 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-19 23:06:02 -0700
commit67668bc2d1433d40437ae8ae320a9533fb47bae9 (patch)
tree8f7137a3fb2f1a6eb73c5906a03e44142c6bb26d /src/com
parent247c37b0b7cd29d58dc96322c993437674636977 (diff)
parente0b66a87432f452bf4a10ef5e0d835113a8ab69d (diff)
downloadpackages_apps_LegacyCamera-67668bc2d1433d40437ae8ae320a9533fb47bae9.zip
packages_apps_LegacyCamera-67668bc2d1433d40437ae8ae320a9533fb47bae9.tar.gz
packages_apps_LegacyCamera-67668bc2d1433d40437ae8ae320a9533fb47bae9.tar.bz2
am e0b66a87: Merge "Support for max duration recording with effect" into ics-mr0
* commit 'e0b66a87432f452bf4a10ef5e0d835113a8ab69d': Support for max duration recording with effect
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 63b5cea..7d96cd3 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -1315,6 +1315,7 @@ public class VideoCamera extends ActivityBase
maxFileSize = requestedSizeLimit;
}
mEffectsRecorder.setMaxFileSize(maxFileSize);
+ mEffectsRecorder.setMaxDuration(mMaxVideoDurationInMs);
}