com.google.android.exoplayer2.Format.copyWithManifestFormatInfo()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中com.google.android.exoplayer2.Format.copyWithManifestFormatInfo()方法的一些代码示例,展示了Format.copyWithManifestFormatInfo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Format.copyWithManifestFormatInfo()方法的具体详情如下:
包路径:com.google.android.exoplayer2.Format
类名称:Format
方法名:copyWithManifestFormatInfo

Format.copyWithManifestFormatInfo介绍

暂无

代码示例

代码示例来源:origin: google/ExoPlayer

@Override
public void format(Format format) {
 sampleFormat = manifestFormat != null ? format.copyWithManifestFormatInfo(manifestFormat)
   : format;
 trackOutput.format(sampleFormat);
}

代码示例来源:origin: google/ExoPlayer

/**
 * Loads {@link DrmInitData} for a given period in a DASH manifest.
 *
 * @param dataSource The {@link HttpDataSource} from which data should be loaded.
 * @param period The {@link Period}.
 * @return The loaded {@link DrmInitData}, or null if none is defined.
 * @throws IOException Thrown when there is an error while loading.
 * @throws InterruptedException Thrown if the thread was interrupted.
 */
public static @Nullable DrmInitData loadDrmInitData(DataSource dataSource, Period period)
  throws IOException, InterruptedException {
 int primaryTrackType = C.TRACK_TYPE_VIDEO;
 Representation representation = getFirstRepresentation(period, primaryTrackType);
 if (representation == null) {
  primaryTrackType = C.TRACK_TYPE_AUDIO;
  representation = getFirstRepresentation(period, primaryTrackType);
  if (representation == null) {
   return null;
  }
 }
 Format manifestFormat = representation.format;
 Format sampleFormat = DashUtil.loadSampleFormat(dataSource, primaryTrackType, representation);
 return sampleFormat == null
   ? manifestFormat.drmInitData
   : sampleFormat.copyWithManifestFormatInfo(manifestFormat).drmInitData;
}

代码示例来源:origin: google/ExoPlayer

? mediaChunks.get(chunkIndex).trackFormat
    : upstreamTrackFormat;
formatHolder.format = formatHolder.format.copyWithManifestFormatInfo(trackFormat);

代码示例来源:origin: google/ExoPlayer

Format[] formats = new Format[chunkSourceTrackCount];
if (chunkSourceTrackCount == 1) {
 formats[0] = sampleFormat.copyWithManifestFormatInfo(chunkSourceTrackGroup.getFormat(0));
} else {
 for (int j = 0; j < chunkSourceTrackCount; j++) {

相关文章