Commit a34fdcf1 by ibaker Committed by Ian Baker

Add `@ForOverride` to `DecoderAudioRenderer` `protected` methods

PiperOrigin-RevId: 487779266
parent 0383b723
...@@ -59,6 +59,7 @@ import com.google.android.exoplayer2.util.MediaClock; ...@@ -59,6 +59,7 @@ import com.google.android.exoplayer2.util.MediaClock;
import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.TraceUtil; import com.google.android.exoplayer2.util.TraceUtil;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import com.google.errorprone.annotations.ForOverride;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
...@@ -257,6 +258,7 @@ public abstract class DecoderAudioRenderer< ...@@ -257,6 +258,7 @@ public abstract class DecoderAudioRenderer<
* @param format The format, which has an audio {@link Format#sampleMimeType}. * @param format The format, which has an audio {@link Format#sampleMimeType}.
* @return The {@link C.FormatSupport} for this {@link Format}. * @return The {@link C.FormatSupport} for this {@link Format}.
*/ */
@ForOverride
protected abstract @C.FormatSupport int supportsFormatInternal(Format format); protected abstract @C.FormatSupport int supportsFormatInternal(Format format);
/** /**
...@@ -346,6 +348,7 @@ public abstract class DecoderAudioRenderer< ...@@ -346,6 +348,7 @@ public abstract class DecoderAudioRenderer<
/** See {@link AudioSink.Listener#onPositionDiscontinuity()}. */ /** See {@link AudioSink.Listener#onPositionDiscontinuity()}. */
@CallSuper @CallSuper
@ForOverride
protected void onPositionDiscontinuity() { protected void onPositionDiscontinuity() {
// We are out of sync so allow currentPositionUs to jump backwards. // We are out of sync so allow currentPositionUs to jump backwards.
allowPositionDiscontinuity = true; allowPositionDiscontinuity = true;
...@@ -360,6 +363,7 @@ public abstract class DecoderAudioRenderer< ...@@ -360,6 +363,7 @@ public abstract class DecoderAudioRenderer<
* @return The decoder. * @return The decoder.
* @throws DecoderException If an error occurred creating a suitable decoder. * @throws DecoderException If an error occurred creating a suitable decoder.
*/ */
@ForOverride
protected abstract T createDecoder(Format format, @Nullable CryptoConfig cryptoConfig) protected abstract T createDecoder(Format format, @Nullable CryptoConfig cryptoConfig)
throws DecoderException; throws DecoderException;
...@@ -369,6 +373,7 @@ public abstract class DecoderAudioRenderer< ...@@ -369,6 +373,7 @@ public abstract class DecoderAudioRenderer<
* *
* @param decoder The decoder. * @param decoder The decoder.
*/ */
@ForOverride
protected abstract Format getOutputFormat(T decoder); protected abstract Format getOutputFormat(T decoder);
/** /**
...@@ -381,6 +386,7 @@ public abstract class DecoderAudioRenderer< ...@@ -381,6 +386,7 @@ public abstract class DecoderAudioRenderer<
* @param newFormat The new format. * @param newFormat The new format.
* @return The result of the evaluation. * @return The result of the evaluation.
*/ */
@ForOverride
protected DecoderReuseEvaluation canReuseDecoder( protected DecoderReuseEvaluation canReuseDecoder(
String decoderName, Format oldFormat, Format newFormat) { String decoderName, Format oldFormat, Format newFormat) {
return new DecoderReuseEvaluation( return new DecoderReuseEvaluation(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment