本文整理汇总了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);
}
}
示例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);
}
示例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);
}