mirror of
https://github.com/androidx/media.git
synced 2025-05-13 18:50:02 +08:00
Add some clarifications to MediaSource documentation
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177141094
This commit is contained in:
parent
f46cb907b7
commit
1ae50cb9e5
@ -35,7 +35,8 @@ import java.io.IOException;
|
||||
* player to load and read the media.</li>
|
||||
* </ul>
|
||||
* 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 {
|
||||
|
||||
@ -150,6 +151,8 @@ public interface MediaSource {
|
||||
|
||||
/**
|
||||
* 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 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.
|
||||
* <p>
|
||||
* Should not be called directly from application code.
|
||||
*/
|
||||
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
|
||||
* multiple times with the same period identifier without an intervening call to
|
||||
* {@link #releasePeriod(MediaPeriod)}.
|
||||
* <p>
|
||||
* Should not be called directly from application code.
|
||||
*
|
||||
* @param id The identifier of the period.
|
||||
* @param allocator An {@link Allocator} from which to obtain media buffer allocations.
|
||||
@ -178,6 +185,8 @@ public interface MediaSource {
|
||||
|
||||
/**
|
||||
* Releases the period.
|
||||
* <p>
|
||||
* Should not be called directly from application code.
|
||||
*
|
||||
* @param mediaPeriod The period to release.
|
||||
*/
|
||||
@ -186,8 +195,7 @@ public interface MediaSource {
|
||||
/**
|
||||
* Releases the source.
|
||||
* <p>
|
||||
* This method should be called when the source is no longer required. It may be called in any
|
||||
* state.
|
||||
* Should not be called directly from application code.
|
||||
*/
|
||||
void releaseSource();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user