Package com.castlabs.android.player
Interface AudioRendererListener
-
- All Known Implementing Classes:
AbstractAudioRendererListener
public interface AudioRendererListener
A listener that can be attached to thePlayerController
to be informed about audio rendering events such as decoder initializations, format changes and frame drops. Note that all events are posted async on the main thread- Since:
- 4.2.25
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
Called when a decoder is created.void
onAudioDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
Called when the renderer is disabled.void
onAudioEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
Called when the renderer is enabled.void
onAudioInputFormatChanged(com.google.android.exoplayer2.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
onAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Called when anAudioSink
underrun occurs.
-
-
-
Method Detail
-
onAudioEnabled
void onAudioEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
Called when the renderer is enabled.- Parameters:
counters
-DecoderCounters
that will be updated by the renderer for as long as it remains enabled.
-
onAudioDecoderInitialized
void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
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
void onAudioInputFormatChanged(com.google.android.exoplayer2.Format format)
Called when the format of the media being consumed by the renderer changes.- Parameters:
format
- The new format.
-
onAudioDisabled
void onAudioDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
Called when the renderer is disabled.- Parameters:
counters
-DecoderCounters
that were updated by the renderer.
-
onAudioSessionId
void onAudioSessionId(int audioSessionId)
Called when the audio session is set.- Parameters:
audioSessionId
- The audio session id.
-
onAudioSinkUnderrun
void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Called when anAudioSink
underrun occurs.- Parameters:
bufferSize
- The size of theAudioSink
's buffer, in bytes.bufferSizeMs
- The size of theAudioSink
'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 theAudioSink
was last fed data.
-
-