Esempio n. 1
0
  @Override
  public void _parseDetails(ByteBuffer content) {
    parseVersionAndFlags(content);
    if (getVersion() == 1) {
      creationTime = IsoTypeReader.readUInt64(content);
      modificationTime = IsoTypeReader.readUInt64(content);
      timescale = IsoTypeReader.readUInt32(content);
      duration = IsoTypeReader.readUInt64(content);
    } else {
      creationTime = IsoTypeReader.readUInt32(content);
      modificationTime = IsoTypeReader.readUInt32(content);
      timescale = IsoTypeReader.readUInt32(content);
      duration = IsoTypeReader.readUInt32(content);
    }
    rate = IsoTypeReader.readFixedPoint1616(content);
    volume = IsoTypeReader.readFixedPoint88(content);
    IsoTypeReader.readUInt16(content);
    IsoTypeReader.readUInt32(content);
    IsoTypeReader.readUInt32(content);
    matrix = new long[9];
    for (int i = 0; i < 9; i++) {
      matrix[i] = IsoTypeReader.readUInt32(content);
    }

    previewTime = content.getInt();
    previewDuration = content.getInt();
    posterTime = content.getInt();
    selectionTime = content.getInt();
    selectionDuration = content.getInt();
    currentTime = content.getInt();

    nextTrackId = IsoTypeReader.readUInt32(content);
  }
 @Override
 public void parse(DataSource dataSource, ByteBuffer header, long contentSize, BoxParser boxParser)
     throws IOException {
   ByteBuffer content = ByteBuffer.allocate(l2i(contentSize));
   dataSource.read(content);
   content.position(6);
   dataReferenceIndex = IsoTypeReader.readUInt16(content);
   displayFlags = content.getInt();
   textJustification = content.getInt();
   backgroundR = IsoTypeReader.readUInt16(content);
   backgroundG = IsoTypeReader.readUInt16(content);
   backgroundB = IsoTypeReader.readUInt16(content);
   defaultTextBox = IsoTypeReader.readUInt64(content);
   reserved1 = IsoTypeReader.readUInt64(content);
   fontNumber = content.getShort();
   fontFace = content.getShort();
   reserved2 = content.get();
   reserved3 = content.getShort();
   foregroundR = IsoTypeReader.readUInt16(content);
   foregroundG = IsoTypeReader.readUInt16(content);
   foregroundB = IsoTypeReader.readUInt16(content);
   if (content.remaining() > 0) {
     int length = IsoTypeReader.readUInt8(content);
     byte[] myFontName = new byte[length];
     content.get(myFontName);
     fontName = new String(myFontName);
   } else {
     fontName = null;
   }
   // initContainer(); there are no child boxes!?
 }
  @Override
  public void _parseDetails(ByteBuffer content) {
    parseVersionAndFlags(content);
    int fragmentCount = IsoTypeReader.readUInt8(content);

    for (int i = 0; i < fragmentCount; i++) {
      Entry entry = new Entry();
      if (getVersion() == 0x01) {
        entry.fragmentAbsoluteTime = IsoTypeReader.readUInt64(content);
        entry.fragmentAbsoluteDuration = IsoTypeReader.readUInt64(content);
      } else {
        entry.fragmentAbsoluteTime = IsoTypeReader.readUInt32(content);
        entry.fragmentAbsoluteDuration = IsoTypeReader.readUInt32(content);
      }
      entries.add(entry);
    }
  }