当前位置: 首页>>代码示例>>Java>>正文


Java LeafAtom类代码示例

本文整理汇总了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;
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:31,代码来源:FragmentedMp4Extractor.java

示例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;
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:10,代码来源:FragmentedMp4Extractor.java

示例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);
    }
  }
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:36,代码来源:FragmentedMp4Extractor.java

示例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);
  }
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:33,代码来源:FragmentedMp4Extractor.java


注:本文中的com.google.android.exoplayer.parser.mp4.Atom.LeafAtom类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。