diff options
author | Pannag Sanketi <psanketi@google.com> | 2011-10-19 20:06:13 -0700 |
---|---|---|
committer | Pannag Sanketi <psanketi@google.com> | 2011-10-19 20:06:13 -0700 |
commit | db1596dc704d2085a3f2f7b5652e6cb43696c265 (patch) | |
tree | 4b3448808a8ba429ab60490be7e37a87f2243cf7 /src/com | |
parent | 53d86908dc3e1cb54add568aa6bc325485e3efe5 (diff) | |
download | packages_apps_LegacyCamera-db1596dc704d2085a3f2f7b5652e6cb43696c265.zip packages_apps_LegacyCamera-db1596dc704d2085a3f2f7b5652e6cb43696c265.tar.gz packages_apps_LegacyCamera-db1596dc704d2085a3f2f7b5652e6cb43696c265.tar.bz2 |
Support for max duration recording with effect
Related to Bug: 5472397
Change-Id: I3634b1c9248da24eb82ff825fe52f4262e59d0e7
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/EffectsRecorder.java | 19 | ||||
-rwxr-xr-x | src/com/android/camera/VideoCamera.java | 1 |
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 fa3a9d6..9acadcf 100755 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1322,6 +1322,7 @@ public class VideoCamera extends ActivityBase maxFileSize = requestedSizeLimit; } mEffectsRecorder.setMaxFileSize(maxFileSize); + mEffectsRecorder.setMaxDuration(mMaxVideoDurationInMs); } |