示例#1
0
文件: AliasBox.java 项目: 2php/jcodec
 public String toString() {
   return Platform.stringFromCharset4(
       data,
       0,
       len,
       utf16.contains(type) ? Charset.forName("UTF-16") : Charset.forName("UTF-8"));
 }
示例#2
0
文件: Flattern.java 项目: 2php/jcodec
 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();
   }
 }
示例#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();
   }
 }
示例#4
0
文件: Flattern.java 项目: 2php/jcodec
 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();
   }
 }