本文整理汇总了Java中com.google.android.exoplayer2.source.chunk.ChunkSampleStream类的典型用法代码示例。如果您正苦于以下问题:Java ChunkSampleStream类的具体用法?Java ChunkSampleStream怎么用?Java ChunkSampleStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChunkSampleStream类属于com.google.android.exoplayer2.source.chunk包,在下文中一共展示了ChunkSampleStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSampleStream
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
private ChunkSampleStream<DashChunkSource> buildSampleStream(int adaptationSetIndex,
TrackSelection selection, long positionUs) {
AdaptationSet adaptationSet = adaptationSets.get(adaptationSetIndex);
int embeddedTrackCount = 0;
int[] embeddedTrackTypes = new int[2];
boolean enableEventMessageTrack = hasEventMessageTrack(adaptationSet);
if (enableEventMessageTrack) {
embeddedTrackTypes[embeddedTrackCount++] = C.TRACK_TYPE_METADATA;
}
boolean enableCea608Track = hasCea608Track(adaptationSet);
if (enableCea608Track) {
embeddedTrackTypes[embeddedTrackCount++] = C.TRACK_TYPE_TEXT;
}
if (embeddedTrackCount < embeddedTrackTypes.length) {
embeddedTrackTypes = Arrays.copyOf(embeddedTrackTypes, embeddedTrackCount);
}
DashChunkSource chunkSource = chunkSourceFactory.createDashChunkSource(
manifestLoaderErrorThrower, manifest, periodIndex, adaptationSetIndex, selection,
elapsedRealtimeOffset, enableEventMessageTrack, enableCea608Track);
ChunkSampleStream<DashChunkSource> stream = new ChunkSampleStream<>(adaptationSet.type,
embeddedTrackTypes, chunkSource, this, allocator, positionUs, minLoadableRetryCount,
eventDispatcher);
return stream;
}
示例2: selectTracks
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public long selectTracks(TrackSelection[] selections, boolean[] mayRetainStreamFlags,
SampleStream[] streams, boolean[] streamResetFlags, long positionUs) {
long returnPositionUs = super.selectTracks(selections, mayRetainStreamFlags, streams,
streamResetFlags, positionUs);
List<ChunkSampleStream<FakeChunkSource>> validStreams = new ArrayList<>();
for (SampleStream stream : streams) {
if (stream != null) {
validStreams.add((ChunkSampleStream<FakeChunkSource>) stream);
}
}
this.sampleStreams = validStreams.toArray(new ChunkSampleStream[validStreams.size()]);
this.sequenceableLoader = new CompositeSequenceableLoader(sampleStreams);
return returnPositionUs;
}
示例3: buildSampleStream
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
private ChunkSampleStream<DashChunkSource> buildSampleStream(TrackGroupInfo trackGroupInfo,
TrackSelection selection, long positionUs) {
int embeddedTrackCount = 0;
int[] embeddedTrackTypes = new int[2];
boolean enableEventMessageTrack = trackGroupInfo.hasEmbeddedEventMessageTrack;
if (enableEventMessageTrack) {
embeddedTrackTypes[embeddedTrackCount++] = C.TRACK_TYPE_METADATA;
}
boolean enableCea608Track = trackGroupInfo.hasEmbeddedCea608Track;
if (enableCea608Track) {
embeddedTrackTypes[embeddedTrackCount++] = C.TRACK_TYPE_TEXT;
}
if (embeddedTrackCount < embeddedTrackTypes.length) {
embeddedTrackTypes = Arrays.copyOf(embeddedTrackTypes, embeddedTrackCount);
}
DashChunkSource chunkSource = chunkSourceFactory.createDashChunkSource(
manifestLoaderErrorThrower, manifest, periodIndex, trackGroupInfo.adaptationSetIndices,
selection, trackGroupInfo.trackType, elapsedRealtimeOffset, enableEventMessageTrack,
enableCea608Track);
ChunkSampleStream<DashChunkSource> stream = new ChunkSampleStream<>(trackGroupInfo.trackType,
embeddedTrackTypes, chunkSource, this, allocator, positionUs, minLoadableRetryCount,
eventDispatcher);
return stream;
}
示例4: updateManifest
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
public void updateManifest(DashManifest manifest, int periodIndex) {
this.manifest = manifest;
this.periodIndex = periodIndex;
adaptationSets = manifest.getPeriod(periodIndex).adaptationSets;
if (sampleStreams != null) {
for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
sampleStream.getChunkSource().updateManifest(manifest, periodIndex);
}
callback.onContinueLoadingRequested(this);
}
}
示例5: getBufferedPositionUs
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public long getBufferedPositionUs() {
long bufferedPositionUs = Long.MAX_VALUE;
for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
long rendererBufferedPositionUs = sampleStream.getBufferedPositionUs();
if (rendererBufferedPositionUs != C.TIME_END_OF_SOURCE) {
bufferedPositionUs = Math.min(bufferedPositionUs, rendererBufferedPositionUs);
}
}
return bufferedPositionUs == Long.MAX_VALUE ? C.TIME_END_OF_SOURCE : bufferedPositionUs;
}
示例6: seekToUs
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public long seekToUs(long positionUs) {
for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
sampleStream.seekToUs(positionUs);
}
return positionUs;
}
示例7: updateManifest
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
public void updateManifest(SsManifest manifest) {
this.manifest = manifest;
for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
sampleStream.getChunkSource().updateManifest(manifest);
}
callback.onContinueLoadingRequested(this);
}
示例8: getBufferedPositionUs
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public long getBufferedPositionUs() {
long bufferedPositionUs = Long.MAX_VALUE;
for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
long rendererBufferedPositionUs = sampleStream.getBufferedPositionUs();
if (rendererBufferedPositionUs != C.TIME_END_OF_SOURCE) {
bufferedPositionUs = Math.min(bufferedPositionUs, rendererBufferedPositionUs);
}
}
return bufferedPositionUs == Long.MAX_VALUE ? C.TIME_END_OF_SOURCE : bufferedPositionUs;
}
示例9: seekToUs
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public long seekToUs(long positionUs) {
for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
sampleStream.seekToUs(positionUs);
}
return positionUs;
}
示例10: buildSampleStream
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
private ChunkSampleStream<SsChunkSource> buildSampleStream(TrackSelection selection,
long positionUs) {
int streamElementIndex = trackGroups.indexOf(selection.getTrackGroup());
SsChunkSource chunkSource = chunkSourceFactory.createChunkSource(manifestLoaderErrorThrower,
manifest, streamElementIndex, selection, trackEncryptionBoxes);
return new ChunkSampleStream<>(manifest.streamElements[streamElementIndex].type, null,
chunkSource, this, allocator, positionUs, minLoadableRetryCount, eventDispatcher);
}
示例11: updateManifest
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
public void updateManifest(DashManifest manifest, int index) {
this.manifest = manifest;
this.index = index;
period = manifest.getPeriod(index);
if (sampleStreams != null) {
for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
sampleStream.getChunkSource().updateManifest(manifest, index);
}
callback.onContinueLoadingRequested(this);
}
}
示例12: buildSampleStream
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
private ChunkSampleStream<DashChunkSource> buildSampleStream(TrackSelection selection,
long positionUs) {
int adaptationSetIndex = trackGroups.indexOf(selection.getTrackGroup());
AdaptationSet adaptationSet = period.adaptationSets.get(adaptationSetIndex);
DashChunkSource chunkSource = chunkSourceFactory.createDashChunkSource(
manifestLoaderErrorThrower, manifest, index, adaptationSetIndex, selection,
elapsedRealtimeOffset);
return new ChunkSampleStream<>(adaptationSet.type, chunkSource, this, allocator, positionUs,
minLoadableRetryCount, eventDispatcher);
}
示例13: buildSampleStream
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
private ChunkSampleStream<SsChunkSource> buildSampleStream(TrackSelection selection,
long positionUs) {
int streamElementIndex = trackGroups.indexOf(selection.getTrackGroup());
SsChunkSource chunkSource = chunkSourceFactory.createChunkSource(manifestLoaderErrorThrower,
manifest, streamElementIndex, selection, trackEncryptionBoxes);
return new ChunkSampleStream<>(manifest.streamElements[streamElementIndex].type, chunkSource,
this, allocator, positionUs, minLoadableRetryCount, eventDispatcher);
}
示例14: release
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public void release() {
super.release();
for (ChunkSampleStream<FakeChunkSource> sampleStream : sampleStreams) {
sampleStream.release();
}
}
示例15: seekToUs
import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public long seekToUs(long positionUs) {
for (ChunkSampleStream<FakeChunkSource> sampleStream : sampleStreams) {
sampleStream.seekToUs(positionUs);
}
return super.seekToUs(positionUs);
}