Timeline.Period, Timeline.Window
Constructor and Description |
---|
SinglePeriodTimeline(long durationUs,
boolean isSeekable)
Creates a timeline of one period of known duration, and a static window starting at zero and
extending to that duration.
|
SinglePeriodTimeline(long periodDurationUs,
long windowDurationUs,
long windowPositionInPeriodUs,
long windowDefaultStartPositionUs,
boolean isSeekable,
boolean isDynamic)
Creates a timeline with one period of known duration, and a window of known duration starting
at a specified position in the period.
|
Modifier and Type | Method and Description |
---|---|
int |
getIndexOfPeriod(java.lang.Object uid)
Returns the index of the period identified by its unique
id , or C.INDEX_UNSET
if the period is not in the timeline. |
Timeline.Period |
getPeriod(int periodIndex,
Timeline.Period period,
boolean setIds)
Populates a
Timeline.Period with data for the period at the specified index. |
int |
getPeriodCount()
Returns the number of periods in the timeline.
|
Timeline.Window |
getWindow(int windowIndex,
Timeline.Window window,
boolean setIds)
Populates a
Timeline.Window with data for the window at the specified index. |
int |
getWindowCount()
Returns the number of windows in the timeline.
|
public SinglePeriodTimeline(long durationUs, boolean isSeekable)
durationUs
- The duration of the period, in microseconds.isSeekable
- Whether seeking is supported within the period.public SinglePeriodTimeline(long periodDurationUs, long windowDurationUs, long windowPositionInPeriodUs, long windowDefaultStartPositionUs, boolean isSeekable, boolean isDynamic)
periodDurationUs
- The duration of the period in microseconds.windowDurationUs
- The duration of the window in microseconds.windowPositionInPeriodUs
- The position of the start of the window in the period, in
microseconds.windowDefaultStartPositionUs
- The default position relative to the start of the window at
which to begin playback, in microseconds.isSeekable
- Whether seeking is supported within the window.isDynamic
- Whether the window may change when the timeline is updated.public int getWindowCount()
Timeline
getWindowCount
in class Timeline
public Timeline.Window getWindow(int windowIndex, Timeline.Window window, boolean setIds)
Timeline
Timeline.Window
with data for the window at the specified index.getWindow
in class Timeline
windowIndex
- The index of the window.window
- The Timeline.Window
to populate. Must not be null.setIds
- Whether Timeline.Window.id
should be populated. If false, the field will be set to
null. The caller should pass false for efficiency reasons unless the field is required.Timeline.Window
, for convenience.public int getPeriodCount()
Timeline
getPeriodCount
in class Timeline
public Timeline.Period getPeriod(int periodIndex, Timeline.Period period, boolean setIds)
Timeline
Timeline.Period
with data for the period at the specified index.getPeriod
in class Timeline
periodIndex
- The index of the period.period
- The Timeline.Period
to populate. Must not be null.setIds
- Whether Timeline.Period.id
and Timeline.Period.uid
should be populated. If false,
the fields will be set to null. The caller should pass false for efficiency reasons unless
the fields are required.Timeline.Period
, for convenience.public int getIndexOfPeriod(java.lang.Object uid)
Timeline
id
, or C.INDEX_UNSET
if the period is not in the timeline.getIndexOfPeriod
in class Timeline
uid
- A unique identifier for a period.C.INDEX_UNSET
if the period was not found.