Interface AudioRendererEventListener
-
@Deprecated public interface AudioRendererEventListener
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Listener of audioRenderer
events. All methods have no-op default implementations to allow selective overrides.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AudioRendererEventListener.EventDispatcher
Deprecated.Dispatches events to anAudioRendererEventListener
.
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
onAudioCodecError(Exception audioCodecError)
Deprecated.Called when an audio decoder encounters an error.default void
onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Deprecated.Called when a decoder is created.default void
onAudioDecoderReleased(String decoderName)
Deprecated.Called when a decoder is released.default void
onAudioDisabled(DecoderCounters counters)
Deprecated.Called when the renderer is disabled.default void
onAudioEnabled(DecoderCounters counters)
Deprecated.Called when the renderer is enabled.default void
onAudioInputFormatChanged(Format format)
Deprecated.default void
onAudioInputFormatChanged(Format format, DecoderReuseEvaluation decoderReuseEvaluation)
Deprecated.Called when the format of the media being consumed by the renderer changes.default void
onAudioPositionAdvancing(long playoutStartSystemTimeMs)
Deprecated.Called when the audio position has increased for the first time since the last pause or position reset.default void
onAudioSinkError(Exception audioSinkError)
Deprecated.Called whenAudioSink
has encountered an error.default void
onAudioUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Deprecated.Called when an audio underrun occurs.default void
onSkipSilenceEnabledChanged(boolean skipSilenceEnabled)
Deprecated.Called when skipping silences is enabled or disabled in the audio stream.
-
-
-
Method Detail
-
onAudioEnabled
default void onAudioEnabled(DecoderCounters counters)
Deprecated.Called when the renderer is enabled.- Parameters:
counters
-DecoderCounters
that will be updated by the renderer for as long as it remains enabled.
-
onAudioDecoderInitialized
default void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Deprecated.Called when a decoder is created.- Parameters:
decoderName
- The decoder that was created.initializedTimestampMs
-SystemClock.elapsedRealtime()
when initialization finished.initializationDurationMs
- The time taken to initialize the decoder in milliseconds.
-
onAudioInputFormatChanged
@Deprecated default void onAudioInputFormatChanged(Format format)
Deprecated.
-
onAudioInputFormatChanged
default void onAudioInputFormatChanged(Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation)
Deprecated.Called when the format of the media being consumed by the renderer changes.- Parameters:
format
- The new format.decoderReuseEvaluation
- The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, ornull
if the renderer did not have a decoder.
-
onAudioPositionAdvancing
default void onAudioPositionAdvancing(long playoutStartSystemTimeMs)
Deprecated.Called when the audio position has increased for the first time since the last pause or position reset.- Parameters:
playoutStartSystemTimeMs
- The approximate derivedSystem.currentTimeMillis()
at which playout started.
-
onAudioUnderrun
default void onAudioUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Deprecated.Called when an audio underrun occurs.- Parameters:
bufferSize
- The size of the audio output buffer, in bytes.bufferSizeMs
- The size of the audio output buffer, in milliseconds, if it contains PCM encoded audio.C.TIME_UNSET
if the output buffer contains non-PCM encoded audio.elapsedSinceLastFeedMs
- The time since audio was last written to the output buffer.
-
onAudioDecoderReleased
default void onAudioDecoderReleased(String decoderName)
Deprecated.Called when a decoder is released.- Parameters:
decoderName
- The decoder that was released.
-
onAudioDisabled
default void onAudioDisabled(DecoderCounters counters)
Deprecated.Called when the renderer is disabled.- Parameters:
counters
-DecoderCounters
that were updated by the renderer.
-
onSkipSilenceEnabledChanged
default void onSkipSilenceEnabledChanged(boolean skipSilenceEnabled)
Deprecated.Called when skipping silences is enabled or disabled in the audio stream.- Parameters:
skipSilenceEnabled
- Whether skipping silences in the audio stream is enabled.
-
onAudioCodecError
default void onAudioCodecError(Exception audioCodecError)
Deprecated.Called when an audio decoder encounters an error.This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry.
Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException)
is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.- Parameters:
audioCodecError
- The error. Typically aMediaCodec.CodecException
if the renderer usesMediaCodec
, or aDecoderException
if the renderer uses a software decoder.
-
onAudioSinkError
default void onAudioSinkError(Exception audioSinkError)
Deprecated.Called whenAudioSink
has encountered an error.If the sink writes to a platform
AudioTrack
, this will be called for allAudioTrack
errors.This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry.
Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException)
is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.- Parameters:
audioSinkError
- The error that occurred. Typically anAudioSink.InitializationException
, aAudioSink.WriteException
, or anAudioSink.UnexpectedDiscontinuityException
.
-
-