Ver Fonte

SDK:
- add option to set framerate for VideoRecorderAppState

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9658 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

nor..67 há 13 anos atrás
pai
commit
ab2c34fafb

+ 24 - 2
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;
     }