@Override public void onLoadCompleted(Loadable loadable) { Assertions.checkState(loadable == currentLoadable); long now = SystemClock.elapsedRealtime(); long loadDurationMs = now - currentLoadStartTimeMs; chunkSource.onChunkLoadCompleted(currentLoadable); if (isTsChunk(currentLoadable)) { Assertions.checkState(currentLoadable == currentTsLoadable); loadingFinished = currentTsLoadable.isLastChunk; previousTsLoadable = currentTsLoadable; notifyLoadCompleted(currentLoadable.bytesLoaded(), currentTsLoadable.type, currentTsLoadable.trigger, currentTsLoadable.format, currentTsLoadable.startTimeUs, currentTsLoadable.endTimeUs, now, loadDurationMs); } else { notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type, currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs); } clearCurrentLoadable(); if (enabledTrackCount > 0 || !prepared) { maybeStartLoading(); } }
@Override public void onLoadError(Loadable loadable, IOException e) { if (chunkSource.onChunkLoadError(currentLoadable, e)) { // Error handled by source. if (previousTsLoadable == null && !isPendingReset()) { pendingResetPositionUs = lastSeekPositionUs; } clearCurrentLoadable(); } else { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); } notifyLoadError(e); maybeStartLoading(); }
@Override public void onLoadCompleted(Loadable loadable) { long now = SystemClock.elapsedRealtime(); long loadDurationMs = now - currentLoadStartTimeMs; Chunk currentLoadable = currentLoadableHolder.chunk; chunkSource.onChunkLoadCompleted(currentLoadable); if (isMediaChunk(currentLoadable)) { MediaChunk mediaChunk = (MediaChunk) currentLoadable; notifyLoadCompleted(currentLoadable.bytesLoaded(), mediaChunk.type, mediaChunk.trigger, mediaChunk.format, mediaChunk.startTimeUs, mediaChunk.endTimeUs, now, loadDurationMs); loadingFinished = ((BaseMediaChunk) currentLoadable).isLastChunk; } else { notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type, currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs); } clearCurrentLoadable(); updateLoadControl(); }
@Override public void onLoadCompleted(Loadable loadable) { if (currentLoadable != loadable) { // Stale event. return; } manifest = currentLoadable.getResult(); manifestLoadStartTimestamp = currentLoadStartTimestamp; manifestLoadCompleteTimestamp = SystemClock.elapsedRealtime(); loadExceptionCount = 0; loadException = null; if (manifest instanceof RedirectingManifest) { RedirectingManifest redirectingManifest = (RedirectingManifest) manifest; String nextLocation = redirectingManifest.getNextManifestUri(); if (!TextUtils.isEmpty(nextLocation)) { manifestUri = nextLocation; } } notifyManifestRefreshed(); }
@Override public void onLoadCompleted(Loadable loadable) { Assertions.checkState(loadable == currentLoadable); long now = SystemClock.elapsedRealtime(); long loadDurationMs = now - currentLoadStartTimeMs; chunkSource.onChunkLoadCompleted(currentLoadable); if (isTsChunk(currentLoadable)) { Assertions.checkState(currentLoadable == currentTsLoadable); previousTsLoadable = currentTsLoadable; notifyLoadCompleted(currentLoadable.bytesLoaded(), currentTsLoadable.type, currentTsLoadable.trigger, currentTsLoadable.format, currentTsLoadable.startTimeUs, currentTsLoadable.endTimeUs, now, loadDurationMs); } else { notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type, currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs); } clearCurrentLoadable(); maybeStartLoading(); }
@Override public void onLoadCompleted(Loadable loadable) { long now = SystemClock.elapsedRealtime(); long loadDurationMs = now - currentLoadStartTimeMs; Chunk currentLoadable = currentLoadableHolder.chunk; chunkSource.onChunkLoadCompleted(currentLoadable); if (isMediaChunk(currentLoadable)) { BaseMediaChunk mediaChunk = (BaseMediaChunk) currentLoadable; notifyLoadCompleted(currentLoadable.bytesLoaded(), mediaChunk.type, mediaChunk.trigger, mediaChunk.format, mediaChunk.startTimeUs, mediaChunk.endTimeUs, now, loadDurationMs); } else { notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type, currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs); } clearCurrentLoadable(); updateLoadControl(); }
@Override public void onLoadCompleted(Loadable loadable) { Chunk currentLoadable = currentLoadableHolder.chunk; notifyLoadCompleted(currentLoadable.bytesLoaded()); try { currentLoadable.consume(); } catch (IOException e) { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); currentLoadableExceptionFatal = true; notifyConsumptionError(e); } finally { if (!isMediaChunk(currentLoadable)) { currentLoadable.release(); } if (!currentLoadableExceptionFatal) { clearCurrentLoadable(); } updateLoadControl(); } }
@Override public void onLoadCompleted(Loadable loadable) { try { currentLoadable.consume(); } catch (IOException e) { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); currentLoadableExceptionFatal = true; } finally { if (isTsChunk(currentLoadable)) { TsChunk tsChunk = (TsChunk) loadable; loadingFinished = tsChunk.isLastChunk; } if (!currentLoadableExceptionFatal) { clearCurrentLoadable(); } maybeStartLoading(); } }
@Override public void onLoadCanceled(Loadable loadable) { notifyLoadCanceled(currentLoadable.bytesLoaded()); if (enabledTrackCount > 0) { restartFrom(pendingResetPositionUs); } else { clearState(); loadControl.trimAllocator(); } }
@Override public void onLoadCanceled(Loadable loadable) { if (enabledTrackCount > 0) { restartFrom(pendingResetPositionUs); } else { clearState(); allocator.trim(0); } }
@Override public void onLoadError(Loadable ignored, IOException e) { currentLoadableException = e; currentLoadableExceptionCount = extractedSampleCount > extractedSampleCountAtStartOfLoad ? 1 : currentLoadableExceptionCount + 1; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); maybeStartLoading(); }
@Override public void onLoadError(Loadable loadable, IOException e) { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); maybeStartLoading(); }
@Override public void onLoadCanceled(Loadable loadable) { Chunk currentLoadable = currentLoadableHolder.chunk; notifyLoadCanceled(currentLoadable.bytesLoaded()); clearCurrentLoadable(); if (state == STATE_ENABLED) { restartFrom(pendingResetPositionUs); } else { sampleQueue.clear(); mediaChunks.clear(); clearCurrentLoadable(); loadControl.trimAllocator(); } }
@Override public void onLoadError(Loadable loadable, IOException e) { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); notifyLoadError(e); chunkSource.onChunkLoadError(currentLoadableHolder.chunk, e); updateLoadControl(); }
@Override public void onLoadError(Loadable loadable, IOException exception) { if (currentLoadable != loadable) { // Stale event. return; } loadExceptionCount++; loadExceptionTimestamp = SystemClock.elapsedRealtime(); loadException = new IOException(exception); notifyManifestError(loadException); }
@Override public void onLoadCompleted(Loadable loadable) { try { T result = singleUseLoadable.getResult(); onSingleFetchCompleted(result, loadStartTimestamp); wrappedCallback.onSingleManifest(result); } finally { releaseLoader(); } }
@Override public void onLoadCanceled(Loadable loadable) { // This shouldn't ever happen, but handle it anyway. try { IOException exception = new IOException("Load cancelled", new CancellationException()); wrappedCallback.onSingleManifestError(exception); } finally { releaseLoader(); } }
@Override public void onLoadError(Loadable loadable, IOException exception) { try { wrappedCallback.onSingleManifestError(exception); } finally { releaseLoader(); } }
@Override public void onLoadError(Loadable ignored, IOException e) { currentLoadableException = e; currentLoadableExceptionCount = extractedSampleCount > extractedSampleCountAtStartOfLoad ? 1 : currentLoadableExceptionCount + 1; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); notifyLoadError(e); maybeStartLoading(); }
@Override public void onLoadError(Loadable loadable, IOException e) { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); notifyLoadError(e); maybeStartLoading(); }
@Override public void onLoadError(Loadable loadable, IOException exception) { if (currentLoadable != loadable) { // Stale event. return; } loadExceptionCount++; loadExceptionTimestamp = SystemClock.elapsedRealtime(); loadException = new ManifestIOException(exception); notifyManifestError(loadException); }
@Override public void onLoadCanceled(Loadable loadable) { // This shouldn't ever happen, but handle it anyway. try { IOException exception = new ManifestIOException(new CancellationException()); wrappedCallback.onSingleManifestError(exception); } finally { releaseLoader(); } }
@Override public void onLoadCanceled(Loadable loadable) { Chunk currentLoadable = currentLoadableHolder.chunk; notifyLoadCanceled(currentLoadable.bytesLoaded()); if (!isMediaChunk(currentLoadable)) { currentLoadable.release(); } clearCurrentLoadable(); if (state == STATE_ENABLED) { restartFrom(pendingResetPositionUs); } else { clearMediaChunks(); loadControl.trimAllocator(); } }
@Override public void onLoadError(Loadable loadable, IOException e) { currentLoadableException = e; currentLoadableExceptionCount++; currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime(); notifyUpstreamError(e); chunkSource.onChunkLoadError(currentLoadableHolder.chunk, e); updateLoadControl(); }
@Override public void onLoadCompleted(Loadable loadable) { if (currentLoadable != loadable) { // Stale event. return; } manifest = currentLoadable.result; manifestLoadTimestamp = SystemClock.elapsedRealtime(); loadExceptionCount = 0; loadException = null; notifyManifestRefreshed(); }
@Override public void onLoadCompleted(Loadable loadable) { try { manifest = singleUseLoadable.result; manifestLoadTimestamp = SystemClock.elapsedRealtime(); wrappedCallback.onManifest(contentId, singleUseLoadable.result); } finally { releaseLoader(); } }