本文整理汇总了Java中com.google.android.exoplayer.parser.mp4.Atom.LeafAtom类的典型用法代码示例。如果您正苦于以下问题:Java LeafAtom类的具体用法?Java LeafAtom怎么用?Java LeafAtom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LeafAtom类属于com.google.android.exoplayer.parser.mp4.Atom包,在下文中一共展示了LeafAtom类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readAtomPayload
import com.google.android.exoplayer.parser.mp4.Atom.LeafAtom; //导入依赖的package包/类
private int readAtomPayload(NonBlockingInputStream inputStream) {
int bytesRead;
if (atomData != null) {
bytesRead = inputStream.read(atomData.data, atomBytesRead, atomSize - atomBytesRead);
} else {
bytesRead = inputStream.skip(atomSize - atomBytesRead);
}
if (bytesRead == -1) {
return RESULT_END_OF_STREAM;
}
rootAtomBytesRead += bytesRead;
atomBytesRead += bytesRead;
if (atomBytesRead != atomSize) {
return RESULT_NEED_MORE_DATA;
}
int results = 0;
if (atomData != null) {
results |= onLeafAtomRead(new LeafAtom(atomType, atomData));
}
while (!containerAtomEndPoints.isEmpty()
&& containerAtomEndPoints.peek() == rootAtomBytesRead) {
containerAtomEndPoints.pop();
results |= onContainerAtomRead(containerAtoms.pop());
}
enterState(STATE_READING_ATOM_HEADER);
return results;
}
示例2: onLeafAtomRead
import com.google.android.exoplayer.parser.mp4.Atom.LeafAtom; //导入依赖的package包/类
private int onLeafAtomRead(LeafAtom leaf) {
if (!containerAtoms.isEmpty()) {
containerAtoms.peek().add(leaf);
} else if (leaf.type == Atom.TYPE_sidx) {
segmentIndex = parseSidx(leaf.data);
return RESULT_READ_INDEX;
}
return 0;
}
示例3: parseTraf
import com.google.android.exoplayer.parser.mp4.Atom.LeafAtom; //导入依赖的package包/类
/**
* Parses a traf atom (defined in 14496-12).
*/
private static void parseTraf(Track track, DefaultSampleValues extendsDefaults,
ContainerAtom traf, TrackFragment out, int workaroundFlags, byte[] extendedTypeScratch) {
LeafAtom tfdtAtom = traf.getLeafAtomOfType(Atom.TYPE_tfdt);
long decodeTime = tfdtAtom == null ? 0 : parseTfdt(traf.getLeafAtomOfType(Atom.TYPE_tfdt).data);
LeafAtom tfhd = traf.getLeafAtomOfType(Atom.TYPE_tfhd);
DefaultSampleValues fragmentHeader = parseTfhd(extendsDefaults, tfhd.data);
out.sampleDescriptionIndex = fragmentHeader.sampleDescriptionIndex;
LeafAtom trun = traf.getLeafAtomOfType(Atom.TYPE_trun);
parseTrun(track, fragmentHeader, decodeTime, workaroundFlags, trun.data, out);
LeafAtom saiz = traf.getLeafAtomOfType(Atom.TYPE_saiz);
if (saiz != null) {
TrackEncryptionBox trackEncryptionBox =
track.sampleDescriptionEncryptionBoxes[fragmentHeader.sampleDescriptionIndex];
parseSaiz(trackEncryptionBox, saiz.data, out);
}
LeafAtom senc = traf.getLeafAtomOfType(Atom.TYPE_senc);
if (senc != null) {
parseSenc(senc.data, out);
}
int childrenSize = traf.children.size();
for (int i = 0; i < childrenSize; i++) {
Atom atom = traf.children.get(i);
if (atom.type == Atom.TYPE_uuid) {
parseUuid(((LeafAtom) atom).data, out, extendedTypeScratch);
}
}
}
示例4: parseTraf
import com.google.android.exoplayer.parser.mp4.Atom.LeafAtom; //导入依赖的package包/类
/**
* Parses a traf atom (defined in 14496-12).
*/
private static void parseTraf(Track track, DefaultSampleValues extendsDefaults,
ContainerAtom traf, TrackFragment out, int workaroundFlags, byte[] extendedTypeScratch) {
LeafAtom tfdtAtom = traf.getLeafAtomOfType(Atom.TYPE_tfdt);
long decodeTime = tfdtAtom == null ? 0 : parseTfdt(traf.getLeafAtomOfType(Atom.TYPE_tfdt).data);
LeafAtom tfhd = traf.getLeafAtomOfType(Atom.TYPE_tfhd);
DefaultSampleValues fragmentHeader = parseTfhd(extendsDefaults, tfhd.data);
out.sampleDescriptionIndex = fragmentHeader.sampleDescriptionIndex;
LeafAtom trun = traf.getLeafAtomOfType(Atom.TYPE_trun);
parseTrun(track, fragmentHeader, decodeTime, workaroundFlags, trun.data, out);
LeafAtom saiz = traf.getLeafAtomOfType(Atom.TYPE_saiz);
if (saiz != null) {
TrackEncryptionBox trackEncryptionBox =
track.sampleDescriptionEncryptionBoxes[fragmentHeader.sampleDescriptionIndex];
parseSaiz(trackEncryptionBox, saiz.data, out);
}
LeafAtom senc = traf.getLeafAtomOfType(Atom.TYPE_senc);
if (senc != null) {
parseSenc(senc.data, out);
}
LeafAtom uuid = traf.getLeafAtomOfType(Atom.TYPE_uuid);
if (uuid != null) {
parseUuid(uuid.data, out, extendedTypeScratch);
}
}