@Test public void testGetPeriodPositionDynamicWindowKnownDuration() { long windowDurationUs = 1000; SinglePeriodTimeline timeline = new SinglePeriodTimeline( windowDurationUs, windowDurationUs, 0, 0, false, true, null); Pair<Object, Long> position = timeline.getPeriodPosition(window, period, 0, C.TIME_UNSET, windowDurationUs + 1); assertThat(position).isNull(); position = timeline.getPeriodPosition(window, period, 0, C.TIME_UNSET, windowDurationUs); assertThat(position.first).isEqualTo(timeline.getUidOfPeriod(0)); assertThat(position.second).isEqualTo(windowDurationUs); position = timeline.getPeriodPosition(window, period, 0, C.TIME_UNSET, 0); assertThat(position.first).isEqualTo(timeline.getUidOfPeriod(0)); assertThat(position.second).isEqualTo(0); }
@Override public Object getUidOfPeriod(int periodIndex) { Assertions.checkIndex(periodIndex, 0, 1); return UID; }
SinglePeriodTimeline extends Timeline { @Override public Object getUidOfPeriod(int periodIndex) { Assertions.checkIndex(periodIndex, 0, 1); return UID; } }
SinglePeriodTimeline extends Timeline { @Override public Object getUidOfPeriod(int periodIndex) { Assertions.checkIndex(periodIndex, 0, 1); return UID; } SinglePeriodTimeline(long durationUs, boolean isSeekable, boolean isDynamic);  SinglePeriodTimeline(
      long durationUs, boolean isSeekable, boolean isDynamic, @Nullable Object tag);  SinglePeriodTimeline(
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag);  SinglePeriodTimeline(
      long presentationStartTimeMs,
      long windowStartTimeMs,
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag); }
SinglePeriodTimeline extends Timeline { @Override public Object getUidOfPeriod(int periodIndex) { Assertions.checkIndex(periodIndex, 0, 1); return UID; } SinglePeriodTimeline(long durationUs, boolean isSeekable, boolean isDynamic);  SinglePeriodTimeline(
      long durationUs, boolean isSeekable, boolean isDynamic, @Nullable Object tag);  SinglePeriodTimeline(
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag);  SinglePeriodTimeline(
      long presentationStartTimeMs,
      long windowStartTimeMs,
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag); @Override int getWindowCount(); @Override Window getWindow(
      int windowIndex, Window window, boolean setTag, long defaultPositionProjectionUs); @Override int getPeriodCount(); @Override Period getPeriod(int periodIndex, Period period, boolean setIds); @Override int getIndexOfPeriod(Object uid); @Override Object getUidOfPeriod(int periodIndex); }
SinglePeriodTimeline extends Timeline { @Override public Object getUidOfPeriod(int periodIndex) { Assertions.checkIndex(periodIndex, 0, 1); return UID; } SinglePeriodTimeline(long durationUs, boolean isSeekable, boolean isDynamic);  SinglePeriodTimeline(
      long durationUs, boolean isSeekable, boolean isDynamic, @Nullable Object tag);  SinglePeriodTimeline(
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag);  SinglePeriodTimeline(
      long presentationStartTimeMs,
      long windowStartTimeMs,
      long periodDurationUs,
      long windowDurationUs,
      long windowPositionInPeriodUs,
      long windowDefaultStartPositionUs,
      boolean isSeekable,
      boolean isDynamic,
      @Nullable Object tag); @Override int getWindowCount(); @Override Window getWindow(
      int windowIndex, Window window, boolean setTag, long defaultPositionProjectionUs); @Override int getPeriodCount(); @Override Period getPeriod(int periodIndex, Period period, boolean setIds); @Override int getIndexOfPeriod(Object uid); @Override Object getUidOfPeriod(int periodIndex);  }