mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Reformat with google-java-format
This commit is contained in:
parent
e7f5d4d441
commit
b565f47d18
@ -573,8 +573,11 @@ import java.util.Set;
|
||||
eventHandler.post(
|
||||
() ->
|
||||
eventListener.onLoadStarted(
|
||||
eventParameters.first, eventParameters.second,
|
||||
loadEventData, mediaLoadData, retryCount));
|
||||
eventParameters.first,
|
||||
eventParameters.second,
|
||||
loadEventData,
|
||||
mediaLoadData,
|
||||
retryCount));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,8 @@ public interface MediaSourceEventListener {
|
||||
* LoadEventInfo#uri} won't reflect potential redirection yet and {@link
|
||||
* LoadEventInfo#responseHeaders} will be empty.
|
||||
* @param mediaLoadData The {@link MediaLoadData} defining the data being loaded.
|
||||
* @param retryCount The number of failed attempts since this method was first called (this
|
||||
* is zero for the first load attempt).
|
||||
* @param retryCount The number of failed attempts since this method was first called (this is
|
||||
* zero for the first load attempt).
|
||||
*/
|
||||
default void onLoadStarted(
|
||||
int windowIndex,
|
||||
@ -64,8 +64,7 @@ public interface MediaSourceEventListener {
|
||||
* belong to a specific media period.
|
||||
* @param loadEventInfo The {@link LoadEventInfo} corresponding to the event. The values of {@link
|
||||
* LoadEventInfo#elapsedRealtimeMs} and {@link LoadEventInfo#bytesLoaded} are relative to the
|
||||
* corresponding {@link #onLoadStarted}
|
||||
* event.
|
||||
* corresponding {@link #onLoadStarted} event.
|
||||
* @param mediaLoadData The {@link MediaLoadData} defining the data being loaded.
|
||||
*/
|
||||
default void onLoadCompleted(
|
||||
@ -82,8 +81,7 @@ public interface MediaSourceEventListener {
|
||||
* belong to a specific media period.
|
||||
* @param loadEventInfo The {@link LoadEventInfo} corresponding to the event. The values of {@link
|
||||
* LoadEventInfo#elapsedRealtimeMs} and {@link LoadEventInfo#bytesLoaded} are relative to the
|
||||
* corresponding {@link #onLoadStarted}
|
||||
* event.
|
||||
* corresponding {@link #onLoadStarted} event.
|
||||
* @param mediaLoadData The {@link MediaLoadData} defining the data being loaded.
|
||||
*/
|
||||
default void onLoadCanceled(
|
||||
@ -111,8 +109,7 @@ public interface MediaSourceEventListener {
|
||||
* belong to a specific media period.
|
||||
* @param loadEventInfo The {@link LoadEventInfo} corresponding to the event. The values of {@link
|
||||
* LoadEventInfo#elapsedRealtimeMs} and {@link LoadEventInfo#bytesLoaded} are relative to the
|
||||
* corresponding {@link #onLoadStarted}
|
||||
* event.
|
||||
* corresponding {@link #onLoadStarted} event.
|
||||
* @param mediaLoadData The {@link MediaLoadData} defining the data being loaded.
|
||||
* @param error The load error.
|
||||
* @param wasCanceled Whether the load was canceled as a result of the error.
|
||||
@ -266,9 +263,7 @@ public interface MediaSourceEventListener {
|
||||
|
||||
/** Dispatches {@link #onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData, int)}. */
|
||||
public void loadStarted(
|
||||
LoadEventInfo loadEventInfo,
|
||||
MediaLoadData mediaLoadData,
|
||||
int retryCount) {
|
||||
LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, int retryCount) {
|
||||
dispatchEvent(
|
||||
(listener) ->
|
||||
listener.onLoadStarted(
|
||||
|
@ -920,7 +920,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
C.SELECTION_REASON_UNKNOWN,
|
||||
/* trackSelectionData= */ null,
|
||||
/* mediaStartTimeUs= */ loadable.seekTimeUs,
|
||||
durationUs, /* retryCount= */ 0);
|
||||
durationUs,
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -168,7 +168,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
C.SELECTION_REASON_UNKNOWN,
|
||||
/* trackSelectionData= */ null,
|
||||
/* mediaStartTimeUs= */ 0,
|
||||
durationUs, /* retryCount= */ 0);
|
||||
durationUs,
|
||||
/* retryCount= */ 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -208,8 +209,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
// Loader.Callback implementation.
|
||||
|
||||
@Override
|
||||
public void onLoadStarted(SourceLoadable loadable, long elapsedRealtimeMs, long loadDurationMs,
|
||||
int retryCount) {
|
||||
public void onLoadStarted(
|
||||
SourceLoadable loadable, long elapsedRealtimeMs, long loadDurationMs, int retryCount) {
|
||||
StatsDataSource dataSource = loadable.dataSource;
|
||||
LoadEventInfo loadEventInfo =
|
||||
new LoadEventInfo(
|
||||
|
@ -427,14 +427,16 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
||||
int windowIndex,
|
||||
@Nullable MediaPeriodId mediaPeriodId,
|
||||
LoadEventInfo loadEventInfo,
|
||||
MediaLoadData mediaLoadData, int retryCount) {
|
||||
MediaLoadData mediaLoadData,
|
||||
int retryCount) {
|
||||
// TODO file a bug to track updating this.
|
||||
if (retryCount == 0) {
|
||||
@Nullable
|
||||
MediaPeriodImpl mediaPeriod =
|
||||
getMediaPeriodForEvent(mediaPeriodId, mediaLoadData, /* useLoadingPeriod= */ true);
|
||||
if (mediaPeriod == null) {
|
||||
mediaSourceEventDispatcherWithoutId.loadStarted(loadEventInfo, mediaLoadData, /* retryCount= */ 0);
|
||||
mediaSourceEventDispatcherWithoutId.loadStarted(
|
||||
loadEventInfo, mediaLoadData, /* retryCount= */ 0);
|
||||
} else {
|
||||
mediaPeriod.sharedPeriod.onLoadStarted(loadEventInfo, mediaLoadData);
|
||||
mediaPeriod.mediaSourceEventDispatcher.loadStarted(
|
||||
@ -442,8 +444,8 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
||||
correctMediaLoadData(
|
||||
mediaPeriod,
|
||||
mediaLoadData,
|
||||
checkNotNull(adPlaybackStates.get(mediaPeriod.mediaPeriodId.periodUid))), /* retryCount= */ 0);
|
||||
|
||||
checkNotNull(adPlaybackStates.get(mediaPeriod.mediaPeriodId.periodUid))),
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -754,7 +756,9 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
||||
loadData.first,
|
||||
correctMediaLoadData(loadingPeriod, loadData.second, adPlaybackState));
|
||||
mediaPeriod.mediaSourceEventDispatcher.loadStarted(
|
||||
loadData.first, correctMediaLoadData(mediaPeriod, loadData.second, adPlaybackState), /* retryCount= */ 0);
|
||||
loadData.first,
|
||||
correctMediaLoadData(mediaPeriod, loadData.second, adPlaybackState),
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
}
|
||||
this.loadingPeriod = mediaPeriod;
|
||||
|
@ -429,10 +429,9 @@ public class ChunkSampleStream<T extends ChunkSource>
|
||||
|
||||
// Loader.Callback implementation.
|
||||
|
||||
|
||||
@Override
|
||||
public void onLoadStarted(Chunk loadable, long elapsedRealtimeMs, long loadDurationMs,
|
||||
int retryCount) {
|
||||
public void onLoadStarted(
|
||||
Chunk loadable, long elapsedRealtimeMs, long loadDurationMs, int retryCount) {
|
||||
mediaSourceEventDispatcher.loadStarted(
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type,
|
||||
@ -663,7 +662,8 @@ public class ChunkSampleStream<T extends ChunkSource>
|
||||
loadable.trackSelectionReason,
|
||||
loadable.trackSelectionData,
|
||||
loadable.startTimeUs,
|
||||
loadable.endTimeUs, /* retryCount= */ 0);
|
||||
loadable.endTimeUs,
|
||||
/* retryCount= */ 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -630,8 +630,10 @@ public final class DashMediaSource extends BaseMediaSource {
|
||||
// Loadable callbacks.
|
||||
|
||||
/* package */ void onManifestLoadStarted(
|
||||
ParsingLoadable<DashManifest> loadable, long elapsedRealtimeMs,
|
||||
long loadDurationMs, int retryCount) {
|
||||
ParsingLoadable<DashManifest> loadable,
|
||||
long elapsedRealtimeMs,
|
||||
long loadDurationMs,
|
||||
int retryCount) {
|
||||
manifestEventDispatcher.loadStarted(
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type,
|
||||
@ -1106,7 +1108,8 @@ public final class DashMediaSource extends BaseMediaSource {
|
||||
long elapsedRealtimeMs = loader.startLoading(loadable, callback, minRetryCount);
|
||||
manifestEventDispatcher.loadStarted(
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type, /* retryCount= */ 0);
|
||||
loadable.type,
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
|
||||
private static long getIntervalUntilNextManifestRefreshMs(
|
||||
@ -1399,8 +1402,11 @@ public final class DashMediaSource extends BaseMediaSource {
|
||||
private final class ManifestCallback implements Loader.Callback<ParsingLoadable<DashManifest>> {
|
||||
|
||||
@Override
|
||||
public void onLoadStarted(ParsingLoadable<DashManifest> loadable, long elapsedRealtimeMs,
|
||||
long loadDurationMs, int retryCount) {
|
||||
public void onLoadStarted(
|
||||
ParsingLoadable<DashManifest> loadable,
|
||||
long elapsedRealtimeMs,
|
||||
long loadDurationMs,
|
||||
int retryCount) {
|
||||
onManifestLoadStarted(loadable, elapsedRealtimeMs, loadDurationMs, retryCount);
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
loadable.trackSelectionReason,
|
||||
loadable.trackSelectionData,
|
||||
loadable.startTimeUs,
|
||||
loadable.endTimeUs, /* retryCount= */ 0);
|
||||
loadable.endTimeUs,
|
||||
/* retryCount= */ 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -861,10 +862,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
// Loader.Callback implementation.
|
||||
|
||||
|
||||
@Override
|
||||
public void onLoadStarted(Chunk loadable, long elapsedRealtimeMs, long loadDurationMs,
|
||||
int retryCount) {
|
||||
public void onLoadStarted(
|
||||
Chunk loadable, long elapsedRealtimeMs, long loadDurationMs, int retryCount) {
|
||||
mediaSourceEventDispatcher.loadStarted(
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type,
|
||||
@ -873,7 +873,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
loadable.trackSelectionReason,
|
||||
loadable.trackSelectionData,
|
||||
loadable.startTimeUs,
|
||||
loadable.endTimeUs, retryCount);
|
||||
loadable.endTimeUs,
|
||||
retryCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,7 +152,8 @@ public final class DefaultHlsPlaylistTracker
|
||||
multivariantPlaylistLoadable.loadTaskId,
|
||||
multivariantPlaylistLoadable.dataSpec,
|
||||
elapsedRealtime),
|
||||
multivariantPlaylistLoadable.type, /* retryCount= */ 0);
|
||||
multivariantPlaylistLoadable.type,
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -261,10 +262,7 @@ public final class DefaultHlsPlaylistTracker
|
||||
long loadDurationMs,
|
||||
int retryCount) {
|
||||
eventDispatcher.loadStarted(
|
||||
new LoadEventInfo(
|
||||
loadable.loadTaskId,
|
||||
loadable.dataSpec,
|
||||
elapsedRealtimeMs),
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type,
|
||||
retryCount);
|
||||
}
|
||||
@ -759,7 +757,8 @@ public final class DefaultHlsPlaylistTracker
|
||||
eventDispatcher.loadStarted(
|
||||
new LoadEventInfo(
|
||||
mediaPlaylistLoadable.loadTaskId, mediaPlaylistLoadable.dataSpec, elapsedRealtime),
|
||||
mediaPlaylistLoadable.type, /* retryCount= */ 0);
|
||||
mediaPlaylistLoadable.type,
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
|
||||
private void processLoadedPlaylist(
|
||||
|
@ -498,8 +498,11 @@ public final class SsMediaSource extends BaseMediaSource
|
||||
// Loader.Callback implementation
|
||||
|
||||
@Override
|
||||
public void onLoadStarted(ParsingLoadable<SsManifest> loadable, long elapsedRealtimeMs,
|
||||
long loadDurationMs, int retryCount) {
|
||||
public void onLoadStarted(
|
||||
ParsingLoadable<SsManifest> loadable,
|
||||
long elapsedRealtimeMs,
|
||||
long loadDurationMs,
|
||||
int retryCount) {
|
||||
manifestEventDispatcher.loadStarted(
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type,
|
||||
@ -673,6 +676,7 @@ public final class SsMediaSource extends BaseMediaSource
|
||||
loadable, this, loadErrorHandlingPolicy.getMinimumLoadableRetryCount(loadable.type));
|
||||
manifestEventDispatcher.loadStarted(
|
||||
new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs),
|
||||
loadable.type, /* retryCount= */ 0);
|
||||
loadable.type,
|
||||
/* retryCount= */ 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user