mirror of
https://github.com/androidx/media.git
synced 2025-05-07 23:50:44 +08:00
Rename defaultStartPosition -> defaultPosition
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132858669
This commit is contained in:
parent
94983675c2
commit
8190089b32
@ -913,7 +913,7 @@ import java.io.IOException;
|
|||||||
timeline.getWindow(period.windowIndex, window);
|
timeline.getWindow(period.windowIndex, window);
|
||||||
periodIndex = window.firstPeriodIndex;
|
periodIndex = window.firstPeriodIndex;
|
||||||
long periodPositionUs = window.getPositionInFirstPeriodUs()
|
long periodPositionUs = window.getPositionInFirstPeriodUs()
|
||||||
+ window.getDefaultStartPositionUs();
|
+ window.getDefaultPositionUs();
|
||||||
timeline.getPeriod(periodIndex, period);
|
timeline.getPeriod(periodIndex, period);
|
||||||
while (periodIndex < window.lastPeriodIndex
|
while (periodIndex < window.lastPeriodIndex
|
||||||
&& periodPositionUs > period.getDurationMs()) {
|
&& periodPositionUs > period.getDurationMs()) {
|
||||||
|
@ -25,8 +25,8 @@ package com.google.android.exoplayer2;
|
|||||||
* logical piece of media, for example a media file. A window spans one or more periods, defining
|
* logical piece of media, for example a media file. A window spans one or more periods, defining
|
||||||
* the region within those periods that's currently available for playback along with additional
|
* the region within those periods that's currently available for playback along with additional
|
||||||
* information such as whether seeking is supported within the window. Each window defines a default
|
* information such as whether seeking is supported within the window. Each window defines a default
|
||||||
* start position, which is the position from which playback will start when the player starts
|
* position, which is the position from which playback will start when the player starts playing the
|
||||||
* playing the window. The following examples illustrate timelines for various use cases.
|
* window. The following examples illustrate timelines for various use cases.
|
||||||
*
|
*
|
||||||
* <h3 id="single-file">Single media file or on-demand stream</h3>
|
* <h3 id="single-file">Single media file or on-demand stream</h3>
|
||||||
* <p align="center">
|
* <p align="center">
|
||||||
@ -34,18 +34,18 @@ package com.google.android.exoplayer2;
|
|||||||
* </p>
|
* </p>
|
||||||
* A timeline for a single media file or on-demand stream consists of a single period and window.
|
* A timeline for a single media file or on-demand stream consists of a single period and window.
|
||||||
* The window spans the whole period, indicating that all parts of the media are available for
|
* The window spans the whole period, indicating that all parts of the media are available for
|
||||||
* playback. The window's default start position is typically at the start of the period (indicated
|
* playback. The window's default position is typically at the start of the period (indicated by the
|
||||||
* by the black dot in the figure above).
|
* black dot in the figure above).
|
||||||
|
*
|
||||||
* <h3>Playlist of media files or on-demand streams</h3>
|
* <h3>Playlist of media files or on-demand streams</h3>
|
||||||
* <p align="center">
|
* <p align="center">
|
||||||
* <img src="doc-files/timeline-playlist.svg" alt="Example timeline for a playlist of files">
|
* <img src="doc-files/timeline-playlist.svg" alt="Example timeline for a playlist of files">
|
||||||
* </p>
|
* </p>
|
||||||
* A timeline for a playlist of media files or on-demand streams consists of multiple periods, each
|
* A timeline for a playlist of media files or on-demand streams consists of multiple periods, each
|
||||||
* with its own window. Each window spans the whole of the corresponding period, and typically has a
|
* with its own window. Each window spans the whole of the corresponding period, and typically has a
|
||||||
* default start position at the start of the period. The properties of the periods and windows
|
* default position at the start of the period. The properties of the periods and windows (e.g.
|
||||||
* (e.g. their durations and whether the window is seekable) will often only become known when the
|
* their durations and whether the window is seekable) will often only become known when the player
|
||||||
* player starts buffering the corresponding file or stream.
|
* starts buffering the corresponding file or stream.
|
||||||
*
|
*
|
||||||
* <h3 id="live-limited">Live stream with limited availability</h3>
|
* <h3 id="live-limited">Live stream with limited availability</h3>
|
||||||
* <p align="center">
|
* <p align="center">
|
||||||
@ -56,8 +56,8 @@ package com.google.android.exoplayer2;
|
|||||||
* continually extending as more content is broadcast. If content only remains available for a
|
* continually extending as more content is broadcast. If content only remains available for a
|
||||||
* limited period of time then the window may start at a non-zero position, defining the region of
|
* limited period of time then the window may start at a non-zero position, defining the region of
|
||||||
* content that can still be played. The window will have {@link Window#isDynamic} set to true if
|
* content that can still be played. The window will have {@link Window#isDynamic} set to true if
|
||||||
* the stream is still live. Its default start position is typically near to the live edge
|
* the stream is still live. Its default position is typically near to the live edge (indicated by
|
||||||
* (indicated by the black dot in the figure above).
|
* the black dot in the figure above).
|
||||||
*
|
*
|
||||||
* <h3>Live stream with indefinite availability</h3>
|
* <h3>Live stream with indefinite availability</h3>
|
||||||
* <p align="center">
|
* <p align="center">
|
||||||
@ -86,8 +86,8 @@ package com.google.android.exoplayer2;
|
|||||||
* </p>
|
* </p>
|
||||||
* This case is the concatenation of the <a href="#single-file">Single media file or on-demand
|
* This case is the concatenation of the <a href="#single-file">Single media file or on-demand
|
||||||
* stream</a> and <a href="#multi-period">Live stream with multiple periods</a> cases. When playback
|
* stream</a> and <a href="#multi-period">Live stream with multiple periods</a> cases. When playback
|
||||||
* of the pre-roll ends, playback of the live stream will start from its default start position near
|
* of the pre-roll ends, playback of the live stream will start from its default position near the
|
||||||
* the live edge.
|
* live edge.
|
||||||
*/
|
*/
|
||||||
public abstract class Timeline {
|
public abstract class Timeline {
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ public abstract class Timeline {
|
|||||||
*/
|
*/
|
||||||
public int lastPeriodIndex;
|
public int lastPeriodIndex;
|
||||||
|
|
||||||
private long defaultStartPositionUs;
|
private long defaultPositionUs;
|
||||||
private long durationUs;
|
private long durationUs;
|
||||||
private long positionInFirstPeriodUs;
|
private long positionInFirstPeriodUs;
|
||||||
|
|
||||||
@ -214,14 +214,14 @@ public abstract class Timeline {
|
|||||||
* Sets the data held by this window.
|
* Sets the data held by this window.
|
||||||
*/
|
*/
|
||||||
public Window set(Object id, long presentationStartTimeMs, long windowStartTimeMs,
|
public Window set(Object id, long presentationStartTimeMs, long windowStartTimeMs,
|
||||||
boolean isSeekable, boolean isDynamic, long defaultStartPositionUs, long durationUs,
|
boolean isSeekable, boolean isDynamic, long defaultPositionUs, long durationUs,
|
||||||
int firstPeriodIndex, int lastPeriodIndex, long positionInFirstPeriodUs) {
|
int firstPeriodIndex, int lastPeriodIndex, long positionInFirstPeriodUs) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.presentationStartTimeMs = presentationStartTimeMs;
|
this.presentationStartTimeMs = presentationStartTimeMs;
|
||||||
this.windowStartTimeMs = windowStartTimeMs;
|
this.windowStartTimeMs = windowStartTimeMs;
|
||||||
this.isSeekable = isSeekable;
|
this.isSeekable = isSeekable;
|
||||||
this.isDynamic = isDynamic;
|
this.isDynamic = isDynamic;
|
||||||
this.defaultStartPositionUs = defaultStartPositionUs;
|
this.defaultPositionUs = defaultPositionUs;
|
||||||
this.durationUs = durationUs;
|
this.durationUs = durationUs;
|
||||||
this.firstPeriodIndex = firstPeriodIndex;
|
this.firstPeriodIndex = firstPeriodIndex;
|
||||||
this.lastPeriodIndex = lastPeriodIndex;
|
this.lastPeriodIndex = lastPeriodIndex;
|
||||||
@ -233,16 +233,16 @@ public abstract class Timeline {
|
|||||||
* Returns the default position relative to the start of the window at which to begin playback,
|
* Returns the default position relative to the start of the window at which to begin playback,
|
||||||
* in milliseconds.
|
* in milliseconds.
|
||||||
*/
|
*/
|
||||||
public long getDefaultStartPositionMs() {
|
public long getDefaultPositionMs() {
|
||||||
return C.usToMs(defaultStartPositionUs);
|
return C.usToMs(defaultPositionUs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default position relative to the start of the window at which to begin playback,
|
* Returns the default position relative to the start of the window at which to begin playback,
|
||||||
* in microseconds.
|
* in microseconds.
|
||||||
*/
|
*/
|
||||||
public long getDefaultStartPositionUs() {
|
public long getDefaultPositionUs() {
|
||||||
return defaultStartPositionUs;
|
return defaultPositionUs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user