Java 类com.google.android.exoplayer2.source.chunk.ChunkSampleStream 实例源码

项目:K-Sonic    文件:DashMediaPeriod.java   
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;
}
项目:transistor    文件:FakeAdaptiveMediaPeriod.java   
@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;
}
项目:transistor    文件:DashMediaPeriod.java   
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;
}
项目:K-Sonic    文件:DashMediaPeriod.java   
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);
  }
}
项目:K-Sonic    文件:DashMediaPeriod.java   
@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;
}
项目:K-Sonic    文件:DashMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return positionUs;
}
项目:K-Sonic    文件:SsMediaPeriod.java   
public void updateManifest(SsManifest manifest) {
  this.manifest = manifest;
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.getChunkSource().updateManifest(manifest);
  }
  callback.onContinueLoadingRequested(this);
}
项目:K-Sonic    文件:SsMediaPeriod.java   
@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;
}
项目:K-Sonic    文件:SsMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return positionUs;
}
项目:K-Sonic    文件:SsMediaPeriod.java   
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);
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
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);
  }
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
@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;
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return positionUs;
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
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);
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
public void updateManifest(SsManifest manifest) {
  this.manifest = manifest;
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.getChunkSource().updateManifest(manifest);
  }
  callback.onContinueLoadingRequested(this);
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
@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;
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return positionUs;
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
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);
}
项目:transistor    文件:FakeAdaptiveMediaPeriod.java   
@Override
public void release() {
  super.release();
  for (ChunkSampleStream<FakeChunkSource> sampleStream : sampleStreams) {
    sampleStream.release();
  }
}
项目:transistor    文件:FakeAdaptiveMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<FakeChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return super.seekToUs(positionUs);
}
项目:transistor    文件:FakeAdaptiveMediaPeriod.java   
@Override
protected SampleStream createSampleStream(TrackSelection trackSelection) {
  FakeChunkSource chunkSource = chunkSourceFactory.createChunkSource(trackSelection, durationUs);
  return new ChunkSampleStream<>(
      MimeTypes.getTrackType(trackSelection.getSelectedFormat().sampleMimeType), null,
      chunkSource, this, allocator, 0, 3, eventDispatcher);
}
项目:transistor    文件:DashMediaPeriod.java   
public void updateManifest(DashManifest manifest, int periodIndex) {
  this.manifest = manifest;
  this.periodIndex = periodIndex;
  if (sampleStreams != null) {
    for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
      sampleStream.getChunkSource().updateManifest(manifest, periodIndex);
    }
    callback.onContinueLoadingRequested(this);
  }
}
项目:transistor    文件:DashMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return positionUs;
}
项目:transistor    文件:SsMediaPeriod.java   
public void updateManifest(SsManifest manifest) {
  this.manifest = manifest;
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.getChunkSource().updateManifest(manifest);
  }
  callback.onContinueLoadingRequested(this);
}
项目:transistor    文件:SsMediaPeriod.java   
@Override
public long seekToUs(long positionUs) {
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.seekToUs(positionUs);
  }
  return positionUs;
}
项目:transistor    文件:SsMediaPeriod.java   
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);
}
项目:K-Sonic    文件:DashMediaPeriod.java   
public void release() {
  for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
    sampleStream.release();
  }
}
项目:K-Sonic    文件:DashMediaPeriod.java   
@Override
public void discardBuffer(long positionUs) {
  for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
    sampleStream.discardUnselectedEmbeddedTracksTo(positionUs);
  }
}
项目:K-Sonic    文件:DashMediaPeriod.java   
@Override
public void onContinueLoadingRequested(ChunkSampleStream<DashChunkSource> sampleStream) {
  callback.onContinueLoadingRequested(this);
}
项目:K-Sonic    文件:DashMediaPeriod.java   
@SuppressWarnings("unchecked")
private static ChunkSampleStream<DashChunkSource>[] newSampleStreamArray(int length) {
  return new ChunkSampleStream[length];
}
项目:K-Sonic    文件:SsMediaPeriod.java   
public void release() {
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.release();
  }
}
项目:K-Sonic    文件:SsMediaPeriod.java   
@Override
public void onContinueLoadingRequested(ChunkSampleStream<SsChunkSource> sampleStream) {
  callback.onContinueLoadingRequested(this);
}
项目:K-Sonic    文件:SsMediaPeriod.java   
@SuppressWarnings("unchecked")
private static ChunkSampleStream<SsChunkSource>[] newSampleStreamArray(int length) {
  return new ChunkSampleStream[length];
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
public void release() {
  for (ChunkSampleStream<DashChunkSource> sampleStream : sampleStreams) {
    sampleStream.release();
  }
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
@Override
public void onContinueLoadingRequested(ChunkSampleStream<DashChunkSource> sampleStream) {
  callback.onContinueLoadingRequested(this);
}
项目:videoPickPlayer    文件:DashMediaPeriod.java   
@SuppressWarnings("unchecked")
private static ChunkSampleStream<DashChunkSource>[] newSampleStreamArray(int length) {
  return new ChunkSampleStream[length];
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
public void release() {
  for (ChunkSampleStream<SsChunkSource> sampleStream : sampleStreams) {
    sampleStream.release();
  }
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
@Override
public void onContinueLoadingRequested(ChunkSampleStream<SsChunkSource> sampleStream) {
  callback.onContinueLoadingRequested(this);
}
项目:videoPickPlayer    文件:SsMediaPeriod.java   
@SuppressWarnings("unchecked")
private static ChunkSampleStream<SsChunkSource>[] newSampleStreamArray(int length) {
  return new ChunkSampleStream[length];
}
项目:transistor    文件:FakeAdaptiveMediaPeriod.java   
@Override
public void onContinueLoadingRequested(ChunkSampleStream<FakeChunkSource> source) {
  callback.onContinueLoadingRequested(this);
}