Java 类com.google.android.exoplayer.util.PriorityHandlerThread 实例源码

项目:miku    文件:ExoPlayerImplInternal.java   
public ExoPlayerImplInternal(Handler eventHandler, boolean playWhenReady,
    boolean[] rendererEnabledFlags, int minBufferMs, int minRebufferMs) {
  this.eventHandler = eventHandler;
  this.playWhenReady = playWhenReady;
  this.rendererEnabledFlags = new boolean[rendererEnabledFlags.length];
  this.minBufferUs = minBufferMs * 1000L;
  this.minRebufferUs = minRebufferMs * 1000L;
  for (int i = 0; i < rendererEnabledFlags.length; i++) {
    this.rendererEnabledFlags[i] = rendererEnabledFlags[i];
  }

  this.state = ExoPlayer.STATE_IDLE;
  this.durationUs = TrackRenderer.UNKNOWN_TIME_US;
  this.bufferedPositionUs = TrackRenderer.UNKNOWN_TIME_US;

  standaloneMediaClock = new StandaloneMediaClock();
  enabledRenderers = new ArrayList<>(rendererEnabledFlags.length);
  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new PriorityHandlerThread(getClass().getSimpleName() + ":Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}
项目:ExoPlayer-Demo    文件:ExoPlayerImplInternal.java   
public ExoPlayerImplInternal(Handler eventHandler, boolean playWhenReady,
    int[] selectedTrackIndices, int minBufferMs, int minRebufferMs) {
  this.eventHandler = eventHandler;
  this.playWhenReady = playWhenReady;
  this.minBufferUs = minBufferMs * 1000L;
  this.minRebufferUs = minRebufferMs * 1000L;
  this.selectedTrackIndices = Arrays.copyOf(selectedTrackIndices, selectedTrackIndices.length);
  this.state = ExoPlayer.STATE_IDLE;
  this.durationUs = TrackRenderer.UNKNOWN_TIME_US;
  this.bufferedPositionUs = TrackRenderer.UNKNOWN_TIME_US;

  standaloneMediaClock = new StandaloneMediaClock();
  pendingSeekCount = new AtomicInteger();
  enabledRenderers = new ArrayList<>(selectedTrackIndices.length);
  trackFormats = new MediaFormat[selectedTrackIndices.length][];
  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new PriorityHandlerThread("ExoPlayerImplInternal:Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}
项目:android-exoplayer    文件:ExoPlayerImplInternal.java   
public ExoPlayerImplInternal(Handler eventHandler, boolean playWhenReady,
    boolean[] rendererEnabledFlags, int minBufferMs, int minRebufferMs) {
  this.eventHandler = eventHandler;
  this.playWhenReady = playWhenReady;
  this.rendererEnabledFlags = new boolean[rendererEnabledFlags.length];
  this.minBufferUs = minBufferMs * 1000L;
  this.minRebufferUs = minRebufferMs * 1000L;
  for (int i = 0; i < rendererEnabledFlags.length; i++) {
    this.rendererEnabledFlags[i] = rendererEnabledFlags[i];
  }

  this.state = ExoPlayer.STATE_IDLE;
  this.durationUs = TrackRenderer.UNKNOWN_TIME_US;
  this.bufferedPositionUs = TrackRenderer.UNKNOWN_TIME_US;

  mediaClock = new MediaClock();
  enabledRenderers = new ArrayList<TrackRenderer>(rendererEnabledFlags.length);
  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new PriorityHandlerThread(getClass().getSimpleName() + ":Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}
项目:Exoplayer_VLC    文件:ExoPlayerImplInternal.java   
public ExoPlayerImplInternal(Handler eventHandler, boolean playWhenReady,
    boolean[] rendererEnabledFlags, int minBufferMs, int minRebufferMs) {
  this.eventHandler = eventHandler;
  this.playWhenReady = playWhenReady;
  this.rendererEnabledFlags = new boolean[rendererEnabledFlags.length];
  this.minBufferUs = minBufferMs * 1000L;
  this.minRebufferUs = minRebufferMs * 1000L;
  for (int i = 0; i < rendererEnabledFlags.length; i++) {
    this.rendererEnabledFlags[i] = rendererEnabledFlags[i];
  }

  this.state = ExoPlayer.STATE_IDLE;
  this.durationUs = TrackRenderer.UNKNOWN_TIME_US;
  this.bufferedPositionUs = TrackRenderer.UNKNOWN_TIME_US;

  mediaClock = new MediaClock();
  enabledRenderers = new ArrayList<TrackRenderer>(rendererEnabledFlags.length);
  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new PriorityHandlerThread(getClass().getSimpleName() + ":Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}
项目:ExoPlayer    文件:ExoPlayerImplInternal.java   
public ExoPlayerImplInternal(Handler eventHandler, boolean playWhenReady,
    boolean[] rendererEnabledFlags, int minBufferMs, int minRebufferMs) {
  this.eventHandler = eventHandler;
  this.playWhenReady = playWhenReady;
  this.rendererEnabledFlags = new boolean[rendererEnabledFlags.length];
  this.minBufferUs = minBufferMs * 1000L;
  this.minRebufferUs = minRebufferMs * 1000L;
  for (int i = 0; i < rendererEnabledFlags.length; i++) {
    this.rendererEnabledFlags[i] = rendererEnabledFlags[i];
  }

  this.state = ExoPlayer.STATE_IDLE;
  this.durationUs = TrackRenderer.UNKNOWN_TIME_US;
  this.bufferedPositionUs = TrackRenderer.UNKNOWN_TIME_US;

  standaloneMediaClock = new StandaloneMediaClock();
  enabledRenderers = new ArrayList<>(rendererEnabledFlags.length);
  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new PriorityHandlerThread(getClass().getSimpleName() + ":Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}