[xiph-commits] r9780 - experimental/derf/theora-exp/examples

j at svn.xiph.org j at svn.xiph.org
Sat Aug 20 01:36:21 PDT 2005


Author: j
Date: 2005-08-20 01:36:20 -0700 (Sat, 20 Aug 2005)
New Revision: 9780

Modified:
   experimental/derf/theora-exp/examples/dump_video.c
Log:
bring dump_video cmdline and output in line with trunk

Modified: experimental/derf/theora-exp/examples/dump_video.c
===================================================================
--- experimental/derf/theora-exp/examples/dump_video.c	2005-08-20 04:28:45 UTC (rev 9779)
+++ experimental/derf/theora-exp/examples/dump_video.c	2005-08-20 08:36:20 UTC (rev 9780)
@@ -42,9 +42,10 @@
 
 
 
-const char *optstring = "o:";
+const char *optstring = "or:";
 struct option options [] = {
   {"output",required_argument,NULL,'o'},
+  {"raw",required_argument, NULL, 'r'}, /*  Disable YUV4MPEG2 headers if set */
   {NULL,0,NULL,0}
 };
 
@@ -76,6 +77,7 @@
 int          videobuf_ready=0;
 ogg_int64_t  videobuf_granulepos=-1;
 double       videobuf_time=0;
+int          raw=0;
 
 FILE* outfile = NULL;
 
@@ -138,6 +140,8 @@
   /*Uncomment the following to do normal, non-striped decoding.
   theora_ycbcr_buffer ycbcr;
   theora_decode_ycbcr_out(td,ycbcr);*/
+  if(!raw)
+    fprintf(outfile, "FRAME\n");
 
   for(pli=0;pli<3;pli++){
     for(i=0;i<ycbcr[pli].height;i++){
@@ -192,7 +196,14 @@
         exit(1);
       }
       break;
-
+      
+      case 'r':
+      if(sscanf(optarg, "%u", &raw) != 1) {
+          fprintf(stderr, "Invalid option, assuming YUV4MPEG4 output\n");
+          raw = 0;
+      }
+      break;
+      
       default:
         usage();
     }
@@ -311,6 +322,11 @@
   /* open video */
   if(theora_p)open_video();
 
+ if(!raw)
+     fprintf(outfile, "YUV4MPEG2 W%d H%d F%d:%d I%c A%d:%d\n",
+           ti.pic_width, ti.pic_height, ti.fps_numerator, ti.fps_denominator, 'p', 
+           ti.aspect_numerator, ti.aspect_denominator);
+
   /* install signal handler */
   signal (SIGINT, sigint_handler);
 



More information about the commits mailing list