Java 类com.google.android.exoplayer.dash.mpd.SegmentBase.SegmentTimelineElement 实例源码

项目:miku    文件:MediaPresentationDescriptionParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d");
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:ExoPlayer-Demo    文件:MediaPresentationDescriptionParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (ParserUtil.isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d");
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!ParserUtil.isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:ExoPlayer-Demo    文件:DashChunkSourceTest.java   
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);
}
项目:android-exoplayer    文件:MediaPresentationDescriptionParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<SegmentTimelineElement>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d");
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:Exoplayer_VLC    文件:MediaPresentationDescriptionParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<SegmentTimelineElement>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d");
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:edx-app-android    文件:MediaPresentationDescriptionParser.java   
private List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<SegmentTimelineElement>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d");
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(new SegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:ExoPlayer    文件:MediaPresentationDescriptionParser.java   
protected List<SegmentTimelineElement> parseSegmentTimeline(XmlPullParser xpp)
    throws XmlPullParserException, IOException {
  List<SegmentTimelineElement> segmentTimeline = new ArrayList<>();
  long elapsedTime = 0;
  do {
    xpp.next();
    if (isStartTag(xpp, "S")) {
      elapsedTime = parseLong(xpp, "t", elapsedTime);
      long duration = parseLong(xpp, "d");
      int count = 1 + parseInt(xpp, "r", 0);
      for (int i = 0; i < count; i++) {
        segmentTimeline.add(buildSegmentTimelineElement(elapsedTime, duration));
        elapsedTime += duration;
      }
    }
  } while (!isEndTag(xpp, "SegmentTimeline"));
  return segmentTimeline;
}
项目:ExoPlayer    文件:DashChunkSourceTest.java   
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);
}
项目:miku    文件:MediaPresentationDescriptionParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, String baseUrl, SegmentList parent,
    long periodDurationMs) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!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, periodDurationMs,
      startNumber, duration, timeline, segments);
}
项目:miku    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, String baseUrl,
    SegmentTemplate parent, long periodDurationMs) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!isEndTag(xpp, "SegmentTemplate"));

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

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:miku    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDurationMs, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate, String baseUrl) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:ExoPlayer-Demo    文件:MediaPresentationDescriptionParser.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 : -1);
  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 (ParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (ParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (ParserUtil.isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!ParserUtil.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);
}
项目:ExoPlayer-Demo    文件:MediaPresentationDescriptionParser.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 : -1);
  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 (ParserUtil.isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (ParserUtil.isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!ParserUtil.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);
}
项目:ExoPlayer-Demo    文件:MediaPresentationDescriptionParser.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);
}
项目:android-exoplayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, Uri baseUrl, SegmentList parent,
    long periodDuration) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<RangedUri>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!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, periodDuration,
      startNumber, duration, timeline, segments);
}
项目:android-exoplayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, Uri baseUrl,
    SegmentTemplate parent, long periodDuration) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!isEndTag(xpp, "SegmentTemplate"));

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

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset, periodDuration,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:android-exoplayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDuration, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate, Uri baseUrl) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset, periodDuration,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:Exoplayer_VLC    文件:MediaPresentationDescriptionParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, Uri baseUrl, SegmentList parent,
    long periodDurationMs) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<RangedUri>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!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, periodDurationMs,
      startNumber, duration, timeline, segments);
}
项目:Exoplayer_VLC    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, Uri baseUrl,
    SegmentTemplate parent, long periodDurationMs) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!isEndTag(xpp, "SegmentTemplate"));

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

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:Exoplayer_VLC    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDurationMs, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate, Uri baseUrl) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:edx-app-android    文件:MediaPresentationDescriptionParser.java   
private SegmentList parseSegmentList(XmlPullParser xpp, Uri baseUrl, SegmentList parent,
    long periodDuration) 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 : -1);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 0);

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

  do {
    xpp.next();
    if (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<RangedUri>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!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 new SegmentList(initialization, timescale, presentationTimeOffset, periodDuration,
      startNumber, duration, timeline, segments);
}
项目:edx-app-android    文件:MediaPresentationDescriptionParser.java   
private SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, Uri baseUrl,
    SegmentTemplate parent, long periodDuration) 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 : -1);
  int startNumber = parseInt(xpp, "startNumber", parent != null ? parent.startNumber : 0);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!isEndTag(xpp, "SegmentTemplate"));

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

  return new SegmentTemplate(initialization, timescale, presentationTimeOffset, periodDuration,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:ExoPlayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentList parseSegmentList(XmlPullParser xpp, String baseUrl, SegmentList parent,
    long periodDurationMs) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    } else if (isStartTag(xpp, "SegmentURL")) {
      if (segments == null) {
        segments = new ArrayList<>();
      }
      segments.add(parseSegmentUrl(xpp, baseUrl));
    }
  } while (!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, periodDurationMs,
      startNumber, duration, timeline, segments);
}
项目:ExoPlayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate parseSegmentTemplate(XmlPullParser xpp, String baseUrl,
    SegmentTemplate parent, long periodDurationMs) 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 : -1);
  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 (isStartTag(xpp, "Initialization")) {
      initialization = parseInitialization(xpp, baseUrl);
    } else if (isStartTag(xpp, "SegmentTimeline")) {
      timeline = parseSegmentTimeline(xpp);
    }
  } while (!isEndTag(xpp, "SegmentTemplate"));

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

  return buildSegmentTemplate(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:ExoPlayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentTemplate buildSegmentTemplate(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDurationMs, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, UrlTemplate initializationTemplate,
    UrlTemplate mediaTemplate, String baseUrl) {
  return new SegmentTemplate(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, initializationTemplate, mediaTemplate, baseUrl);
}
项目:miku    文件:MediaPresentationDescriptionParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDurationMs, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, segments);
}
项目:miku    文件:MediaPresentationDescriptionParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}
项目:ExoPlayer-Demo    文件:MediaPresentationDescriptionParser.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);
}
项目:ExoPlayer-Demo    文件:MediaPresentationDescriptionParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}
项目:android-exoplayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDuration, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset, periodDuration,
      startNumber, duration, timeline, segments);
}
项目:android-exoplayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}
项目:Exoplayer_VLC    文件:MediaPresentationDescriptionParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDurationMs, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, segments);
}
项目:Exoplayer_VLC    文件:MediaPresentationDescriptionParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}
项目:ExoPlayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentList buildSegmentList(RangedUri initialization, long timescale,
    long presentationTimeOffset, long periodDurationMs, int startNumber, long duration,
    List<SegmentTimelineElement> timeline, List<RangedUri> segments) {
  return new SegmentList(initialization, timescale, presentationTimeOffset, periodDurationMs,
      startNumber, duration, timeline, segments);
}
项目:ExoPlayer    文件:MediaPresentationDescriptionParser.java   
protected SegmentTimelineElement buildSegmentTimelineElement(long elapsedTime, long duration) {
  return new SegmentTimelineElement(elapsedTime, duration);
}