[xiph-commits] r17145 - trunk/rhea/src/com/meviatronic/zeus/pollux

maikmerten at svn.xiph.org maikmerten at svn.xiph.org
Wed Apr 14 07:10:47 PDT 2010


Author: maikmerten
Date: 2010-04-14 07:10:47 -0700 (Wed, 14 Apr 2010)
New Revision: 17145

Modified:
   trunk/rhea/src/com/meviatronic/zeus/pollux/DumpVideo.java
Log:
timing mode (no output) for DumpVideo.java

Modified: trunk/rhea/src/com/meviatronic/zeus/pollux/DumpVideo.java
===================================================================
--- trunk/rhea/src/com/meviatronic/zeus/pollux/DumpVideo.java	2010-04-12 19:45:06 UTC (rev 17144)
+++ trunk/rhea/src/com/meviatronic/zeus/pollux/DumpVideo.java	2010-04-14 14:10:47 UTC (rev 17145)
@@ -25,6 +25,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedList;
@@ -208,6 +209,8 @@
     public void dumpVideo(File videofile, List outfiles, boolean raw) throws IOException {
         InputStream is = new FileInputStream(videofile);
 
+        boolean onlytime = outfiles.size() == 0;
+
         SyncState oy = new SyncState();
         Page og = new Page();
         Packet op = new Packet();
@@ -258,7 +261,7 @@
                     if (theoradec != null) {
                         theoradec.takePacket(op);
 
-                        if (theoradec.ycbcrdata != null) {
+                        if (!onlytime && theoradec.ycbcrdata != null) {
                             YUVWriter yuvwriter = (YUVWriter) yuvwriters.get(serialno);
                             if (yuvwriter == null && !outfiles.isEmpty()) {
                                 yuvwriter = new YUVWriter((File) outfiles.get(0), raw);
@@ -280,11 +283,9 @@
 
     public static void main(String[] args) throws Exception {
 
-        if (args.length < 2) {
-            System.err.println("usage: DumpVideo <videofile> <outfile_1> ... <outfile_n> [--raw>]");
+        if (args.length < 1) {
+            System.err.println("usage: DumpVideo <videofile> [<outfile_1> ... <outfile_n>] [--raw>]");
             System.exit(1);
-
-
         }
 
         boolean raw = false;
@@ -301,10 +302,18 @@
             outfiles.add(new File(args[i]));
         }
 
+        if(outfiles.size() == 0) {
+            System.out.println("no output files given, will only time decode");
+        }
+
         DumpVideo dv = new DumpVideo();
 
+        Date start = new Date();
         dv.dumpVideo(infile, outfiles, raw);
+        Date end = new Date();
 
+        System.out.println("time: " + (end.getTime() - start.getTime()) + " milliseconds");
+
     }
 }
 



More information about the commits mailing list