summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mca/filterpacks/videosink/java/MediaEncoderFilter.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/mca/filterpacks/videosink/java/MediaEncoderFilter.java b/mca/filterpacks/videosink/java/MediaEncoderFilter.java
index b0dbfd08..3657d8a4 100644
--- a/mca/filterpacks/videosink/java/MediaEncoderFilter.java
+++ b/mca/filterpacks/videosink/java/MediaEncoderFilter.java
@@ -144,11 +144,17 @@ public class MediaEncoderFilter extends Filter {
private Quad mSourceRegion;
/** The maximum filesize (in bytes) of the recording session.
- * By default, it will be 0 and will be passed on to the MediaRecorder
+ * By default, it will be 0 and will be passed on to the MediaRecorder.
* If the limit is zero or negative, MediaRecorder will disable the limit*/
@GenerateFieldPort(name = "maxFileSize", hasDefault = true)
private long mMaxFileSize = 0;
+ /** The maximum duration (in milliseconds) of the recording session.
+ * By default, it will be 0 and will be passed on to the MediaRecorder.
+ * If the limit is zero or negative, MediaRecorder will record indefinitely*/
+ @GenerateFieldPort(name = "maxDurationMs", hasDefault = true)
+ private int mMaxDurationMs = 0;
+
/** TimeLapse Interval between frames.
* By default, it will be 0. Whether the recording is timelapsed
* is inferred based on its value being greater than 0 */
@@ -264,6 +270,7 @@ public class MediaEncoderFilter extends Filter {
Log.w(TAG, "Setting maxFileSize on MediaRecorder unsuccessful! "
+ e.getMessage());
}
+ mMediaRecorder.setMaxDuration(mMaxDurationMs);
}
@Override