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


Java ChunkSampleStream类代码示例

本文整理汇总了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;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:25,代码来源:DashMediaPeriod.java

示例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;
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:FakeAdaptiveMediaPeriod.java

示例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;
}
 
开发者ID:y20k,项目名称:transistor,代码行数:25,代码来源:DashMediaPeriod.java

示例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);
  }
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:12,代码来源:DashMediaPeriod.java

示例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;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:12,代码来源:DashMediaPeriod.java

示例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;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:8,代码来源:DashMediaPeriod.java

示例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);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:8,代码来源:SsMediaPeriod.java

示例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;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:12,代码来源:SsMediaPeriod.java

示例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;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:8,代码来源:SsMediaPeriod.java

示例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);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:9,代码来源:SsMediaPeriod.java

示例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);
  }
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:12,代码来源:DashMediaPeriod.java

示例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);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:11,代码来源:DashMediaPeriod.java

示例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);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:9,代码来源:SsMediaPeriod.java

示例14: release

import com.google.android.exoplayer2.source.chunk.ChunkSampleStream; //导入依赖的package包/类
@Override
public void release() {
  super.release();
  for (ChunkSampleStream<FakeChunkSource> sampleStream : sampleStreams) {
    sampleStream.release();
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:8,代码来源:FakeAdaptiveMediaPeriod.java

示例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);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:8,代码来源:FakeAdaptiveMediaPeriod.java


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