Search in sources :

Example 11 with LoadEventInfo

use of com.google.android.exoplayer2.source.LoadEventInfo in project ExoPlayer by google.

the class DashMediaSource method onManifestLoadError.

/* package */
LoadErrorAction onManifestLoadError(ParsingLoadable<DashManifest> loadable, long elapsedRealtimeMs, long loadDurationMs, IOException error, int errorCount) {
    LoadEventInfo loadEventInfo = new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, loadable.getUri(), loadable.getResponseHeaders(), elapsedRealtimeMs, loadDurationMs, loadable.bytesLoaded());
    MediaLoadData mediaLoadData = new MediaLoadData(loadable.type);
    LoadErrorInfo loadErrorInfo = new LoadErrorInfo(loadEventInfo, mediaLoadData, error, errorCount);
    long retryDelayMs = loadErrorHandlingPolicy.getRetryDelayMsFor(loadErrorInfo);
    LoadErrorAction loadErrorAction = retryDelayMs == C.TIME_UNSET ? Loader.DONT_RETRY_FATAL : Loader.createRetryAction(/* resetErrorCount= */
    false, retryDelayMs);
    boolean wasCanceled = !loadErrorAction.isRetry();
    manifestEventDispatcher.loadError(loadEventInfo, loadable.type, error, wasCanceled);
    if (wasCanceled) {
        loadErrorHandlingPolicy.onLoadTaskConcluded(loadable.loadTaskId);
    }
    return loadErrorAction;
}
Also used : LoadEventInfo(com.google.android.exoplayer2.source.LoadEventInfo) MediaLoadData(com.google.android.exoplayer2.source.MediaLoadData) LoadErrorInfo(com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy.LoadErrorInfo) LoadErrorAction(com.google.android.exoplayer2.upstream.Loader.LoadErrorAction)

Example 12 with LoadEventInfo

use of com.google.android.exoplayer2.source.LoadEventInfo in project ExoPlayer by google.

the class DashMediaSource method onLoadCanceled.

/* package */
void onLoadCanceled(ParsingLoadable<?> loadable, long elapsedRealtimeMs, long loadDurationMs) {
    LoadEventInfo loadEventInfo = new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, loadable.getUri(), loadable.getResponseHeaders(), elapsedRealtimeMs, loadDurationMs, loadable.bytesLoaded());
    loadErrorHandlingPolicy.onLoadTaskConcluded(loadable.loadTaskId);
    manifestEventDispatcher.loadCanceled(loadEventInfo, loadable.type);
}
Also used : LoadEventInfo(com.google.android.exoplayer2.source.LoadEventInfo)

Example 13 with LoadEventInfo

use of com.google.android.exoplayer2.source.LoadEventInfo in project ExoPlayer by google.

the class DashMediaSource method onUtcTimestampLoadCompleted.

/* package */
void onUtcTimestampLoadCompleted(ParsingLoadable<Long> loadable, long elapsedRealtimeMs, long loadDurationMs) {
    LoadEventInfo loadEventInfo = new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, loadable.getUri(), loadable.getResponseHeaders(), elapsedRealtimeMs, loadDurationMs, loadable.bytesLoaded());
    loadErrorHandlingPolicy.onLoadTaskConcluded(loadable.loadTaskId);
    manifestEventDispatcher.loadCompleted(loadEventInfo, loadable.type);
    onUtcTimestampResolved(loadable.getResult() - elapsedRealtimeMs);
}
Also used : LoadEventInfo(com.google.android.exoplayer2.source.LoadEventInfo)

Example 14 with LoadEventInfo

use of com.google.android.exoplayer2.source.LoadEventInfo in project ExoPlayer by google.

the class SsMediaSource method startLoadingManifest.

private void startLoadingManifest() {
    if (manifestLoader.hasFatalError()) {
        return;
    }
    ParsingLoadable<SsManifest> loadable = new ParsingLoadable<>(manifestDataSource, manifestUri, C.DATA_TYPE_MANIFEST, manifestParser);
    long elapsedRealtimeMs = manifestLoader.startLoading(loadable, this, loadErrorHandlingPolicy.getMinimumLoadableRetryCount(loadable.type));
    manifestEventDispatcher.loadStarted(new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs), loadable.type);
}
Also used : LoadEventInfo(com.google.android.exoplayer2.source.LoadEventInfo) ParsingLoadable(com.google.android.exoplayer2.upstream.ParsingLoadable) SsManifest(com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest)

Example 15 with LoadEventInfo

use of com.google.android.exoplayer2.source.LoadEventInfo in project ExoPlayer by google.

the class SsMediaSource method onLoadCompleted.

// Loader.Callback implementation
@Override
public void onLoadCompleted(ParsingLoadable<SsManifest> loadable, long elapsedRealtimeMs, long loadDurationMs) {
    LoadEventInfo loadEventInfo = new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, loadable.getUri(), loadable.getResponseHeaders(), elapsedRealtimeMs, loadDurationMs, loadable.bytesLoaded());
    loadErrorHandlingPolicy.onLoadTaskConcluded(loadable.loadTaskId);
    manifestEventDispatcher.loadCompleted(loadEventInfo, loadable.type);
    manifest = loadable.getResult();
    manifestLoadStartTimestamp = elapsedRealtimeMs - loadDurationMs;
    processManifest();
    scheduleManifestRefresh();
}
Also used : LoadEventInfo(com.google.android.exoplayer2.source.LoadEventInfo)

Aggregations

LoadEventInfo (com.google.android.exoplayer2.source.LoadEventInfo)27 MediaLoadData (com.google.android.exoplayer2.source.MediaLoadData)7 LoadErrorInfo (com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy.LoadErrorInfo)7 StatsDataSource (com.google.android.exoplayer2.upstream.StatsDataSource)7 LoadErrorAction (com.google.android.exoplayer2.upstream.Loader.LoadErrorAction)6 Nullable (androidx.annotation.Nullable)4 EventTime (com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime)4 SampleQueue (com.google.android.exoplayer2.source.SampleQueue)2 HttpDataSource (com.google.android.exoplayer2.upstream.HttpDataSource)2 ParsingLoadable (com.google.android.exoplayer2.upstream.ParsingLoadable)2 Uri (android.net.Uri)1 Timeline (com.google.android.exoplayer2.Timeline)1 MediaPeriod (com.google.android.exoplayer2.source.MediaPeriod)1 MediaPeriodId (com.google.android.exoplayer2.source.MediaSource.MediaPeriodId)1 MediaSourceEventListener (com.google.android.exoplayer2.source.MediaSourceEventListener)1 Chunk (com.google.android.exoplayer2.source.chunk.Chunk)1 DashManifest (com.google.android.exoplayer2.source.dash.manifest.DashManifest)1 SsManifest (com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest)1 DataSource (com.google.android.exoplayer2.upstream.DataSource)1 DataSpec (com.google.android.exoplayer2.upstream.DataSpec)1