本文整理匯總了Java中org.mp4parser.tools.IsoTypeReader類的典型用法代碼示例。如果您正苦於以下問題:Java IsoTypeReader類的具體用法?Java IsoTypeReader怎麽用?Java IsoTypeReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IsoTypeReader類屬於org.mp4parser.tools包,在下文中一共展示了IsoTypeReader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
int tmp = IsoTypeReader.readUInt8(content);
offsetSize = tmp >>> 4;
lengthSize = tmp & 0xf;
tmp = IsoTypeReader.readUInt8(content);
baseOffsetSize = tmp >>> 4;
if (getVersion() == 1) {
indexSize = tmp & 0xf;
}
int itemCount = IsoTypeReader.readUInt16(content);
for (int i = 0; i < itemCount; i++) {
items.add(new Item(content));
}
}
示例2: Item
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
public Item(ByteBuffer in) {
itemId = IsoTypeReader.readUInt16(in);
if (getVersion() == 1) {
int tmp = IsoTypeReader.readUInt16(in);
constructionMethod = tmp & 0xf;
}
dataReferenceIndex = IsoTypeReader.readUInt16(in);
if (baseOffsetSize > 0) {
baseOffset = IsoTypeReaderVariable.read(in, baseOffsetSize);
} else {
baseOffset = 0;
}
int extentCount = IsoTypeReader.readUInt16(in);
for (int i = 0; i < extentCount; i++) {
extents.add(new Extent(in));
}
}
示例3: parse
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException {
ByteBuffer buffer = ByteBuffer.allocate(4);
dataSource.read(buffer);
buffer.rewind();
version = IsoTypeReader.readUInt8(buffer);
flags = IsoTypeReader.readUInt24(buffer);
int entryCountLength = (version == 0) ? 2 : 4;
buffer = ByteBuffer.allocate(entryCountLength);
dataSource.read(buffer);
buffer.rewind();
initContainer(dataSource, contentSize - 4 - entryCountLength, boxParser);
for (ItemInfoEntry entry : getBoxes(ItemInfoEntry.class)) {
entry.parseDetails();
}
}
示例4: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@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);
}
}
示例5: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
protected void _parseDetails(ByteBuffer content) {
tierID = IsoTypeReader.readUInt16(content);
profileIndication = IsoTypeReader.readUInt8(content);
profile_compatibility = IsoTypeReader.readUInt8(content);
levelIndication = IsoTypeReader.readUInt8(content);
reserved1 = IsoTypeReader.readUInt8(content);
visualWidth = IsoTypeReader.readUInt16(content);
visualHeight = IsoTypeReader.readUInt16(content);
int a = IsoTypeReader.readUInt8(content);
discardable = (a & 0xC0) >> 6;
constantFrameRate = (a & 0x30) >> 4;
reserved2 = a & 0xf;
frameRate = IsoTypeReader.readUInt16(content);
}
示例6: _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);
}
}
}
示例7: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
trackId = IsoTypeReader.readUInt32(content);
if ((getFlags() & 0x1) == 1) { //baseDataOffsetPresent
baseDataOffset = IsoTypeReader.readUInt64(content);
}
if ((getFlags() & 0x2) == 0x2) { //sampleDescriptionIndexPresent
sampleDescriptionIndex = IsoTypeReader.readUInt32(content);
}
if ((getFlags() & 0x8) == 0x8) { //defaultSampleDurationPresent
defaultSampleDuration = IsoTypeReader.readUInt32(content);
}
if ((getFlags() & 0x10) == 0x10) { //defaultSampleSizePresent
defaultSampleSize = IsoTypeReader.readUInt32(content);
}
if ((getFlags() & 0x20) == 0x20) { //defaultSampleFlagsPresent
defaultSampleFlags = new SampleFlags(content);
}
if ((getFlags() & 0x10000) == 0x10000) { //durationIsEmpty
durationIsEmpty = true;
}
if ((getFlags() & 0x20000) == 0x20000) { //defaultBaseIsMoof
defaultBaseIsMoof = true;
}
}
示例8: parseEntries
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
private List<CencSampleAuxiliaryDataFormat> parseEntries(ByteBuffer content, final long numOfEntries, int ivSize) {
List<CencSampleAuxiliaryDataFormat> _entries = new ArrayList<CencSampleAuxiliaryDataFormat>();
try {
long remainingNumOfEntries = numOfEntries;
while (remainingNumOfEntries-- > 0) {
CencSampleAuxiliaryDataFormat e = new CencSampleAuxiliaryDataFormat();
e.iv = new byte[ivSize];
content.get(e.iv);
if ((getFlags() & 0x2) > 0) {
int numOfPairs = IsoTypeReader.readUInt16(content);
e.pairs = new CencSampleAuxiliaryDataFormat.Pair[numOfPairs];
for (int i = 0; i < e.pairs.length; i++) {
e.pairs[i] = e.createPair(
IsoTypeReader.readUInt16(content),
IsoTypeReader.readUInt32(content));
}
}
_entries.add(e);
}
} catch (BufferUnderflowException bue) {
return null;
}
return _entries;
}
示例9: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
if (getVersion() == 1) {
creationTime = DateHelper.convert(IsoTypeReader.readUInt64(content));
modificationTime = DateHelper.convert(IsoTypeReader.readUInt64(content));
timescale = IsoTypeReader.readUInt32(content);
duration = content.getLong();
} else {
creationTime = DateHelper.convert(IsoTypeReader.readUInt32(content));
modificationTime = DateHelper.convert(IsoTypeReader.readUInt32(content));
timescale = IsoTypeReader.readUInt32(content);
duration = content.getInt();
}
if (duration < -1) {
LOG.warn("mdhd duration is not in expected range");
}
language = IsoTypeReader.readIso639(content);
IsoTypeReader.readUInt16(content);
}
示例10: _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);
}
}
}
示例11: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
DTSSamplingFrequency = IsoTypeReader.readUInt32(content);
maxBitRate = IsoTypeReader.readUInt32(content);
avgBitRate = IsoTypeReader.readUInt32(content);
pcmSampleDepth = IsoTypeReader.readUInt8(content);
BitReaderBuffer brb = new BitReaderBuffer(content);
frameDuration = brb.readBits(2);
streamConstruction = brb.readBits(5);
coreLFEPresent = brb.readBits(1);
coreLayout = brb.readBits(6);
coreSize = brb.readBits(14);
stereoDownmix = brb.readBits(1);
representationType = brb.readBits(3);
channelLayout = brb.readBits(16);
multiAssetFlag = brb.readBits(1);
LBRDurationMod = brb.readBits(1);
reservedBoxPresent = brb.readBits(1);
reserved = brb.readBits(5);
}
示例12: _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
}
}
示例13: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
public void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
long entryCount = IsoTypeReader.readUInt32(content);
for (int i = 0; i < entryCount; i++) {
SubSampleEntry SubSampleEntry = new SubSampleEntry();
SubSampleEntry.setSampleDelta(IsoTypeReader.readUInt32(content));
int subsampleCount = IsoTypeReader.readUInt16(content);
for (int j = 0; j < subsampleCount; j++) {
SubSampleEntry.SubsampleEntry subsampleEntry = new SubSampleEntry.SubsampleEntry();
subsampleEntry.setSubsampleSize(getVersion() == 1 ? IsoTypeReader.readUInt32(content) : IsoTypeReader.readUInt16(content));
subsampleEntry.setSubsamplePriority(IsoTypeReader.readUInt8(content));
subsampleEntry.setDiscardable(IsoTypeReader.readUInt8(content));
subsampleEntry.setReserved(IsoTypeReader.readUInt32(content));
SubSampleEntry.getSubsampleEntries().add(subsampleEntry);
}
entries.add(SubSampleEntry);
}
}
示例14: _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);
}
}
示例15: _parseDetails
import org.mp4parser.tools.IsoTypeReader; //導入依賴的package包/類
@Override
protected void _parseDetails(ByteBuffer content) {
parseVersionAndFlags(content);
mimeSubtypeName = IsoTypeReader.readString(content);
profileLevelIdc = IsoTypeReader.readString(content);
codecs = IsoTypeReader.readString(content);
protection = IsoTypeReader.readString(content);
languages = IsoTypeReader.readString(content);
int brandEntryCount = IsoTypeReader.readUInt8(content);
while (brandEntryCount-- > 0) {
brandEntries.put(IsoTypeReader.readString(content), IsoTypeReader.readString(content));
}
int idEntryCount = IsoTypeReader.readUInt8(content);
while (idEntryCount-- > 0) {
idEntries.put(IsoTypeReader.readString(content), IsoTypeReader.readString(content));
}
}