Methods Summary |
---|
public void | _parseDetails(java.nio.ByteBuffer content)
parseVersionAndFlags(content);
trackId = IsoTypeReader.readUInt32(content);
long temp = IsoTypeReader.readUInt32(content);
reserved = (int) (temp >> 6);
lengthSizeOfTrafNum = ((int) (temp & 0x3F) >> 4) + 1;
lengthSizeOfTrunNum = ((int) (temp & 0xC) >> 2) + 1;
lengthSizeOfSampleNum = ((int) (temp & 0x3)) + 1;
long numberOfEntries = IsoTypeReader.readUInt32(content);
entries = new ArrayList<Entry>();
for (int i = 0; i < numberOfEntries; i++) {
Entry entry = new Entry();
if (getVersion() == 1) {
entry.time = IsoTypeReader.readUInt64(content);
entry.moofOffset = IsoTypeReader.readUInt64(content);
} else {
entry.time = IsoTypeReader.readUInt32(content);
entry.moofOffset = IsoTypeReader.readUInt32(content);
}
entry.trafNumber = IsoTypeReaderVariable.read(content, lengthSizeOfTrafNum);
entry.trunNumber = IsoTypeReaderVariable.read(content, lengthSizeOfTrunNum);
entry.sampleNumber = IsoTypeReaderVariable.read(content, lengthSizeOfSampleNum);
entries.add(entry);
}
|
protected void | getContent(java.nio.ByteBuffer byteBuffer)
writeVersionAndFlags(byteBuffer);
IsoTypeWriter.writeUInt32(byteBuffer, trackId);
long temp;
temp = reserved << 6;
temp = temp | (((lengthSizeOfTrafNum - 1) & 0x3) << 4);
temp = temp | (((lengthSizeOfTrunNum - 1) & 0x3) << 2);
temp = temp | ((lengthSizeOfSampleNum - 1) & 0x3);
IsoTypeWriter.writeUInt32(byteBuffer, temp);
IsoTypeWriter.writeUInt32(byteBuffer, entries.size());
for (Entry entry : entries) {
if (getVersion() == 1) {
IsoTypeWriter.writeUInt64(byteBuffer, entry.time);
IsoTypeWriter.writeUInt64(byteBuffer, entry.moofOffset);
} else {
IsoTypeWriter.writeUInt32(byteBuffer, entry.time);
IsoTypeWriter.writeUInt32(byteBuffer, entry.moofOffset);
}
IsoTypeWriterVariable.write(entry.trafNumber, byteBuffer, lengthSizeOfTrafNum);
IsoTypeWriterVariable.write(entry.trunNumber, byteBuffer, lengthSizeOfTrunNum);
IsoTypeWriterVariable.write(entry.sampleNumber, byteBuffer, lengthSizeOfSampleNum);
}
|
protected long | getContentSize()
long contentSize = 4;
contentSize += 4 + 4 /*26 + 2 + 2 + 2 */ + 4;
if (getVersion() == 1) {
contentSize += (8 + 8) * entries.size();
} else {
contentSize += (4 + 4) * entries.size();
}
contentSize += lengthSizeOfTrafNum * entries.size();
contentSize += lengthSizeOfTrunNum * entries.size();
contentSize += lengthSizeOfSampleNum * entries.size();
return contentSize;
|
public java.util.List | getEntries()
return Collections.unmodifiableList(entries);
|
public int | getLengthSizeOfSampleNum()
return lengthSizeOfSampleNum;
|
public int | getLengthSizeOfTrafNum()
return lengthSizeOfTrafNum;
|
public int | getLengthSizeOfTrunNum()
return lengthSizeOfTrunNum;
|
public long | getNumberOfEntries()
return entries.size();
|
public int | getReserved()
return reserved;
|
public long | getTrackId()
return trackId;
|
public void | setEntries(java.util.List entries)
this.entries = entries;
|
public void | setLengthSizeOfSampleNum(int lengthSizeOfSampleNum)
this.lengthSizeOfSampleNum = lengthSizeOfSampleNum;
|
public void | setLengthSizeOfTrafNum(int lengthSizeOfTrafNum)
this.lengthSizeOfTrafNum = lengthSizeOfTrafNum;
|
public void | setLengthSizeOfTrunNum(int lengthSizeOfTrunNum)
this.lengthSizeOfTrunNum = lengthSizeOfTrunNum;
|
public void | setTrackId(long trackId)
this.trackId = trackId;
|
public java.lang.String | toString()
return "TrackFragmentRandomAccessBox{" +
"trackId=" + trackId +
", entries=" + entries +
'}";
|