Skip to content

Commit

Permalink
Add @ForOverride to DecoderAudioRenderer protected methods
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 487779266
  • Loading branch information
icbaker committed Nov 14, 2022
1 parent 0383b72 commit a34fdcf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.TraceUtil;
import com.google.android.exoplayer2.util.Util;
import com.google.errorprone.annotations.ForOverride;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down Expand Up @@ -257,6 +258,7 @@ public MediaClock getMediaClock() {
* @param format The format, which has an audio {@link Format#sampleMimeType}.
* @return The {@link C.FormatSupport} for this {@link Format}.
*/
@ForOverride
protected abstract @C.FormatSupport int supportsFormatInternal(Format format);

/**
Expand Down Expand Up @@ -346,6 +348,7 @@ public void render(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackEx

/** See {@link AudioSink.Listener#onPositionDiscontinuity()}. */
@CallSuper
@ForOverride
protected void onPositionDiscontinuity() {
// We are out of sync so allow currentPositionUs to jump backwards.
allowPositionDiscontinuity = true;
Expand All @@ -360,6 +363,7 @@ protected void onPositionDiscontinuity() {
* @return The decoder.
* @throws DecoderException If an error occurred creating a suitable decoder.
*/
@ForOverride
protected abstract T createDecoder(Format format, @Nullable CryptoConfig cryptoConfig)
throws DecoderException;

Expand All @@ -369,6 +373,7 @@ protected abstract T createDecoder(Format format, @Nullable CryptoConfig cryptoC
*
* @param decoder The decoder.
*/
@ForOverride
protected abstract Format getOutputFormat(T decoder);

/**
Expand All @@ -381,6 +386,7 @@ protected abstract T createDecoder(Format format, @Nullable CryptoConfig cryptoC
* @param newFormat The new format.
* @return The result of the evaluation.
*/
@ForOverride
protected DecoderReuseEvaluation canReuseDecoder(
String decoderName, Format oldFormat, Format newFormat) {
return new DecoderReuseEvaluation(
Expand Down

0 comments on commit a34fdcf

Please sign in to comment.