Package com.castlabs.android.player
Class AbstractAudioRendererListener
java.lang.Object
com.castlabs.android.player.AbstractAudioRendererListener
- All Implemented Interfaces:
AudioRendererListener
Abstract implementation of the
AudioRendererListener- Since:
- 4.2.25
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the AbstractAudioRendererListener. -
Method Summary
Modifier and TypeMethodDescriptionvoidonAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) Called when a decoder is created.voidonAudioDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Called when the renderer is disabled.voidonAudioEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Called when the renderer is enabled.voidonAudioInputFormatChanged(com.google.android.exoplayer2.Format format) Called when the format of the media being consumed by the renderer changes.voidonAudioSessionId(int audioSessionId) Called when the audio session is set.voidonAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs) Called when anAudioSinkunderrun occurs.voidonPositionFramesMismatch(long audioTimestampPositionFrames, long audioTimestampSystemTimeUs, long systemTimeUs, long playbackPositionUs) Called when the frame position is too far from the expected frame position.voidonSystemTimeUsMismatch(long audioTimestampPositionFrames, long audioTimestampSystemTimeUs, long systemTimeUs, long playbackPositionUs) Called when the system time associated with the last known audio track timestamp is unexpectedly far from the current time.
-
Constructor Details
-
AbstractAudioRendererListener
public AbstractAudioRendererListener()Default constructor for the AbstractAudioRendererListener.
-
-
Method Details
-
onAudioEnabled
public void onAudioEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Description copied from interface:AudioRendererListenerCalled when the renderer is enabled.- Specified by:
onAudioEnabledin interfaceAudioRendererListener- Parameters:
counters-DecoderCountersthat will be updated by the renderer for as long as it remains enabled.
-
onAudioDecoderInitialized
public void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) Description copied from interface:AudioRendererListenerCalled when a decoder is created.- Specified by:
onAudioDecoderInitializedin interfaceAudioRendererListener- Parameters:
decoderName- The decoder that was created.initializedTimestampMs-SystemClock.elapsedRealtime()when initialization finished.initializationDurationMs- The time taken to initialize the decoder in milliseconds.
-
onAudioInputFormatChanged
public void onAudioInputFormatChanged(com.google.android.exoplayer2.Format format) Description copied from interface:AudioRendererListenerCalled when the format of the media being consumed by the renderer changes.- Specified by:
onAudioInputFormatChangedin interfaceAudioRendererListener- Parameters:
format- The new format.
-
onAudioDisabled
public void onAudioDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Description copied from interface:AudioRendererListenerCalled when the renderer is disabled.- Specified by:
onAudioDisabledin interfaceAudioRendererListener- Parameters:
counters-DecoderCountersthat were updated by the renderer.
-
onAudioSessionId
public void onAudioSessionId(int audioSessionId) Description copied from interface:AudioRendererListenerCalled when the audio session is set.- Specified by:
onAudioSessionIdin interfaceAudioRendererListener- Parameters:
audioSessionId- The audio session id.
-
onAudioSinkUnderrun
public void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs) Description copied from interface:AudioRendererListenerCalled when anAudioSinkunderrun occurs.- Specified by:
onAudioSinkUnderrunin interfaceAudioRendererListener- 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_UNSETif 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 theAudioSinkwas last fed data.
-
onPositionFramesMismatch
public void onPositionFramesMismatch(long audioTimestampPositionFrames, long audioTimestampSystemTimeUs, long systemTimeUs, long playbackPositionUs) Description copied from interface:AudioRendererListenerCalled when the frame position is too far from the expected frame position.- Specified by:
onPositionFramesMismatchin interfaceAudioRendererListener- Parameters:
audioTimestampPositionFrames- The frame position of the last known audio track timestamp.audioTimestampSystemTimeUs- The system time associated with the last known audio track timestamp, in microseconds.systemTimeUs- The current time.playbackPositionUs- The current playback head position in microseconds.
-
onSystemTimeUsMismatch
public void onSystemTimeUsMismatch(long audioTimestampPositionFrames, long audioTimestampSystemTimeUs, long systemTimeUs, long playbackPositionUs) Description copied from interface:AudioRendererListenerCalled when the system time associated with the last known audio track timestamp is unexpectedly far from the current time.- Specified by:
onSystemTimeUsMismatchin interfaceAudioRendererListener- Parameters:
audioTimestampPositionFrames- The frame position of the last known audio track timestamp.audioTimestampSystemTimeUs- The system time associated with the last known audio track timestamp, in microseconds.systemTimeUs- The current time.playbackPositionUs- The current playback head position in microseconds.
-