Search in sources :

Example 21 with LoadEventInfo

use of androidx.media3.exoplayer.source.LoadEventInfo in project media by androidx.

the class DefaultAnalyticsCollector method onLoadCompleted.

@Override
public final void onLoadCompleted(int windowIndex, @Nullable MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
    EventTime eventTime = generateMediaPeriodEventTime(windowIndex, mediaPeriodId);
    sendEvent(eventTime, AnalyticsListener.EVENT_LOAD_COMPLETED, listener -> listener.onLoadCompleted(eventTime, loadEventInfo, mediaLoadData));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 22 with LoadEventInfo

use of androidx.media3.exoplayer.source.LoadEventInfo in project media by androidx.

the class DefaultAnalyticsCollector method onLoadStarted.

// MediaSourceEventListener implementation.
@Override
public final void onLoadStarted(int windowIndex, @Nullable MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
    EventTime eventTime = generateMediaPeriodEventTime(windowIndex, mediaPeriodId);
    sendEvent(eventTime, AnalyticsListener.EVENT_LOAD_STARTED, listener -> listener.onLoadStarted(eventTime, loadEventInfo, mediaLoadData));
}
Also used : EventTime(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime)

Example 23 with LoadEventInfo

use of androidx.media3.exoplayer.source.LoadEventInfo in project media by androidx.

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(androidx.media3.exoplayer.source.LoadEventInfo)

Example 24 with LoadEventInfo

use of androidx.media3.exoplayer.source.LoadEventInfo in project media by androidx.

the class SsMediaSource method onLoadError.

@Override
public LoadErrorAction onLoadError(ParsingLoadable<SsManifest> 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);
    long retryDelayMs = loadErrorHandlingPolicy.getRetryDelayMsFor(new LoadErrorInfo(loadEventInfo, mediaLoadData, error, errorCount));
    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(androidx.media3.exoplayer.source.LoadEventInfo) MediaLoadData(androidx.media3.exoplayer.source.MediaLoadData) LoadErrorInfo(androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy.LoadErrorInfo) LoadErrorAction(androidx.media3.exoplayer.upstream.Loader.LoadErrorAction)

Example 25 with LoadEventInfo

use of androidx.media3.exoplayer.source.LoadEventInfo in project media by androidx.

the class DashMediaSource method startLoading.

private <T> void startLoading(ParsingLoadable<T> loadable, Loader.Callback<ParsingLoadable<T>> callback, int minRetryCount) {
    long elapsedRealtimeMs = loader.startLoading(loadable, callback, minRetryCount);
    manifestEventDispatcher.loadStarted(new LoadEventInfo(loadable.loadTaskId, loadable.dataSpec, elapsedRealtimeMs), loadable.type);
}
Also used : LoadEventInfo(androidx.media3.exoplayer.source.LoadEventInfo)

Aggregations

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