mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Add LoadingInfo as a parameter to continueLoading on MediaPeriodHolder
This commit is contained in:
parent
8d0b82dfc3
commit
7b0f83690c
@ -2647,10 +2647,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
private void maybeContinueLoading() {
|
||||
shouldContinueLoading = shouldContinueLoading();
|
||||
if (shouldContinueLoading) {
|
||||
LoadingInfo loadingInfo = new LoadingInfo.Builder()
|
||||
.setPlaybackPositionUs(queue.getLoadingPeriod().toPeriodTime(rendererPositionUs))
|
||||
.setPlaybackSpeed(mediaClock.getPlaybackParameters().speed)
|
||||
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
||||
.build();
|
||||
queue
|
||||
.getLoadingPeriod()
|
||||
.continueLoading(
|
||||
rendererPositionUs, mediaClock.getPlaybackParameters().speed, lastRebufferRealtimeMs);
|
||||
.continueLoading(loadingInfo);
|
||||
}
|
||||
updateIsLoading();
|
||||
}
|
||||
|
@ -238,22 +238,11 @@ import java.io.IOException;
|
||||
* Continues loading the media period at the given renderer position. Should only be called if
|
||||
* this is the loading media period.
|
||||
*
|
||||
* @param rendererPositionUs The load position in renderer time, in microseconds.
|
||||
* @param playbackSpeed The playback speed indicating the current rate of playback.
|
||||
* @param lastRebufferRealtimeMs The time at which the last rebuffering occurred, in milliseconds
|
||||
* since boot including time spent in sleep. The time base used is the same as that measured
|
||||
* by {@link android.os.SystemClock#elapsedRealtime}.
|
||||
* @param loadingInfo The {@link LoadingInfo} when attempting to continue loading.
|
||||
*/
|
||||
public void continueLoading(
|
||||
long rendererPositionUs, float playbackSpeed, long lastRebufferRealtimeMs) {
|
||||
public void continueLoading(LoadingInfo loadingInfo) {
|
||||
checkState(isLoadingMediaPeriod());
|
||||
long loadingPeriodPositionUs = toPeriodTime(rendererPositionUs);
|
||||
mediaPeriod.continueLoading(
|
||||
new LoadingInfo.Builder()
|
||||
.setPlaybackPositionUs(loadingPeriodPositionUs)
|
||||
.setPlaybackSpeed(playbackSpeed)
|
||||
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
||||
.build());
|
||||
mediaPeriod.continueLoading(loadingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user