本文整理匯總了Java中org.mp4parser.tools.IsoTypeReader.read4cc方法的典型用法代碼示例。如果您正苦於以下問題:Java IsoTypeReader.read4cc方法的具體用法?Java IsoTypeReader.read4cc怎麽用?Java IsoTypeReader.read4cc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.mp4parser.tools.IsoTypeReader
的用法示例。
在下文中一共展示了IsoTypeReader.read4cc方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
if ((getFlags() & 1) == 1) {
auxInfoType = IsoTypeReader.read4cc(content);
auxInfoTypeParameter = IsoTypeReader.read4cc(content);
}
int entryCount = CastUtils.l2i(IsoTypeReader.readUInt32(content));
offsets = new long[entryCount];
for (int i = 0; i < entryCount; i++) {
if (getVersion() == 0) {
offsets[i] = IsoTypeReader.readUInt32(content);
} else {
offsets[i] = IsoTypeReader.readUInt64(content);
}
}
}
示例2: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
if ((getFlags() & 1) == 1) {
auxInfoType = IsoTypeReader.read4cc(content);
auxInfoTypeParameter = IsoTypeReader.read4cc(content);
}
defaultSampleInfoSize = (short) IsoTypeReader.readUInt8(content);
sampleCount = CastUtils.l2i(IsoTypeReader.readUInt32(content));
if (defaultSampleInfoSize == 0) {
sampleInfoSizes = new short[sampleCount];
for (int i = 0; i < sampleCount; i++) {
sampleInfoSizes[i] = (short) IsoTypeReader.readUInt8(content);
}
}
}
示例3: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
shouldBeZeroButAppleWritesHereSomeValue = IsoTypeReader.readUInt32(content);
handlerType = IsoTypeReader.read4cc(content);
a = IsoTypeReader.readUInt32(content);
b = IsoTypeReader.readUInt32(content);
c = IsoTypeReader.readUInt32(content);
if (content.remaining() > 0) {
name = IsoTypeReader.readString(content, content.remaining());
if (name.endsWith("\0")) {
name = name.substring(0, name.length() - 1);
zeroTerm = true;
} else {
zeroTerm = false;
}
} else {
zeroTerm = false; //No string at all, not even zero term char
}
}
示例4: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
protected void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
groupingType = IsoTypeReader.read4cc(content);
if (this.getVersion() == 1) {
defaultLength = CastUtils.l2i(IsoTypeReader.readUInt32(content));
}
long entryCount = IsoTypeReader.readUInt32(content);
while (entryCount-- > 0) {
int length = defaultLength;
if (this.getVersion() == 1) {
if (defaultLength == 0) {
length = CastUtils.l2i(IsoTypeReader.readUInt32(content));
}
} else {
length = content.limit() - content.position();
}
ByteBuffer parseMe = content.slice();
parseMe.limit(length);
groupEntries.add(parseGroupEntry(parseMe, groupingType));
int parsedBytes = this.getVersion() == 1 ? length : parseMe.position();
content.position(content.position() + parsedBytes);
}
}
示例5: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
majorBrand = IsoTypeReader.read4cc(content);
minorVersion = IsoTypeReader.readUInt32(content);
int compatibleBrandsCount = content.remaining() / 4;
compatibleBrands = new LinkedList<String>();
for (int i = 0; i < compatibleBrandsCount; i++) {
compatibleBrands.add(IsoTypeReader.read4cc(content));
}
}
示例6: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
schemeType = IsoTypeReader.read4cc(content);
schemeVersion = IsoTypeReader.readUInt32(content);
if ((getFlags() & 1) == 1) {
schemeUri = IsoTypeReader.readString(content);
}
}
示例7: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
ratingEntity = IsoTypeReader.read4cc(content);
ratingCriteria = IsoTypeReader.read4cc(content);
language = IsoTypeReader.readIso639(content);
ratingInfo = IsoTypeReader.readString(content);
}
示例8: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
dataReferenceType = IsoTypeReader.read4cc(content);
dataReferenceSize = CastUtils.l2i(IsoTypeReader.readUInt32(content));
dataReference = IsoTypeReader.readString(content, dataReferenceSize);
}
示例9: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
protected void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
groupingType = IsoTypeReader.read4cc(content);
if (this.getVersion() == 1) {
groupingTypeParameter = IsoTypeReader.read4cc(content);
}
long entryCount = IsoTypeReader.readUInt32(content);
while (entryCount-- > 0) {
entries.add(new Entry(CastUtils.l2i(IsoTypeReader.readUInt32(content)), CastUtils.l2i(IsoTypeReader.readUInt32(content))));
}
}
示例10: parseBox
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
/**
* Parses the next size and type, creates a box instance and parses the box's content.
*
* @param byteChannel the DataSource pointing to the ISO file
* @param parentType the current box's parent's type (null if no parent)
* @return the box just parsed
* @throws java.io.IOException if reading from <code>in</code> fails
*/
public ParsableBox parseBox(ReadableByteChannel byteChannel, String parentType) throws IOException {
header.get().rewind().limit(8);
int bytesRead = 0;
int b;
while ((b = byteChannel.read(header.get())) + bytesRead < 8) {
if (b < 0) {
throw new EOFException();
} else {
bytesRead += b;
}
}
header.get().rewind();
long size = IsoTypeReader.readUInt32(header.get());
// do plausibility check
if (size < 8 && size > 1) {
LOG.error("Plausibility check failed: size < 8 (size = {}). Stop parsing!", size);
return null;
}
String type = IsoTypeReader.read4cc(header.get());
//System.err.println(type);
byte[] usertype = null;
long contentSize;
if (size == 1) {
header.get().limit(16);
byteChannel.read(header.get());
header.get().position(8);
size = IsoTypeReader.readUInt64(header.get());
contentSize = size - 16;
} else if (size == 0) {
throw new RuntimeException("box size of zero means 'till end of file. That is not yet supported");
} else {
contentSize = size - 8;
}
if (UserBox.TYPE.equals(type)) {
header.get().limit(header.get().limit() + 16);
byteChannel.read(header.get());
usertype = new byte[16];
for (int i = header.get().position() - 16; i < header.get().position(); i++) {
usertype[i - (header.get().position() - 16)] = header.get().get(i);
}
contentSize -= 16;
}
LOG.trace("Creating box {} {}", type, usertype);
ParsableBox parsableBox = createBox(type, usertype, parentType);
//LOG.finest("Parsing " + box.getType());
// System.out.println("parsing " + Mp4Arrays.toString(box.getType()) + " " + box.getClass().getName() + " size=" + size);
header.get().rewind();
parsableBox.parse(byteChannel, header.get(), contentSize, this);
return parsableBox;
}
示例11: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入方法依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
dataFormat = IsoTypeReader.read4cc(content);
}