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


Java TimestampAdjuster.adjustTsTimestamp方法代码示例

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


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

示例1: parseFromSection

import com.google.android.exoplayer2.util.TimestampAdjuster; //导入方法依赖的package包/类
static SpliceInsertCommand parseFromSection(ParsableByteArray sectionData,
    long ptsAdjustment, TimestampAdjuster timestampAdjuster) {
  long spliceEventId = sectionData.readUnsignedInt();
  // splice_event_cancel_indicator(1), reserved(7).
  boolean spliceEventCancelIndicator = (sectionData.readUnsignedByte() & 0x80) != 0;
  boolean outOfNetworkIndicator = false;
  boolean programSpliceFlag = false;
  boolean spliceImmediateFlag = false;
  long programSplicePts = C.TIME_UNSET;
  List<ComponentSplice> componentSplices = Collections.emptyList();
  int uniqueProgramId = 0;
  int availNum = 0;
  int availsExpected = 0;
  boolean autoReturn = false;
  long duration = C.TIME_UNSET;
  if (!spliceEventCancelIndicator) {
    int headerByte = sectionData.readUnsignedByte();
    outOfNetworkIndicator = (headerByte & 0x80) != 0;
    programSpliceFlag = (headerByte & 0x40) != 0;
    boolean durationFlag = (headerByte & 0x20) != 0;
    spliceImmediateFlag = (headerByte & 0x10) != 0;
    if (programSpliceFlag && !spliceImmediateFlag) {
      programSplicePts = TimeSignalCommand.parseSpliceTime(sectionData, ptsAdjustment);
    }
    if (!programSpliceFlag) {
      int componentCount = sectionData.readUnsignedByte();
      componentSplices = new ArrayList<>(componentCount);
      for (int i = 0; i < componentCount; i++) {
        int componentTag = sectionData.readUnsignedByte();
        long componentSplicePts = C.TIME_UNSET;
        if (!spliceImmediateFlag) {
          componentSplicePts = TimeSignalCommand.parseSpliceTime(sectionData, ptsAdjustment);
        }
        componentSplices.add(new ComponentSplice(componentTag, componentSplicePts,
            timestampAdjuster.adjustTsTimestamp(componentSplicePts)));
      }
    }
    if (durationFlag) {
      long firstByte = sectionData.readUnsignedByte();
      autoReturn = (firstByte & 0x80) != 0;
      duration = ((firstByte & 0x01) << 32) | sectionData.readUnsignedInt();
    }
    uniqueProgramId = sectionData.readUnsignedShort();
    availNum = sectionData.readUnsignedByte();
    availsExpected = sectionData.readUnsignedByte();
  }
  return new SpliceInsertCommand(spliceEventId, spliceEventCancelIndicator, outOfNetworkIndicator,
      programSpliceFlag, spliceImmediateFlag, programSplicePts,
      timestampAdjuster.adjustTsTimestamp(programSplicePts), componentSplices, autoReturn,
      duration, uniqueProgramId, availNum, availsExpected);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:52,代码来源:SpliceInsertCommand.java

示例2: parseFromSection

import com.google.android.exoplayer2.util.TimestampAdjuster; //导入方法依赖的package包/类
static TimeSignalCommand parseFromSection(ParsableByteArray sectionData,
    long ptsAdjustment, TimestampAdjuster timestampAdjuster) {
  long ptsTime = parseSpliceTime(sectionData, ptsAdjustment);
  long playbackPositionUs = timestampAdjuster.adjustTsTimestamp(ptsTime);
  return new TimeSignalCommand(ptsTime, playbackPositionUs);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:7,代码来源:TimeSignalCommand.java

示例3: parseFromSection

import com.google.android.exoplayer2.util.TimestampAdjuster; //导入方法依赖的package包/类
static SpliceInsertCommand parseFromSection(ParsableByteArray sectionData,
    long ptsAdjustment, TimestampAdjuster timestampAdjuster) {
  long spliceEventId = sectionData.readUnsignedInt();
  // splice_event_cancel_indicator(1), reserved(7).
  boolean spliceEventCancelIndicator = (sectionData.readUnsignedByte() & 0x80) != 0;
  boolean outOfNetworkIndicator = false;
  boolean programSpliceFlag = false;
  boolean spliceImmediateFlag = false;
  long programSplicePts = C.TIME_UNSET;
  List<ComponentSplice> componentSplices = Collections.emptyList();
  int uniqueProgramId = 0;
  int availNum = 0;
  int availsExpected = 0;
  boolean autoReturn = false;
  long breakDurationUs = C.TIME_UNSET;
  if (!spliceEventCancelIndicator) {
    int headerByte = sectionData.readUnsignedByte();
    outOfNetworkIndicator = (headerByte & 0x80) != 0;
    programSpliceFlag = (headerByte & 0x40) != 0;
    boolean durationFlag = (headerByte & 0x20) != 0;
    spliceImmediateFlag = (headerByte & 0x10) != 0;
    if (programSpliceFlag && !spliceImmediateFlag) {
      programSplicePts = TimeSignalCommand.parseSpliceTime(sectionData, ptsAdjustment);
    }
    if (!programSpliceFlag) {
      int componentCount = sectionData.readUnsignedByte();
      componentSplices = new ArrayList<>(componentCount);
      for (int i = 0; i < componentCount; i++) {
        int componentTag = sectionData.readUnsignedByte();
        long componentSplicePts = C.TIME_UNSET;
        if (!spliceImmediateFlag) {
          componentSplicePts = TimeSignalCommand.parseSpliceTime(sectionData, ptsAdjustment);
        }
        componentSplices.add(new ComponentSplice(componentTag, componentSplicePts,
            timestampAdjuster.adjustTsTimestamp(componentSplicePts)));
      }
    }
    if (durationFlag) {
      long firstByte = sectionData.readUnsignedByte();
      autoReturn = (firstByte & 0x80) != 0;
      long breakDuration90khz = ((firstByte & 0x01) << 32) | sectionData.readUnsignedInt();
      breakDurationUs = breakDuration90khz * 1000 / 90;
    }
    uniqueProgramId = sectionData.readUnsignedShort();
    availNum = sectionData.readUnsignedByte();
    availsExpected = sectionData.readUnsignedByte();
  }
  return new SpliceInsertCommand(spliceEventId, spliceEventCancelIndicator, outOfNetworkIndicator,
      programSpliceFlag, spliceImmediateFlag, programSplicePts,
      timestampAdjuster.adjustTsTimestamp(programSplicePts), componentSplices, autoReturn,
      breakDurationUs, uniqueProgramId, availNum, availsExpected);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:53,代码来源:SpliceInsertCommand.java


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