/** * Called when an output buffer is successfully processed. * * @param presentationTimeUs The timestamp associated with the output buffer. */ @CallSuper protected void onProcessedOutputBuffer(long presentationTimeUs) { buffersInCodecCount--; }
/** * Notifies the Activity that a support action mode has been started. * Activity subclasses overriding this method should call the superclass implementation. * * @param mode The new action mode. */ @Override @CallSuper public void onSupportActionModeStarted(ActionMode mode) { }
/** * Notifies the activity that a support action mode has finished. * Activity subclasses overriding this method should call the superclass implementation. * * @param mode The action mode that just finished. */ @Override @CallSuper public void onSupportActionModeFinished(ActionMode mode) { }
/** * {@inheritDoc} */ @Deprecated @Override @CallSuper public void detachView(boolean retainInstance) { }
@Override @CallSuper public void prepareSourceInternal( ExoPlayer player, boolean isTopLevelSource, @Nullable TransferListener mediaTransferListener) { this.player = player; this.mediaTransferListener = mediaTransferListener; eventHandler = new Handler(); }
@CallSuper @Override public void removeCallback(@NonNull SizeReadyCallback cb) { sizeDeterminer.removeCallback(cb); }
/** * Determines the size of the view by first checking {@link android.view.View#getWidth()} and * {@link android.view.View#getHeight()}. If one or both are zero, it then checks the view's * {@link LayoutParams}. If one or both of the params width and height are less than or equal to * zero, it then adds an {@link android.view.ViewTreeObserver.OnPreDrawListener} which waits until * the view has been measured before calling the callback with the view's drawn width and height. * * @param cb {@inheritDoc} */ @CallSuper @Override public void getSize(@NonNull SizeReadyCallback cb) { sizeDeterminer.getSize(cb); }
@CallSuper @Override protected void flushCodec() throws ExoPlaybackException { super.flushCodec(); buffersInCodecCount = 0; }
@Override @CallSuper public void maybeThrowSourceInfoRefreshError() throws IOException { for (MediaSourceAndListener childSource : childSources.values()) { childSource.mediaSource.maybeThrowSourceInfoRefreshError(); } }
@CallSuper @Override protected void onProcessedOutputBuffer(long presentationTimeUs) { while (pendingStreamChangeCount != 0 && presentationTimeUs >= pendingStreamChangeTimesUs[0]) { audioSink.handleDiscontinuity(); pendingStreamChangeCount--; System.arraycopy( pendingStreamChangeTimesUs, /* srcPos= */ 1, pendingStreamChangeTimesUs, /* destPos= */ 0, pendingStreamChangeCount); } }
/** * Called when a decoder has been created and configured. * * <p>The default implementation is a no-op. * * @param name The name of the decoder that was initialized. * @param initializedTimestampMs {@link SystemClock#elapsedRealtime()} when initialization * finished. * @param initializationDurationMs The time taken to initialize the decoder, in milliseconds. */ @CallSuper protected void onDecoderInitialized( String name, long initializedTimestampMs, long initializationDurationMs) { eventDispatcher.decoderInitialized(name, initializedTimestampMs, initializationDurationMs); }
/** Releases the decoder. */ @CallSuper protected void releaseDecoder() { if (decoder == null) { return; } inputBuffer = null; outputBuffer = null; decoder.release(); decoder = null; decoderCounters.decoderReleaseCount++; decoderReinitializationState = REINITIALIZATION_STATE_NONE; decoderReceivedBuffers = false; buffersInCodecCount = 0; }
/** * Called immediately before an input buffer is queued into the codec. * * @param buffer The buffer to be queued. */ @CallSuper @Override protected void onQueueInputBuffer(DecoderInputBuffer buffer) { buffersInCodecCount++; lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs); if (Util.SDK_INT < 23 && tunneling) { // In tunneled mode before API 23 we don't have a way to know when the buffer is output, so // treat it as if it were output immediately. onProcessedTunneledBuffer(buffer.timeUs); } }
@CallSuper @Override public void onLoadStarted(@Nullable Drawable placeholder) { super.onLoadStarted(placeholder); maybeAddAttachStateListener(); }
@CallSuper @Override protected void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); if (userCommentView != null && userCommentView.getText() != null) { outState.putString(STATE_COMMENT, userCommentView.getText().toString()); } if (userEmailView != null && userEmailView.getText() != null) { outState.putString(STATE_EMAIL, userEmailView.getText().toString()); } }
@Override @CallSuper public void onDismissed(BottomSheetLayout bottomSheetLayout) { if (!viewDestroyed) { dismissInternal(true); } } }
@Override @CallSuper public void releaseSourceInternal() { for (MediaSourceAndListener childSource : childSources.values()) { childSource.mediaSource.releaseSource(childSource.listener); childSource.mediaSource.removeEventListener(childSource.eventListener); } childSources.clear(); player = null; }
/** * {@inheritDoc} */ @CallSuper @Override protected void onTakeView(View view) { views.onNext(view); }
/** * {@inheritDoc} */ @CallSuper @Override protected void onDropView() { views.onNext(null); }
@CallSuper @Override public void onLoadCleared(@Nullable Drawable placeholder) { super.onLoadCleared(placeholder); sizeDeterminer.clearCallbacksAndListener(); if (!isClearedByUs) { maybeRemoveAttachStateListener(); } }