com.coremedia.iso.IsoTypeWriter Java Examples

The following examples show how to use com.coremedia.iso.IsoTypeWriter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MP4Builder.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #2
Source File: MP4Builder.java    From VideoCompressor with Apache License 2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #3
Source File: MP4Builder.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #4
Source File: MP4Builder.java    From react-native-video-helper with MIT License 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #5
Source File: MP4Builder.java    From VideoCompressor with Apache License 2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #6
Source File: MP4Builder.java    From talk-android with MIT License 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #7
Source File: MP4Builder.java    From SiliCompressor with Apache License 2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #8
Source File: MP4Builder.java    From deltachat-android with GNU General Public License v3.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #9
Source File: MP4Builder.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}
 
Example #10
Source File: MP4Builder.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
public void getBox(WritableByteChannel writableByteChannel) throws IOException {
    ByteBuffer bb = ByteBuffer.allocate(16);
    long size = getSize();
    if (isSmallBox(size)) {
        IsoTypeWriter.writeUInt32(bb, size);
    } else {
        IsoTypeWriter.writeUInt32(bb, 1);
    }
    bb.put(IsoFile.fourCCtoBytes("mdat"));
    if (isSmallBox(size)) {
        bb.put(new byte[8]);
    } else {
        IsoTypeWriter.writeUInt64(bb, size);
    }
    bb.rewind();
    writableByteChannel.write(bb);
}