From ab2c34fafbe0f529ee90446e28101b7b9e44dc87 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Thu, 16 Aug 2012 14:00:11 +0000 Subject: [PATCH] SDK: - add option to set framerate for VideoRecorderAppState git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9658 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/app/state/VideoRecorderAppState.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/engine/src/desktop/com/jme3/app/state/VideoRecorderAppState.java b/engine/src/desktop/com/jme3/app/state/VideoRecorderAppState.java index 13d518eb8..fe4e74865 100644 --- a/engine/src/desktop/com/jme3/app/state/VideoRecorderAppState.java +++ b/engine/src/desktop/com/jme3/app/state/VideoRecorderAppState.java @@ -50,7 +50,7 @@ public class VideoRecorderAppState extends AbstractAppState { /** * Using this constructor the video files will be written sequentially to the user's home directory with - * a quality of 0.8 + * a quality of 0.8 and a framerate of 30fps. */ public VideoRecorderAppState() { this(null, 0.8f); @@ -64,9 +64,18 @@ public class VideoRecorderAppState extends AbstractAppState { this(null, quality); } + /** + * Using this constructor the video files will be written sequentially to the user's home directory. + * @param quality the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file) + * @param framerate the frame rate of the resulting video, the application will be locked to this framerate + */ + public VideoRecorderAppState(float quality, int framerate) { + this(null, quality, framerate); + } + /** * This constructor allows you to specify the output file of the video. The quality is set - * to 0.8 + * to 0.8 and framerate to 30 fps. * @param file the video file */ public VideoRecorderAppState(File file) { @@ -77,6 +86,7 @@ public class VideoRecorderAppState extends AbstractAppState { * This constructor allows you to specify the output file of the video as well as the quality * @param file the video file * @param quality the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file) + * @param framerate the frame rate of the resulting video, the application will be locked to this framerate */ public VideoRecorderAppState(File file, float quality) { this.file = file; @@ -84,6 +94,18 @@ public class VideoRecorderAppState extends AbstractAppState { Logger.getLogger(this.getClass().getName()).log(Level.INFO, "JME3 VideoRecorder running on {0} CPU's", numCpus); } + /** + * This constructor allows you to specify the output file of the video as well as the quality + * @param file the video file + * @param quality the quality of the jpegs in the video stream (0.0 smallest file - 1.0 largest file) + */ + public VideoRecorderAppState(File file, float quality, int framerate) { + this.file = file; + this.quality = quality; + this.framerate = framerate; + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "JME3 VideoRecorder running on {0} CPU's", numCpus); + } + public File getFile() { return file; }