Java 类com.google.android.exoplayer2.source.dash.manifest.SegmentBase.SegmentTimelineElement 实例源码

项目:K-Sonic    文件:DashManifestParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d", C.TIME_UNSET);
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:videoPickPlayer    文件:DashManifestParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d", C.TIME_UNSET);
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:transistor    文件:DashManifestParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d", C.TIME_UNSET);
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:K-Sonic    文件:DashManifestParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, SegmentList parent)
    throws XmlPullParserException, IOException {

  long timescale = parseLong(xpp, "timescale", parent != null ? parent.timescale : 1);
  long presentationTimeOffset = parseLong(xpp, "presentationTimeOffset",
      parent != null ? parent.presentationTimeOffset : 0);
  long duration = parseLong(xpp, "duration", parent != null ? parent.duration : C.TIME_UNSET);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 1);

  RangedUri initialization = null;
  List<SegmentTimelineElement> timeline = null;
  List<RangedUri> segments = null;

  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<>();
      }
      segments.add(parseSegmentUrl(xpp));
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentList"));

  if (parent != null) {
    initialization = initialization != null ? initialization : parent.initialization;
    timeline = timeline != null ? timeline : parent.segmentTimeline;
    segments = segments != null ? segments : parent.mediaSegments;
  }

  return buildSegmentList(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, segments);
}
项目:K-Sonic    文件:DashManifestParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, SegmentTemplate parent)
    throws XmlPullParserException, IOException {
  long timescale = parseLong(xpp, "timescale", parent != null ? parent.timescale : 1);
  long presentationTimeOffset = parseLong(xpp, "presentationTimeOffset",
      parent != null ? parent.presentationTimeOffset : 0);
  long duration = parseLong(xpp, "duration", parent != null ? parent.duration : C.TIME_UNSET);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 1);
  UrlTemplate mediaTemplate = parseUrlTemplate(xpp, "media",
      parent != null ? parent.mediaTemplate : null);
  UrlTemplate initializationTemplate = parseUrlTemplate(xpp, "initialization",
      parent != null ? parent.initializationTemplate : null);

  RangedUri initialization = null;
  List<SegmentTimelineElement> timeline = null;

  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTemplate"));

  if (parent != null) {
    initialization = initialization != null ? initialization : parent.initialization;
    timeline = timeline != null ? timeline : parent.segmentTimeline;
  }

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate);
}
项目:K-Sonic    文件:DashManifestParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate);
}
项目:videoPickPlayer    文件:DashManifestParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, String baseUrl, SegmentList parent)
    throws XmlPullParserException, IOException {

  long timescale = parseLong(xpp, "timescale", parent != null ? parent.timescale : 1);
  long presentationTimeOffset = parseLong(xpp, "presentationTimeOffset",
      parent != null ? parent.presentationTimeOffset : 0);
  long duration = parseLong(xpp, "duration", parent != null ? parent.duration : C.TIME_UNSET);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 1);

  RangedUri initialization = null;
  List<SegmentTimelineElement> timeline = null;
  List<RangedUri> segments = null;

  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentList"));

  if (parent != null) {
    initialization = initialization != null ? initialization : parent.initialization;
    timeline = timeline != null ? timeline : parent.segmentTimeline;
    segments = segments != null ? segments : parent.mediaSegments;
  }

  return buildSegmentList(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, segments);
}
项目:videoPickPlayer    文件:DashManifestParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, String baseUrl,
    SegmentTemplate parent) throws XmlPullParserException, IOException {
  long timescale = parseLong(xpp, "timescale", parent != null ? parent.timescale : 1);
  long presentationTimeOffset = parseLong(xpp, "presentationTimeOffset",
      parent != null ? parent.presentationTimeOffset : 0);
  long duration = parseLong(xpp, "duration", parent != null ? parent.duration : C.TIME_UNSET);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 1);
  UrlTemplate mediaTemplate = parseUrlTemplate(xpp, "media",
      parent != null ? parent.mediaTemplate : null);
  UrlTemplate initializationTemplate = parseUrlTemplate(xpp, "initialization",
      parent != null ? parent.initializationTemplate : null);

  RangedUri initialization = null;
  List<SegmentTimelineElement> timeline = null;

  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTemplate"));

  if (parent != null) {
    initialization = initialization != null ? initialization : parent.initialization;
    timeline = timeline != null ? timeline : parent.segmentTimeline;
  }

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:videoPickPlayer    文件:DashManifestParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate, String baseUrl) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:transistor    文件:DashManifestParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, SegmentList parent)
    throws XmlPullParserException, IOException {

  long timescale = parseLong(xpp, "timescale", parent != null ? parent.timescale : 1);
  long presentationTimeOffset = parseLong(xpp, "presentationTimeOffset",
      parent != null ? parent.presentationTimeOffset : 0);
  long duration = parseLong(xpp, "duration", parent != null ? parent.duration : C.TIME_UNSET);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 1);

  RangedUri initialization = null;
  List<SegmentTimelineElement> timeline = null;
  List<RangedUri> segments = null;

  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<>();
      }
      segments.add(parseSegmentUrl(xpp));
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentList"));

  if (parent != null) {
    initialization = initialization != null ? initialization : parent.initialization;
    timeline = timeline != null ? timeline : parent.segmentTimeline;
    segments = segments != null ? segments : parent.mediaSegments;
  }

  return buildSegmentList(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, segments);
}
项目:transistor    文件:DashManifestParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, SegmentTemplate parent)
    throws XmlPullParserException, IOException {
  long timescale = parseLong(xpp, "timescale", parent != null ? parent.timescale : 1);
  long presentationTimeOffset = parseLong(xpp, "presentationTimeOffset",
      parent != null ? parent.presentationTimeOffset : 0);
  long duration = parseLong(xpp, "duration", parent != null ? parent.duration : C.TIME_UNSET);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 1);
  UrlTemplate mediaTemplate = parseUrlTemplate(xpp, "media",
      parent != null ? parent.mediaTemplate : null);
  UrlTemplate initializationTemplate = parseUrlTemplate(xpp, "initialization",
      parent != null ? parent.initializationTemplate : null);

  RangedUri initialization = null;
  List<SegmentTimelineElement> timeline = null;

  do {
    xpp.next();
    if (XmlPullParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp);
    } else if (XmlPullParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!XmlPullParserUtil.isEndTag(xpp, "SegmentTemplate"));

  if (parent != null) {
    initialization = initialization != null ? initialization : parent.initialization;
    timeline = timeline != null ? timeline : parent.segmentTimeline;
  }

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate);
}
项目:transistor    文件:DashManifestParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate);
}
项目:K-Sonic    文件:DashManifestParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, segments);
}
项目:K-Sonic    文件:DashManifestParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}
项目:videoPickPlayer    文件:DashManifestParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, segments);
}
项目:videoPickPlayer    文件:DashManifestParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}
项目:transistor    文件:DashManifestParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset,
      startNumber, duration, timeline, segments);
}
项目:transistor    文件:DashManifestParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}