Java 类com.google.android.exoplayer.upstream.Loader.Loadable 实例源码

项目:miku    文件:HlsSampleSource.java   
@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();
  }
}
项目:miku    文件:HlsSampleSource.java   
@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();
}
项目:miku    文件:ChunkSampleSource.java   
@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();
}
项目:miku    文件:ManifestFetcher.java   
@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();
}
项目:ExoPlayer-Demo    文件:HlsSampleSource.java   
@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();
}
项目:ExoPlayer-Demo    文件:HlsSampleSource.java   
@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();
}
项目:ExoPlayer-Demo    文件:ChunkSampleSource.java   
@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();
}
项目:ExoPlayer-Demo    文件:ManifestFetcher.java   
@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();
}
项目:android-exoplayer    文件:ChunkSampleSource.java   
@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();
  }
}
项目:Exoplayer_VLC    文件:HlsSampleSource.java   
@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();
  }
}
项目:Exoplayer_VLC    文件:ChunkSampleSource.java   
@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();
  }
}
项目:ExoPlayer    文件:HlsSampleSource.java   
@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();
  }
}
项目:ExoPlayer    文件:HlsSampleSource.java   
@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();
}
项目:ExoPlayer    文件:ChunkSampleSource.java   
@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();
}
项目:ExoPlayer    文件:ManifestFetcher.java   
@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();
}
项目:miku    文件:HlsSampleSource.java   
@Override
public void onLoadCanceled(Loadable loadable) {
  notifyLoadCanceled(currentLoadable.bytesLoaded());
  if (enabledTrackCount > 0) {
    restartFrom(pendingResetPositionUs);
  } else {
    clearState();
    loadControl.trimAllocator();
  }
}
项目:miku    文件:ExtractorSampleSource.java   
@Override
public void onLoadCanceled(Loadable loadable) {
  if (enabledTrackCount > 0) {
    restartFrom(pendingResetPositionUs);
  } else {
    clearState();
    allocator.trim(0);
  }
}
项目:miku    文件:ExtractorSampleSource.java   
@Override
public void onLoadError(Loadable ignored, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount = extractedSampleCount > extractedSampleCountAtStartOfLoad ? 1
      : currentLoadableExceptionCount + 1;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  maybeStartLoading();
}
项目:miku    文件:SingleSampleSource.java   
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  maybeStartLoading();
}
项目:miku    文件:ChunkSampleSource.java   
@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();
  }
}
项目:miku    文件:ChunkSampleSource.java   
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  chunkSource.onChunkLoadError(currentLoadableHolder.chunk, e);
  updateLoadControl();
}
项目:miku    文件:ManifestFetcher.java   
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  loadExceptionCount++;
  loadExceptionTimestamp = SystemClock.elapsedRealtime();
  loadException = new IOException(exception);

  notifyManifestError(loadException);
}
项目:miku    文件:ManifestFetcher.java   
@Override
public void onLoadCompleted(Loadable loadable) {
  try {
    T result = singleUseLoadable.getResult();
    onSingleFetchCompleted(result, loadStartTimestamp);
    wrappedCallback.onSingleManifest(result);
  } finally {
    releaseLoader();
  }
}
项目:miku    文件:ManifestFetcher.java   
@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();
  }
}
项目:miku    文件:ManifestFetcher.java   
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  try {
    wrappedCallback.onSingleManifestError(exception);
  } finally {
    releaseLoader();
  }
}
项目:ExoPlayer-Demo    文件:HlsSampleSource.java   
@Override
public void onLoadCanceled(Loadable loadable) {
  notifyLoadCanceled(currentLoadable.bytesLoaded());
  if (enabledTrackCount > 0) {
    restartFrom(pendingResetPositionUs);
  } else {
    clearState();
    loadControl.trimAllocator();
  }
}
项目:ExoPlayer-Demo    文件:ExtractorSampleSource.java   
@Override
public void onLoadCanceled(Loadable loadable) {
  if (enabledTrackCount > 0) {
    restartFrom(pendingResetPositionUs);
  } else {
    clearState();
    allocator.trim(0);
  }
}
项目:ExoPlayer-Demo    文件:ExtractorSampleSource.java   
@Override
public void onLoadError(Loadable ignored, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount = extractedSampleCount > extractedSampleCountAtStartOfLoad ? 1
      : currentLoadableExceptionCount + 1;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  maybeStartLoading();
}
项目:ExoPlayer-Demo    文件:SingleSampleSource.java   
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  maybeStartLoading();
}
项目:ExoPlayer-Demo    文件:ChunkSampleSource.java   
@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();
  }
}
项目:ExoPlayer-Demo    文件:ChunkSampleSource.java   
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyLoadError(e);
  chunkSource.onChunkLoadError(currentLoadableHolder.chunk, e);
  updateLoadControl();
}
项目:ExoPlayer-Demo    文件:ManifestFetcher.java   
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  loadExceptionCount++;
  loadExceptionTimestamp = SystemClock.elapsedRealtime();
  loadException = new ManifestIOException(exception);

  notifyManifestError(loadException);
}
项目:ExoPlayer-Demo    文件:ManifestFetcher.java   
@Override
public void onLoadCompleted(Loadable loadable) {
  try {
    T result = singleUseLoadable.getResult();
    onSingleFetchCompleted(result, loadStartTimestamp);
    wrappedCallback.onSingleManifest(result);
  } finally {
    releaseLoader();
  }
}
项目:ExoPlayer-Demo    文件:ManifestFetcher.java   
@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();
  }
}
项目:ExoPlayer-Demo    文件:ManifestFetcher.java   
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  try {
    wrappedCallback.onSingleManifestError(exception);
  } finally {
    releaseLoader();
  }
}
项目:android-exoplayer    文件:ChunkSampleSource.java   
@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();
  }
}
项目:android-exoplayer    文件:ChunkSampleSource.java   
@Override
public void onLoadError(Loadable loadable, IOException e) {
  currentLoadableException = e;
  currentLoadableExceptionCount++;
  currentLoadableExceptionTimestamp = SystemClock.elapsedRealtime();
  notifyUpstreamError(e);
  chunkSource.onChunkLoadError(currentLoadableHolder.chunk, e);
  updateLoadControl();
}
项目:android-exoplayer    文件:ManifestFetcher.java   
@Override
public void onLoadCompleted(Loadable loadable) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  manifest = currentLoadable.result;
  manifestLoadTimestamp = SystemClock.elapsedRealtime();
  loadExceptionCount = 0;
  loadException = null;

  notifyManifestRefreshed();
}
项目:android-exoplayer    文件:ManifestFetcher.java   
@Override
public void onLoadError(Loadable loadable, IOException exception) {
  if (currentLoadable != loadable) {
    // Stale event.
    return;
  }

  loadExceptionCount++;
  loadExceptionTimestamp = SystemClock.elapsedRealtime();
  loadException = new IOException(exception);

  notifyManifestError(loadException);
}
项目:android-exoplayer    文件:ManifestFetcher.java   
@Override
public void onLoadCompleted(Loadable loadable) {
  try {
    manifest = singleUseLoadable.result;
    manifestLoadTimestamp = SystemClock.elapsedRealtime();
    wrappedCallback.onManifest(contentId, singleUseLoadable.result);
  } finally {
    releaseLoader();
  }
}