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


Java C.TRACK_TYPE_UNKNOWN属性代码示例

本文整理汇总了Java中com.google.android.exoplayer2.C.TRACK_TYPE_UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java C.TRACK_TYPE_UNKNOWN属性的具体用法?Java C.TRACK_TYPE_UNKNOWN怎么用?Java C.TRACK_TYPE_UNKNOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.exoplayer2.C的用法示例。


在下文中一共展示了C.TRACK_TYPE_UNKNOWN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseHdlr

/**
 * Parses an hdlr atom.
 *
 * @param hdlr The hdlr atom to decode.
 * @return The track type.
 */
private static int parseHdlr(ParsableByteArray hdlr) {
  hdlr.setPosition(Atom.FULL_HEADER_SIZE + 4);
  int trackType = hdlr.readInt();
  if (trackType == TYPE_soun) {
    return C.TRACK_TYPE_AUDIO;
  } else if (trackType == TYPE_vide) {
    return C.TRACK_TYPE_VIDEO;
  } else if (trackType == TYPE_text || trackType == TYPE_sbtl || trackType == TYPE_subt
      || trackType == TYPE_clcp) {
    return C.TRACK_TYPE_TEXT;
  } else if (trackType == TYPE_meta) {
    return C.TRACK_TYPE_METADATA;
  } else {
    return C.TRACK_TYPE_UNKNOWN;
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:22,代码来源:AtomParsers.java

示例2: getTrackType

/**
 * Returns the {@link C}{@code .TRACK_TYPE_*} constant that corresponds to a specified mime type.
 * {@link C#TRACK_TYPE_UNKNOWN} if the mime type is not known or the mapping cannot be
 * established.
 *
 * @param mimeType The mimeType.
 * @return The {@link C}{@code .TRACK_TYPE_*} constant that corresponds to a specified mime type.
 */
public static int getTrackType(String mimeType) {
  if (TextUtils.isEmpty(mimeType)) {
    return C.TRACK_TYPE_UNKNOWN;
  } else if (isAudio(mimeType)) {
    return C.TRACK_TYPE_AUDIO;
  } else if (isVideo(mimeType)) {
    return C.TRACK_TYPE_VIDEO;
  } else if (isText(mimeType) || APPLICATION_CEA608.equals(mimeType)
      || APPLICATION_CEA708.equals(mimeType) || APPLICATION_MP4CEA608.equals(mimeType)
      || APPLICATION_SUBRIP.equals(mimeType) || APPLICATION_TTML.equals(mimeType)
      || APPLICATION_TX3G.equals(mimeType) || APPLICATION_MP4VTT.equals(mimeType)
      || APPLICATION_RAWCC.equals(mimeType) || APPLICATION_VOBSUB.equals(mimeType)
      || APPLICATION_PGS.equals(mimeType) || APPLICATION_DVBSUBS.equals(mimeType)) {
    return C.TRACK_TYPE_TEXT;
  } else if (APPLICATION_ID3.equals(mimeType)
      || APPLICATION_EMSG.equals(mimeType)
      || APPLICATION_SCTE35.equals(mimeType)
      || APPLICATION_CAMERA_MOTION.equals(mimeType)) {
    return C.TRACK_TYPE_METADATA;
  } else {
    return C.TRACK_TYPE_UNKNOWN;
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:31,代码来源:MimeTypes.java

示例3: parseTrak

/**
 * Parses a trak atom (defined in 14496-12).
 *
 * @param trak Atom to decode.
 * @param mvhd Movie header atom, used to get the timescale.
 * @param duration The duration in units of the timescale declared in the mvhd atom, or
 *     {@link C#TIME_UNSET} if the duration should be parsed from the tkhd atom.
 * @param drmInitData {@link DrmInitData} to be included in the format.
 * @param isQuickTime True for QuickTime media. False otherwise.
 * @return A {@link Track} instance, or {@code null} if the track's type isn't supported.
 */
public static Track parseTrak(Atom.ContainerAtom trak, Atom.LeafAtom mvhd, long duration,
    DrmInitData drmInitData, boolean isQuickTime) throws ParserException {
  Atom.ContainerAtom mdia = trak.getContainerAtomOfType(Atom.TYPE_mdia);
  int trackType = parseHdlr(mdia.getLeafAtomOfType(Atom.TYPE_hdlr).data);
  if (trackType == C.TRACK_TYPE_UNKNOWN) {
    return null;
  }

  TkhdData tkhdData = parseTkhd(trak.getLeafAtomOfType(Atom.TYPE_tkhd).data);
  if (duration == C.TIME_UNSET) {
    duration = tkhdData.duration;
  }
  long movieTimescale = parseMvhd(mvhd.data);
  long durationUs;
  if (duration == C.TIME_UNSET) {
    durationUs = C.TIME_UNSET;
  } else {
    durationUs = Util.scaleLargeTimestamp(duration, C.MICROS_PER_SECOND, movieTimescale);
  }
  Atom.ContainerAtom stbl = mdia.getContainerAtomOfType(Atom.TYPE_minf)
      .getContainerAtomOfType(Atom.TYPE_stbl);

  Pair<Long, String> mdhdData = parseMdhd(mdia.getLeafAtomOfType(Atom.TYPE_mdhd).data);
  StsdData stsdData = parseStsd(stbl.getLeafAtomOfType(Atom.TYPE_stsd).data, tkhdData.id,
      tkhdData.rotationDegrees, mdhdData.second, drmInitData, isQuickTime);
  Pair<long[], long[]> edtsData = parseEdts(trak.getContainerAtomOfType(Atom.TYPE_edts));
  return stsdData.format == null ? null
      : new Track(tkhdData.id, trackType, mdhdData.first, movieTimescale, durationUs,
          stsdData.format, stsdData.requiredSampleTransformation, stsdData.trackEncryptionBoxes,
          stsdData.nalUnitLengthFieldLength, edtsData.first, edtsData.second);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:42,代码来源:AtomParsers.java


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