• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MultiSegmentBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: buildSegmentTimelineRepresentation

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
private static Representation buildSegmentTimelineRepresentation(long timelineDurationMs,
    long timelineStartTimeMs) {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  List<RangedUri> mediaSegments = new ArrayList<>();
  long segmentStartTimeMs = timelineStartTimeMs;
  long byteStart = 0;
  // Create all but the last segment with LIVE_SEGMENT_DURATION_MS.
  int segmentCount = (int) Util.ceilDivide(timelineDurationMs, LIVE_SEGMENT_DURATION_MS);
  for (int i = 0; i < segmentCount - 1; i++) {
    segmentTimeline.add(new SegmentTimelineElement(segmentStartTimeMs, LIVE_SEGMENT_DURATION_MS));
    mediaSegments.add(new RangedUri("", "", byteStart, 500L));
    segmentStartTimeMs += LIVE_SEGMENT_DURATION_MS;
    byteStart += 500;
  }
  // The final segment duration is calculated so that the total duration is timelineDurationMs.
  long finalSegmentDurationMs = (timelineStartTimeMs + timelineDurationMs) - segmentStartTimeMs;
  segmentTimeline.add(new SegmentTimelineElement(segmentStartTimeMs, finalSegmentDurationMs));
  mediaSegments.add(new RangedUri("", "", byteStart, 500L));
  segmentStartTimeMs += finalSegmentDurationMs;
  byteStart += 500;
  // Construct the list.
  MultiSegmentBase segmentBase = new SegmentList(null, 1000, 0, 0, 0, segmentTimeline,
      mediaSegments);
  return Representation.newInstance(null, 0, REGULAR_VIDEO, segmentBase);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:26,代码来源:DashChunkSourceTest.java


示例2: generateSegmentTimelineRepresentation

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
private static Representation generateSegmentTimelineRepresentation(long segmentStartMs,
    long periodStartMs, long duration) {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  List<RangedUri> mediaSegments = new ArrayList<>();
  long segmentStartTimeMs = segmentStartMs;
  long byteStart = 0;
  for (int i = 0; i < (duration / LIVE_SEGMENT_DURATION_MS); i++) {
    segmentTimeline.add(new SegmentTimelineElement(segmentStartTimeMs, LIVE_SEGMENT_DURATION_MS));
    mediaSegments.add(new RangedUri("", "", byteStart, 500L));
    segmentStartTimeMs += LIVE_SEGMENT_DURATION_MS;
    byteStart += 500;
  }

  int startNumber = (int) ((periodStartMs + segmentStartMs) / LIVE_SEGMENT_DURATION_MS);
  MultiSegmentBase segmentBase = new SegmentList(null, 1000, 0,
      TrackRenderer.UNKNOWN_TIME_US, startNumber, TrackRenderer.UNKNOWN_TIME_US, segmentTimeline,
      mediaSegments);
  return Representation.newInstance(periodStartMs, TrackRenderer.UNKNOWN_TIME_US, null, 0,
      REGULAR_VIDEO, segmentBase);
}
 
开发者ID:raphanda,项目名称:ExoPlayer,代码行数:21,代码来源:DashChunkSourceTest.java


示例3: newInstance

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
/**
 * Constructs a new instance.
 *
 * @param periodStartMs The start time of the enclosing period in milliseconds.
 * @param periodDurationMs The duration of the enclosing period in milliseconds, or -1 if the
 *     duration is unknown.
 * @param contentId Identifies the piece of content to which this representation belongs.
 * @param revisionId Identifies the revision of the content.
 * @param format The format of the representation.
 * @param segmentBase A segment base element for the representation.
 * @return The constructed instance.
 */
public static Representation newInstance(long periodStartMs, long periodDurationMs,
    String contentId, long revisionId, Format format, SegmentBase segmentBase) {
  if (segmentBase instanceof SingleSegmentBase) {
    return new SingleSegmentRepresentation(periodStartMs, periodDurationMs, contentId, revisionId,
        format, (SingleSegmentBase) segmentBase, -1);
  } else if (segmentBase instanceof MultiSegmentBase) {
    return new MultiSegmentRepresentation(periodStartMs, periodDurationMs, contentId, revisionId,
        format, (MultiSegmentBase) segmentBase);
  } else {
    throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or "
        + "MultiSegmentBase");
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:26,代码来源:Representation.java


示例4: newInstance

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
/**
 * Constructs a new instance.
 *
 * @param contentId Identifies the piece of content to which this representation belongs.
 * @param revisionId Identifies the revision of the content.
 * @param format The format of the representation.
 * @param segmentBase A segment base element for the representation.
 * @param customCacheKey A custom value to be returned from {@link #getCacheKey()}, or null.
 * @return The constructed instance.
 */
public static Representation newInstance(String contentId, long revisionId, Format format,
    SegmentBase segmentBase, String customCacheKey) {
  if (segmentBase instanceof SingleSegmentBase) {
    return new SingleSegmentRepresentation(contentId, revisionId, format,
        (SingleSegmentBase) segmentBase, customCacheKey, -1);
  } else if (segmentBase instanceof MultiSegmentBase) {
    return new MultiSegmentRepresentation(contentId, revisionId, format,
        (MultiSegmentBase) segmentBase, customCacheKey);
  } else {
    throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or "
        + "MultiSegmentBase");
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:24,代码来源:Representation.java


示例5: buildSegmentTemplateRepresentation

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
private static Representation buildSegmentTemplateRepresentation() {
  UrlTemplate initializationTemplate = null;
  UrlTemplate mediaTemplate = UrlTemplate.compile("$RepresentationID$/$Number$");
  MultiSegmentBase segmentBase = new SegmentTemplate(null, 1000, 0, 0, LIVE_SEGMENT_DURATION_MS,
      null, initializationTemplate, mediaTemplate, "http://www.youtube.com");
  return Representation.newInstance(null, 0, REGULAR_VIDEO, segmentBase);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:8,代码来源:DashChunkSourceTest.java


示例6: generateLiveMpdWithTemplate

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
private static MediaPresentationDescription generateLiveMpdWithTemplate(
    boolean limitTimeshiftBuffer) {
  List<Representation> representations = new ArrayList<>();

  UrlTemplate initializationTemplate = null;
  UrlTemplate mediaTemplate = UrlTemplate.compile("$RepresentationID$/$Number$");
  MultiSegmentBase segmentBase = new SegmentTemplate(null, 1000, 0,
      TrackRenderer.UNKNOWN_TIME_US, 0, LIVE_SEGMENT_DURATION_MS, null,
      initializationTemplate, mediaTemplate, "http://www.youtube.com");
  Representation representation = Representation.newInstance(0, TrackRenderer.UNKNOWN_TIME_US,
      null, 0, REGULAR_VIDEO, segmentBase);
  representations.add(representation);

  return generateMpd(true, representations, limitTimeshiftBuffer);
}
 
开发者ID:raphanda,项目名称:ExoPlayer,代码行数:16,代码来源:DashChunkSourceTest.java


示例7: MultiSegmentRepresentation

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
/**
 * @param periodStartMs The start time of the enclosing period in milliseconds.
 * @param periodDurationMs The duration of the enclosing period in milliseconds, or -1 if the
 *     duration is unknown.
 * @param contentId Identifies the piece of content to which this representation belongs.
 * @param revisionId Identifies the revision of the content.
 * @param format The format of the representation.
 * @param segmentBase The segment base underlying the representation.
 */
public MultiSegmentRepresentation(long periodStartMs, long periodDurationMs, String contentId,
    long revisionId, Format format, MultiSegmentBase segmentBase) {
  super(periodStartMs, periodDurationMs, contentId, revisionId, format, segmentBase);
  this.segmentBase = segmentBase;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:15,代码来源:Representation.java


示例8: MultiSegmentRepresentation

import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase; //导入依赖的package包/类
/**
 * @param contentId Identifies the piece of content to which this representation belongs.
 * @param revisionId Identifies the revision of the content.
 * @param format The format of the representation.
 * @param segmentBase The segment base underlying the representation.
 * @param customCacheKey A custom value to be returned from {@link #getCacheKey()}, or null.
 */
public MultiSegmentRepresentation(String contentId, long revisionId, Format format,
    MultiSegmentBase segmentBase, String customCacheKey) {
  super(contentId, revisionId, format, segmentBase, customCacheKey);
  this.segmentBase = segmentBase;
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:13,代码来源:Representation.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PKIFreeText类代码示例发布时间:2022-05-22
下一篇:
Java ModifyInstanceAttributeRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap