AudioRendererEventListener.EventDispatcher


public final class AudioRendererEventListener.EventDispatcher


Dispatches events to an AudioRendererEventListener.

Summary

Public constructors

Public methods

void
audioCodecError(Exception audioCodecError)

Invokes onAudioCodecError.

void
audioSinkError(Exception audioSinkError)

Invokes onAudioSinkError.

void

Invokes onAudioTrackInitialized.

void

Invokes onAudioTrackReleased.

void
decoderInitialized(
    String decoderName,
    long initializedTimestampMs,
    long initializationDurationMs
)

Invokes onAudioDecoderInitialized.

void
decoderReleased(String decoderName)

Invokes onAudioDecoderReleased.

void

Invokes onAudioDisabled.

void
enabled(DecoderCounters decoderCounters)

Invokes onAudioEnabled.

void
inputFormatChanged(
    Format format,
    @Nullable DecoderReuseEvaluation decoderReuseEvaluation
)

Invokes onAudioInputFormatChanged.

void
positionAdvancing(long playoutStartSystemTimeMs)

Invokes onAudioPositionAdvancing.

void
skipSilenceEnabledChanged(boolean skipSilenceEnabled)

Invokes onSkipSilenceEnabledChanged.

void
underrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)

Invokes onAudioUnderrun.

Public constructors

EventDispatcher

public EventDispatcher(
    @Nullable Handler handler,
    @Nullable AudioRendererEventListener listener
)
Parameters
@Nullable Handler handler

A handler for dispatching events, or null if events should not be dispatched.

@Nullable AudioRendererEventListener listener

The listener to which events should be dispatched, or null if events should not be dispatched.

Public methods

audioCodecError

public void audioCodecError(Exception audioCodecError)

Invokes onAudioCodecError.

audioSinkError

public void audioSinkError(Exception audioSinkError)

Invokes onAudioSinkError.

audioTrackInitialized

public void audioTrackInitialized(AudioSink.AudioTrackConfig audioTrackConfig)

Invokes onAudioTrackInitialized.

audioTrackReleased

public void audioTrackReleased(AudioSink.AudioTrackConfig audioTrackConfig)

Invokes onAudioTrackReleased.

decoderInitialized

public void decoderInitialized(
    String decoderName,
    long initializedTimestampMs,
    long initializationDurationMs
)

Invokes onAudioDecoderInitialized.

decoderReleased

public void decoderReleased(String decoderName)

Invokes onAudioDecoderReleased.

disabled

public void disabled(DecoderCounters counters)

Invokes onAudioDisabled.

enabled

public void enabled(DecoderCounters decoderCounters)

Invokes onAudioEnabled.

inputFormatChanged

public void inputFormatChanged(
    Format format,
    @Nullable DecoderReuseEvaluation decoderReuseEvaluation
)

Invokes onAudioInputFormatChanged.

positionAdvancing

public void positionAdvancing(long playoutStartSystemTimeMs)

Invokes onAudioPositionAdvancing.

skipSilenceEnabledChanged

public void skipSilenceEnabledChanged(boolean skipSilenceEnabled)

Invokes onSkipSilenceEnabledChanged.

underrun

public void underrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)

Invokes onAudioUnderrun.