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); }
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); }
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); }