Add some clarifications to MediaSource documentation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177141094
This commit is contained in:
olly 2017-11-28 03:58:30 -08:00 committed by Oliver Woodman
parent f46cb907b7
commit 1ae50cb9e5

View File

@ -35,7 +35,8 @@ import java.io.IOException;
* player to load and read the media.</li> * player to load and read the media.</li>
* </ul> * </ul>
* All methods are called on the player's internal playback thread, as described in the * All methods are called on the player's internal playback thread, as described in the
* {@link ExoPlayer} Javadoc. * {@link ExoPlayer} Javadoc. They should not be called directly from application code. Instances
* should not be re-used, meaning they should be passed to {@link ExoPlayer#prepare} at most once.
*/ */
public interface MediaSource { public interface MediaSource {
@ -150,6 +151,8 @@ public interface MediaSource {
/** /**
* Starts preparation of the source. * Starts preparation of the source.
* <p>
* Should not be called directly from application code.
* *
* @param player The player for which this source is being prepared. * @param player The player for which this source is being prepared.
* @param isTopLevelSource Whether this source has been passed directly to * @param isTopLevelSource Whether this source has been passed directly to
@ -162,6 +165,8 @@ public interface MediaSource {
/** /**
* Throws any pending error encountered while loading or refreshing source information. * Throws any pending error encountered while loading or refreshing source information.
* <p>
* Should not be called directly from application code.
*/ */
void maybeThrowSourceInfoRefreshError() throws IOException; void maybeThrowSourceInfoRefreshError() throws IOException;
@ -169,6 +174,8 @@ public interface MediaSource {
* Returns a new {@link MediaPeriod} identified by {@code periodId}. This method may be called * Returns a new {@link MediaPeriod} identified by {@code periodId}. This method may be called
* multiple times with the same period identifier without an intervening call to * multiple times with the same period identifier without an intervening call to
* {@link #releasePeriod(MediaPeriod)}. * {@link #releasePeriod(MediaPeriod)}.
* <p>
* Should not be called directly from application code.
* *
* @param id The identifier of the period. * @param id The identifier of the period.
* @param allocator An {@link Allocator} from which to obtain media buffer allocations. * @param allocator An {@link Allocator} from which to obtain media buffer allocations.
@ -178,6 +185,8 @@ public interface MediaSource {
/** /**
* Releases the period. * Releases the period.
* <p>
* Should not be called directly from application code.
* *
* @param mediaPeriod The period to release. * @param mediaPeriod The period to release.
*/ */
@ -186,8 +195,7 @@ public interface MediaSource {
/** /**
* Releases the source. * Releases the source.
* <p> * <p>
* This method should be called when the source is no longer required. It may be called in any * Should not be called directly from application code.
* state.
*/ */
void releaseSource(); void releaseSource();