Fix MediaPeriod position param Javadoc.

prepare and selectTracks receive the position from which any
loading should start, where-as continueLoading receives the
actual playback position. These are different in the case that
a previous period is still being played out.

Also removed "relative to the start of the period" from prepare
documentation because it couldn't really be relative to anything
else.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172592769
This commit is contained in:
olly 2017-10-18 06:08:51 -07:00 committed by Oliver Woodman
parent 1e79d6eb84
commit b8ef1dcc78
2 changed files with 9 additions and 5 deletions

View File

@ -58,8 +58,7 @@ public interface MediaPeriod extends SequenceableLoader {
* *
* @param callback Callback to receive updates from this period, including being notified when * @param callback Callback to receive updates from this period, including being notified when
* preparation completes. * preparation completes.
* @param positionUs The position in microseconds relative to the start of the period at which to * @param positionUs The expected starting position, in microseconds.
* start loading data.
*/ */
void prepare(Callback callback, long positionUs); void prepare(Callback callback, long positionUs);
@ -103,7 +102,8 @@ public interface MediaPeriod extends SequenceableLoader {
* selections. * selections.
* @param streamResetFlags Will be updated to indicate new sample streams, and sample streams that * @param streamResetFlags Will be updated to indicate new sample streams, and sample streams that
* have been retained but with the requirement that the consuming renderer be reset. * have been retained but with the requirement that the consuming renderer be reset.
* @param positionUs The current playback position in microseconds. * @param positionUs The current playback position in microseconds. If playback of this period has
* not yet started, the value will be the starting position.
* @return The actual position at which the tracks were enabled, in microseconds. * @return The actual position at which the tracks were enabled, in microseconds.
*/ */
long selectTracks(TrackSelection[] selections, boolean[] mayRetainStreamFlags, long selectTracks(TrackSelection[] selections, boolean[] mayRetainStreamFlags,
@ -176,7 +176,9 @@ public interface MediaPeriod extends SequenceableLoader {
* called when the period is permitted to continue loading data. A period may do this both during * called when the period is permitted to continue loading data. A period may do this both during
* and after preparation. * and after preparation.
* *
* @param positionUs The current playback position. * @param positionUs The current playback position in microseconds. If playback of this period has
* not yet started, the value will be the starting position minus the duration of any media in
* previous periods still to be played.
* @return True if progress was made, meaning that {@link #getNextLoadPositionUs()} will return * @return True if progress was made, meaning that {@link #getNextLoadPositionUs()} will return
* a different value than prior to the call. False otherwise. * a different value than prior to the call. False otherwise.
*/ */

View File

@ -52,7 +52,9 @@ public interface SequenceableLoader {
/** /**
* Attempts to continue loading. * Attempts to continue loading.
* *
* @param positionUs The current playback position. * @param positionUs The current playback position in microseconds. If playback of the period to
* which this loader belongs has not yet started, the value will be the period's starting
* position minus the duration of any media in previous periods still to be played.
* @return True if progress was made, meaning that {@link #getNextLoadPositionUs()} will return * @return True if progress was made, meaning that {@link #getNextLoadPositionUs()} will return
* a different value than prior to the call. False otherwise. * a different value than prior to the call. False otherwise.
*/ */