Esempio n. 1
0
 public String toString() {
   return Platform.stringFromCharset4(
       data,
       0,
       len,
       utf16.contains(type) ? Charset.forName("UTF-16") : Charset.forName("UTF-8"));
 }
Esempio n. 2
0
 public void flattern(MovieBox movie, File video) throws IOException {
   Platform.deleteFile(video);
   SeekableByteChannel out = null;
   try {
     out = writableChannel(video);
     flatternChannel(movie, out);
   } finally {
     if (out != null) out.close();
   }
 }
Esempio n. 3
0
 @Override
 public void parse(ByteBuffer input) {
   byte[] dst = new byte[4];
   input.get(dst);
   this.type = Platform.stringFromBytes(dst);
   primariesIndex = input.getShort();
   transferFunctionIndex = input.getShort();
   matrixIndex = input.getShort();
   if (input.hasRemaining()) {
     colorRange = input.get();
   }
 }
Esempio n. 4
0
 public static void main1(String[] args) throws Exception {
   if (args.length < 2) {
     System.out.println("Syntax: self <ref movie> <out movie>");
     System.exit(-1);
   }
   File outFile = new File(args[1]);
   Platform.deleteFile(outFile);
   SeekableByteChannel input = null;
   try {
     input = readableChannel(new File(args[0]));
     MovieBox movie = MP4Util.parseMovieChannel(input);
     new Flattern().flattern(movie, outFile);
   } finally {
     if (input != null) input.close();
   }
 }