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


Java ContainerMediaChunk类代码示例

本文整理汇总了Java中com.google.android.exoplayer2.source.chunk.ContainerMediaChunk的典型用法代码示例。如果您正苦于以下问题:Java ContainerMediaChunk类的具体用法?Java ContainerMediaChunk怎么用?Java ContainerMediaChunk使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: newMediaChunk

import com.google.android.exoplayer2.source.chunk.ContainerMediaChunk; //导入依赖的package包/类
private Chunk newMediaChunk(RepresentationHolder representationHolder, DataSource dataSource,
    Format trackFormat, int trackSelectionReason,
    Object trackSelectionData, Format sampleFormat, int segmentNum) {
  Representation representation = representationHolder.representation;
  long startTimeUs = representationHolder.getSegmentStartTimeUs(segmentNum);
  long endTimeUs = representationHolder.getSegmentEndTimeUs(segmentNum);
  RangedUri segmentUri = representationHolder.getSegmentUrl(segmentNum);
  DataSpec dataSpec = new DataSpec(segmentUri.getUri(), segmentUri.start, segmentUri.length,
      representation.getCacheKey());

  if (representationHolder.extractorWrapper == null) {
    return new SingleSampleMediaChunk(dataSource, dataSpec, trackFormat, trackSelectionReason,
        trackSelectionData, startTimeUs, endTimeUs, segmentNum, trackFormat);
  } else {
    long sampleOffsetUs = -representation.presentationTimeOffsetUs;
    return new ContainerMediaChunk(dataSource, dataSpec, trackFormat, trackSelectionReason,
        trackSelectionData, startTimeUs, endTimeUs, segmentNum, sampleOffsetUs,
        representationHolder.extractorWrapper, sampleFormat);
  }
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:21,代码来源:DefaultDashChunkSource.java

示例2: newMediaChunk

import com.google.android.exoplayer2.source.chunk.ContainerMediaChunk; //导入依赖的package包/类
private static MediaChunk newMediaChunk(Format format, DataSource dataSource, Uri uri,
    String cacheKey, int chunkIndex, long chunkStartTimeUs, long chunkEndTimeUs,
    int trackSelectionReason, Object trackSelectionData, ChunkExtractorWrapper extractorWrapper) {
  DataSpec dataSpec = new DataSpec(uri, 0, C.LENGTH_UNSET, cacheKey);
  // In SmoothStreaming each chunk contains sample timestamps relative to the start of the chunk.
  // To convert them the absolute timestamps, we need to set sampleOffsetUs to chunkStartTimeUs.
  long sampleOffsetUs = chunkStartTimeUs;
  return new ContainerMediaChunk(dataSource, dataSpec, format, trackSelectionReason,
      trackSelectionData, chunkStartTimeUs, chunkEndTimeUs, chunkIndex, 1, sampleOffsetUs,
      extractorWrapper);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:12,代码来源:DefaultSsChunkSource.java

示例3: newMediaChunk

import com.google.android.exoplayer2.source.chunk.ContainerMediaChunk; //导入依赖的package包/类
private static MediaChunk newMediaChunk(Format format, DataSource dataSource, Uri uri,
    String cacheKey, int chunkIndex, long chunkStartTimeUs, long chunkEndTimeUs,
    int trackSelectionReason, Object trackSelectionData, ChunkExtractorWrapper extractorWrapper) {
  DataSpec dataSpec = new DataSpec(uri, 0, C.LENGTH_UNSET, cacheKey);
  // In SmoothStreaming each chunk contains sample timestamps relative to the start of the chunk.
  // To convert them the absolute timestamps, we need to set sampleOffsetUs to chunkStartTimeUs.
  long sampleOffsetUs = chunkStartTimeUs;
  return new ContainerMediaChunk(dataSource, dataSpec, format, trackSelectionReason,
      trackSelectionData, chunkStartTimeUs, chunkEndTimeUs, chunkIndex, sampleOffsetUs,
      extractorWrapper, format);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:12,代码来源:DefaultSsChunkSource.java


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