public interface AudioRendererEventListener
Renderer
events.Modifier and Type | Interface and Description |
---|---|
static class |
AudioRendererEventListener.EventDispatcher
Dispatches events to a
AudioRendererEventListener . |
Modifier and Type | Method and Description |
---|---|
void |
onAudioDecoderInitialized(String decoderName,
long initializedTimestampMs,
long initializationDurationMs)
Called when a decoder is created.
|
void |
onAudioDisabled(DecoderCounters counters)
Called when the renderer is disabled.
|
void |
onAudioEnabled(DecoderCounters counters)
Called when the renderer is enabled.
|
void |
onAudioInputFormatChanged(Format format)
Called when the format of the media being consumed by the renderer changes.
|
void |
onAudioSessionId(int audioSessionId)
Called when the audio session is set.
|
void |
onAudioTrackUnderrun(int bufferSize,
long bufferSizeMs,
long elapsedSinceLastFeedMs)
Called when an
AudioTrack underrun occurs. |
void onAudioEnabled(DecoderCounters counters)
counters
- DecoderCounters
that will be updated by the renderer for as long as it
remains enabled.void onAudioSessionId(int audioSessionId)
audioSessionId
- The audio session id.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.void onAudioInputFormatChanged(Format format)
format
- The new format.void onAudioTrackUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
AudioTrack
underrun occurs.bufferSize
- The size of the AudioTrack
's buffer, in bytes.bufferSizeMs
- The size of the AudioTrack
'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 AudioTrack
was last fed data.void onAudioDisabled(DecoderCounters counters)
counters
- DecoderCounters
that were updated by the renderer.