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


Java SsManifest类代码示例

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


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

示例1: SsMediaSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
private SsMediaSource(SsManifest manifest, Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory, SsManifestParser manifestParser,
    SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
    long livePresentationDelayMs, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  Assertions.checkState(manifest == null || !manifest.isLive);
  this.manifest = manifest;
  this.manifestUri = manifestUri == null ? null
      : Util.toLowerInvariant(manifestUri.getLastPathSegment()).equals("manifest") ? manifestUri
          : Uri.withAppendedPath(manifestUri, "Manifest");
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  this.manifestParser = manifestParser;
  this.chunkSourceFactory = chunkSourceFactory;
  this.minLoadableRetryCount = minLoadableRetryCount;
  this.livePresentationDelayMs = livePresentationDelayMs;
  this.eventDispatcher = new EventDispatcher(eventHandler, eventListener);
  mediaPeriods = new ArrayList<>();
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:19,代码来源:SsMediaSource.java

示例2: DefaultSsChunkSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
/**
 * @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
 * @param manifest The initial manifest.
 * @param elementIndex The index of the stream element in the manifest.
 * @param trackSelection The track selection.
 * @param dataSource A {@link DataSource} suitable for loading the media data.
 * @param trackEncryptionBoxes Track encryption boxes for the stream.
 */
public DefaultSsChunkSource(LoaderErrorThrower manifestLoaderErrorThrower, SsManifest manifest,
    int elementIndex, TrackSelection trackSelection, DataSource dataSource,
    TrackEncryptionBox[] trackEncryptionBoxes) {
  this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
  this.manifest = manifest;
  this.elementIndex = elementIndex;
  this.trackSelection = trackSelection;
  this.dataSource = dataSource;

  StreamElement streamElement = manifest.streamElements[elementIndex];

  extractorWrappers = new ChunkExtractorWrapper[trackSelection.length()];
  for (int i = 0; i < extractorWrappers.length; i++) {
    int manifestTrackIndex = trackSelection.getIndexInTrackGroup(i);
    Format format = streamElement.formats[manifestTrackIndex];
    int nalUnitLengthFieldLength = streamElement.type == C.TRACK_TYPE_VIDEO ? 4 : 0;
    Track track = new Track(manifestTrackIndex, streamElement.type, streamElement.timescale,
        C.TIME_UNSET, manifest.durationUs, format, Track.TRANSFORMATION_NONE,
        trackEncryptionBoxes, nalUnitLengthFieldLength, null, null);
    FragmentedMp4Extractor extractor = new FragmentedMp4Extractor(
        FragmentedMp4Extractor.FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
        | FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_TFDT_BOX, null, track);
    extractorWrappers[i] = new ChunkExtractorWrapper(extractor, format);
  }
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:34,代码来源:DefaultSsChunkSource.java

示例3: updateManifest

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
@Override
public void updateManifest(SsManifest newManifest) {
  StreamElement currentElement = manifest.streamElements[elementIndex];
  int currentElementChunkCount = currentElement.chunkCount;
  StreamElement newElement = newManifest.streamElements[elementIndex];
  if (currentElementChunkCount == 0 || newElement.chunkCount == 0) {
    // There's no overlap between the old and new elements because at least one is empty.
    currentManifestChunkOffset += currentElementChunkCount;
  } else {
    long currentElementEndTimeUs = currentElement.getStartTimeUs(currentElementChunkCount - 1)
        + currentElement.getChunkDurationUs(currentElementChunkCount - 1);
    long newElementStartTimeUs = newElement.getStartTimeUs(0);
    if (currentElementEndTimeUs <= newElementStartTimeUs) {
      // There's no overlap between the old and new elements.
      currentManifestChunkOffset += currentElementChunkCount;
    } else {
      // The new element overlaps with the old one.
      currentManifestChunkOffset += currentElement.getChunkIndex(newElementStartTimeUs);
    }
  }
  manifest = newManifest;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:23,代码来源:DefaultSsChunkSource.java

示例4: SsMediaPeriod

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
public SsMediaPeriod(SsManifest manifest, SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount, EventDispatcher eventDispatcher,
    LoaderErrorThrower manifestLoaderErrorThrower, Allocator allocator) {
  this.chunkSourceFactory = chunkSourceFactory;
  this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
  this.minLoadableRetryCount = minLoadableRetryCount;
  this.eventDispatcher = eventDispatcher;
  this.allocator = allocator;

  trackGroups = buildTrackGroups(manifest);
  ProtectionElement protectionElement = manifest.protectionElement;
  if (protectionElement != null) {
    byte[] keyId = getProtectionElementKeyId(protectionElement.data);
    trackEncryptionBoxes = new TrackEncryptionBox[] {
        new TrackEncryptionBox(true, INITIALIZATION_VECTOR_SIZE, keyId)};
  } else {
    trackEncryptionBoxes = null;
  }
  this.manifest = manifest;
  sampleStreams = newSampleStreamArray(0);
  sequenceableLoader = new CompositeSequenceableLoader(sampleStreams);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:23,代码来源:SsMediaPeriod.java

示例5: DefaultSsChunkSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
/**
 * @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
 * @param manifest The initial manifest.
 * @param elementIndex The index of the stream element in the manifest.
 * @param trackSelection The track selection.
 * @param dataSource A {@link DataSource} suitable for loading the media data.
 * @param trackEncryptionBoxes Track encryption boxes for the stream.
 */
public DefaultSsChunkSource(LoaderErrorThrower manifestLoaderErrorThrower, SsManifest manifest,
    int elementIndex, TrackSelection trackSelection, DataSource dataSource,
    TrackEncryptionBox[] trackEncryptionBoxes) {
  this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
  this.manifest = manifest;
  this.elementIndex = elementIndex;
  this.trackSelection = trackSelection;
  this.dataSource = dataSource;

  StreamElement streamElement = manifest.streamElements[elementIndex];

  extractorWrappers = new ChunkExtractorWrapper[trackSelection.length()];
  for (int i = 0; i < extractorWrappers.length; i++) {
    int manifestTrackIndex = trackSelection.getIndexInTrackGroup(i);
    Format format = streamElement.formats[manifestTrackIndex];
    int nalUnitLengthFieldLength = streamElement.type == C.TRACK_TYPE_VIDEO ? 4 : 0;
    Track track = new Track(manifestTrackIndex, streamElement.type, streamElement.timescale,
        C.TIME_UNSET, manifest.durationUs, format, Track.TRANSFORMATION_NONE,
        trackEncryptionBoxes, nalUnitLengthFieldLength, null, null);
    FragmentedMp4Extractor extractor = new FragmentedMp4Extractor(
        FragmentedMp4Extractor.FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
        | FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_TFDT_BOX, track, null);
    extractorWrappers[i] = new ChunkExtractorWrapper(extractor, format, false, false);
  }
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:34,代码来源:DefaultSsChunkSource.java

示例6: createMediaSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
/**
 * Returns a new {@link SsMediaSource} using the current parameters and the specified sideloaded
 * manifest.
 *
 * @param manifest The manifest. {@link SsManifest#isLive} must be false.
 * @param eventHandler A handler for events.
 * @param eventListener A listener of events.
 * @return The new {@link SsMediaSource}.
 * @throws IllegalArgumentException If {@link SsManifest#isLive} is true.
 */
public SsMediaSource createMediaSource(
    SsManifest manifest,
    @Nullable Handler eventHandler,
    @Nullable MediaSourceEventListener eventListener) {
  Assertions.checkArgument(!manifest.isLive);
  isCreateCalled = true;
  return new SsMediaSource(
      manifest,
      null,
      null,
      null,
      chunkSourceFactory,
      minLoadableRetryCount,
      livePresentationDelayMs,
      eventHandler,
      eventListener);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:28,代码来源:SsMediaSource.java

示例7: SsMediaSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
private SsMediaSource(SsManifest manifest, Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends SsManifest> manifestParser,
    SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
    long livePresentationDelayMs, Handler eventHandler,
    MediaSourceEventListener eventListener) {
  Assertions.checkState(manifest == null || !manifest.isLive);
  this.manifest = manifest;
  this.manifestUri = manifestUri == null ? null
      : Util.toLowerInvariant(manifestUri.getLastPathSegment()).matches("manifest(\\(.+\\))?")
          ? manifestUri : Uri.withAppendedPath(manifestUri, "Manifest");
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  this.manifestParser = manifestParser;
  this.chunkSourceFactory = chunkSourceFactory;
  this.minLoadableRetryCount = minLoadableRetryCount;
  this.livePresentationDelayMs = livePresentationDelayMs;
  this.eventDispatcher = new EventDispatcher(eventHandler, eventListener);
  mediaPeriods = new ArrayList<>();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:20,代码来源:SsMediaSource.java

示例8: DefaultSsChunkSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
/**
 * @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
 * @param manifest The initial manifest.
 * @param elementIndex The index of the stream element in the manifest.
 * @param trackSelection The track selection.
 * @param dataSource A {@link DataSource} suitable for loading the media data.
 * @param trackEncryptionBoxes Track encryption boxes for the stream.
 */
public DefaultSsChunkSource(LoaderErrorThrower manifestLoaderErrorThrower, SsManifest manifest,
    int elementIndex, TrackSelection trackSelection, DataSource dataSource,
    TrackEncryptionBox[] trackEncryptionBoxes) {
  this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
  this.manifest = manifest;
  this.elementIndex = elementIndex;
  this.trackSelection = trackSelection;
  this.dataSource = dataSource;

  StreamElement streamElement = manifest.streamElements[elementIndex];

  extractorWrappers = new ChunkExtractorWrapper[trackSelection.length()];
  for (int i = 0; i < extractorWrappers.length; i++) {
    int manifestTrackIndex = trackSelection.getIndexInTrackGroup(i);
    Format format = streamElement.formats[manifestTrackIndex];
    int nalUnitLengthFieldLength = streamElement.type == C.TRACK_TYPE_VIDEO ? 4 : 0;
    Track track = new Track(manifestTrackIndex, streamElement.type, streamElement.timescale,
        C.TIME_UNSET, manifest.durationUs, format, Track.TRANSFORMATION_NONE,
        trackEncryptionBoxes, nalUnitLengthFieldLength, null, null);
    FragmentedMp4Extractor extractor = new FragmentedMp4Extractor(
        FragmentedMp4Extractor.FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
        | FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_TFDT_BOX, null, track, null);
    extractorWrappers[i] = new ChunkExtractorWrapper(extractor, streamElement.type, format);
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:34,代码来源:DefaultSsChunkSource.java

示例9: SsMediaPeriod

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
public SsMediaPeriod(SsManifest manifest, SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount, EventDispatcher eventDispatcher,
    LoaderErrorThrower manifestLoaderErrorThrower, Allocator allocator) {
  this.chunkSourceFactory = chunkSourceFactory;
  this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
  this.minLoadableRetryCount = minLoadableRetryCount;
  this.eventDispatcher = eventDispatcher;
  this.allocator = allocator;

  trackGroups = buildTrackGroups(manifest);
  ProtectionElement protectionElement = manifest.protectionElement;
  if (protectionElement != null) {
    byte[] keyId = getProtectionElementKeyId(protectionElement.data);
    // We assume pattern encryption does not apply.
    trackEncryptionBoxes = new TrackEncryptionBox[] {
        new TrackEncryptionBox(true, null, INITIALIZATION_VECTOR_SIZE, keyId, 0, 0, null)};
  } else {
    trackEncryptionBoxes = null;
  }
  this.manifest = manifest;
  sampleStreams = newSampleStreamArray(0);
  sequenceableLoader = new CompositeSequenceableLoader(sampleStreams);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:24,代码来源:SsMediaPeriod.java

示例10: onLoadCompleted

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
@Override
public void onLoadCompleted(ParsingLoadable<SsManifest> loadable, long elapsedRealtimeMs,
    long loadDurationMs) {
  eventDispatcher.loadCompleted(loadable.dataSpec, loadable.type, elapsedRealtimeMs,
      loadDurationMs, loadable.bytesLoaded());
  manifest = loadable.getResult();
  manifestLoadStartTimestamp = elapsedRealtimeMs - loadDurationMs;
  processManifest();
  scheduleManifestRefresh();
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:11,代码来源:SsMediaSource.java

示例11: onLoadError

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
@Override
public int onLoadError(ParsingLoadable<SsManifest> loadable, long elapsedRealtimeMs,
    long loadDurationMs, IOException error) {
  boolean isFatal = error instanceof ParserException;
  eventDispatcher.loadError(loadable.dataSpec, loadable.type, elapsedRealtimeMs, loadDurationMs,
      loadable.bytesLoaded(), error, isFatal);
  return isFatal ? Loader.DONT_RETRY_FATAL : Loader.RETRY;
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:9,代码来源:SsMediaSource.java

示例12: createChunkSource

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
@Override
public SsChunkSource createChunkSource(LoaderErrorThrower manifestLoaderErrorThrower,
    SsManifest manifest, int elementIndex, TrackSelection trackSelection,
    TrackEncryptionBox[] trackEncryptionBoxes) {
  DataSource dataSource = dataSourceFactory.createDataSource();
  return new DefaultSsChunkSource(manifestLoaderErrorThrower, manifest, elementIndex,
      trackSelection, dataSource, trackEncryptionBoxes);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:9,代码来源:DefaultSsChunkSource.java

示例13: updateManifest

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的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

示例14: buildTrackGroups

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
private static TrackGroupArray buildTrackGroups(SsManifest manifest) {
  TrackGroup[] trackGroups = new TrackGroup[manifest.streamElements.length];
  for (int i = 0; i < manifest.streamElements.length; i++) {
    trackGroups[i] = new TrackGroup(manifest.streamElements[i].formats);
  }
  return new TrackGroupArray(trackGroups);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:8,代码来源:SsMediaPeriod.java

示例15: getManifest

import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest; //导入依赖的package包/类
@Override
public SsManifest getManifest(DataSource dataSource, Uri uri) throws IOException {
  DataSpec dataSpec = new DataSpec(uri,
      DataSpec.FLAG_ALLOW_CACHING_UNKNOWN_LENGTH | DataSpec.FLAG_ALLOW_GZIP);
  ParsingLoadable<SsManifest> loadable = new ParsingLoadable<>(dataSource, dataSpec,
      C.DATA_TYPE_MANIFEST, new SsManifestParser());
  loadable.load();
  return loadable.getResult();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:10,代码来源:SsDownloader.java


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