public interface AudioRendererEventListener
Renderer
events. All methods have no-op default implementations to
allow selective overrides.Modifier and Type | Interface and Description |
---|---|
static class |
AudioRendererEventListener.EventDispatcher
Dispatches events to a
AudioRendererEventListener . |
Modifier and Type | Method and Description |
---|---|
default void |
onAudioDecoderInitialized(String decoderName,
long initializedTimestampMs,
long initializationDurationMs)
Called when a decoder is created.
|
default void |
onAudioDisabled(DecoderCounters counters)
Called when the renderer is disabled.
|
default void |
onAudioEnabled(DecoderCounters counters)
Called when the renderer is enabled.
|
default void |
onAudioInputFormatChanged(Format format)
Called when the format of the media being consumed by the renderer changes.
|
default void |
onAudioSessionId(int audioSessionId)
Called when the audio session is set.
|
default void |
onAudioSinkUnderrun(int bufferSize,
long bufferSizeMs,
long elapsedSinceLastFeedMs)
Called when an
AudioSink underrun occurs. |
default void onAudioEnabled(DecoderCounters counters)
counters
- DecoderCounters
that will be updated by the renderer for as long as it
remains enabled.default void onAudioSessionId(int audioSessionId)
audioSessionId
- The audio session id.default void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
decoderName
- The decoder that was created.initializedTimestampMs
- SystemClock.elapsedRealtime()
when initialization
finished.initializationDurationMs
- The time taken to initialize the decoder in milliseconds.default void onAudioInputFormatChanged(Format format)
format
- The new format.default void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
AudioSink
underrun occurs.bufferSize
- The size of the AudioSink
's buffer, in bytes.bufferSizeMs
- The size of the AudioSink
's buffer, in milliseconds, if it is
configured for PCM output. C.TIME_UNSET
if it is configured for passthrough output,
as the buffered media can have a variable bitrate so the duration may be unknown.elapsedSinceLastFeedMs
- The time since the AudioSink
was last fed data.default void onAudioDisabled(DecoderCounters counters)
counters
- DecoderCounters
that were updated by the renderer.