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


Java InitializationChunk类代码示例

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


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

示例1: onChunkLoadCompleted

import com.google.android.exoplayer2.source.chunk.InitializationChunk; //导入依赖的package包/类
@Override
public void onChunkLoadCompleted(Chunk chunk) {
  if (chunk instanceof InitializationChunk) {
    InitializationChunk initializationChunk = (InitializationChunk) chunk;
    RepresentationHolder representationHolder =
        representationHolders[trackSelection.indexOf(initializationChunk.trackFormat)];
    // The null check avoids overwriting an index obtained from the manifest with one obtained
    // from the stream. If the manifest defines an index then the stream shouldn't, but in cases
    // where it does we should ignore it.
    if (representationHolder.segmentIndex == null) {
      SeekMap seekMap = representationHolder.extractorWrapper.getSeekMap();
      if (seekMap != null) {
        representationHolder.segmentIndex = new DashWrappingSegmentIndex((ChunkIndex) seekMap);
      }
    }
  }
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:18,代码来源:DefaultDashChunkSource.java

示例2: newInitializationChunk

import com.google.android.exoplayer2.source.chunk.InitializationChunk; //导入依赖的package包/类
private static Chunk newInitializationChunk(RepresentationHolder representationHolder,
    DataSource dataSource, Format trackFormat, int trackSelectionReason,
    Object trackSelectionData, RangedUri initializationUri, RangedUri indexUri) {
  RangedUri requestUri;
  String baseUrl = representationHolder.representation.baseUrl;
  if (initializationUri != null) {
    // It's common for initialization and index data to be stored adjacently. Attempt to merge
    // the two requests together to request both at once.
    requestUri = initializationUri.attemptMerge(indexUri, baseUrl);
    if (requestUri == null) {
      requestUri = initializationUri;
    }
  } else {
    requestUri = indexUri;
  }
  DataSpec dataSpec = new DataSpec(requestUri.resolveUri(baseUrl), requestUri.start,
      requestUri.length, representationHolder.representation.getCacheKey());
  return new InitializationChunk(dataSource, dataSpec, trackFormat,
      trackSelectionReason, trackSelectionData, representationHolder.extractorWrapper);
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:21,代码来源:DefaultDashChunkSource.java

示例3: onChunkLoadCompleted

import com.google.android.exoplayer2.source.chunk.InitializationChunk; //导入依赖的package包/类
@Override
public void onChunkLoadCompleted(Chunk chunk) {
  if (chunk instanceof InitializationChunk) {
    InitializationChunk initializationChunk = (InitializationChunk) chunk;
    RepresentationHolder representationHolder =
        representationHolders[trackSelection.indexOf(initializationChunk.trackFormat)];
    Format sampleFormat = initializationChunk.getSampleFormat();
    if (sampleFormat != null) {
      representationHolder.setSampleFormat(sampleFormat);
    }
    // The null check avoids overwriting an index obtained from the manifest with one obtained
    // from the stream. If the manifest defines an index then the stream shouldn't, but in cases
    // where it does we should ignore it.
    if (representationHolder.segmentIndex == null) {
      SeekMap seekMap = initializationChunk.getSeekMap();
      if (seekMap != null) {
        representationHolder.segmentIndex = new DashWrappingSegmentIndex((ChunkIndex) seekMap,
            initializationChunk.dataSpec.uri.toString());
      }
    }
  }
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:23,代码来源:DefaultDashChunkSource.java

示例4: newInitializationChunk

import com.google.android.exoplayer2.source.chunk.InitializationChunk; //导入依赖的package包/类
private Chunk newInitializationChunk(RepresentationHolder representationHolder,
    DataSource dataSource, Format trackFormat, int trackSelectionReason,
    Object trackSelectionData, RangedUri initializationUri, RangedUri indexUri) {
  RangedUri requestUri;
  if (initializationUri != null) {
    // It's common for initialization and index data to be stored adjacently. Attempt to merge
    // the two requests together to request both at once.
    requestUri = initializationUri.attemptMerge(indexUri);
    if (requestUri == null) {
      requestUri = initializationUri;
    }
  } else {
    requestUri = indexUri;
  }
  DataSpec dataSpec = new DataSpec(requestUri.getUri(), requestUri.start, requestUri.length,
      representationHolder.representation.getCacheKey());
  return new InitializationChunk(dataSource, dataSpec, trackFormat,
      trackSelectionReason, trackSelectionData, representationHolder.extractorWrapper);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:20,代码来源:DefaultDashChunkSource.java

示例5: newInitializationChunk

import com.google.android.exoplayer2.source.chunk.InitializationChunk; //导入依赖的package包/类
protected static Chunk newInitializationChunk(RepresentationHolder representationHolder,
    DataSource dataSource, Format trackFormat, int trackSelectionReason,
    Object trackSelectionData, RangedUri initializationUri, RangedUri indexUri) {
  RangedUri requestUri;
  String baseUrl = representationHolder.representation.baseUrl;
  if (initializationUri != null) {
    // It's common for initialization and index data to be stored adjacently. Attempt to merge
    // the two requests together to request both at once.
    requestUri = initializationUri.attemptMerge(indexUri, baseUrl);
    if (requestUri == null) {
      requestUri = initializationUri;
    }
  } else {
    requestUri = indexUri;
  }
  DataSpec dataSpec = new DataSpec(requestUri.resolveUri(baseUrl), requestUri.start,
      requestUri.length, representationHolder.representation.getCacheKey());
  return new InitializationChunk(dataSource, dataSpec, trackFormat,
      trackSelectionReason, trackSelectionData, representationHolder.extractorWrapper);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:21,代码来源:DefaultDashChunkSource.java

示例6: loadInitializationData

import com.google.android.exoplayer2.source.chunk.InitializationChunk; //导入依赖的package包/类
private static void loadInitializationData(DataSource dataSource,
    Representation representation, ChunkExtractorWrapper extractorWrapper, RangedUri requestUri)
    throws IOException, InterruptedException {
  DataSpec dataSpec = new DataSpec(requestUri.resolveUri(representation.baseUrl),
      requestUri.start, requestUri.length, representation.getCacheKey());
  InitializationChunk initializationChunk = new InitializationChunk(dataSource, dataSpec,
      representation.format, C.SELECTION_REASON_UNKNOWN, null /* trackSelectionData */,
      extractorWrapper);
  initializationChunk.load();
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:11,代码来源:DashUtil.java


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