Class AbstractAudioRendererListener

java.lang.Object
com.castlabs.android.player.AbstractAudioRendererListener
All Implemented Interfaces:
AudioRendererListener

public abstract class AbstractAudioRendererListener extends Object implements AudioRendererListener
Abstract implementation of the AudioRendererListener
Since:
4.2.25
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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 an AudioSink underrun occurs.
    void
    onPositionFramesMismatch(long audioTimestampPositionFrames, long audioTimestampSystemTimeUs, long systemTimeUs, long playbackPositionUs)
    Called when the frame position is too far from the expected frame position.
    void
    onSystemTimeUsMismatch(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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractAudioRendererListener

      public AbstractAudioRendererListener()
  • Method Details

    • onAudioEnabled

      public void onAudioEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
      Description copied from interface: AudioRendererListener
      Called when the renderer is enabled.
      Specified by:
      onAudioEnabled in interface AudioRendererListener
      Parameters:
      counters - DecoderCounters that 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: AudioRendererListener
      Called when a decoder is created.
      Specified by:
      onAudioDecoderInitialized in interface AudioRendererListener
      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: AudioRendererListener
      Called when the format of the media being consumed by the renderer changes.
      Specified by:
      onAudioInputFormatChanged in interface AudioRendererListener
      Parameters:
      format - The new format.
    • onAudioDisabled

      public void onAudioDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
      Description copied from interface: AudioRendererListener
      Called when the renderer is disabled.
      Specified by:
      onAudioDisabled in interface AudioRendererListener
      Parameters:
      counters - DecoderCounters that were updated by the renderer.
    • onAudioSessionId

      public void onAudioSessionId(int audioSessionId)
      Description copied from interface: AudioRendererListener
      Called when the audio session is set.
      Specified by:
      onAudioSessionId in interface AudioRendererListener
      Parameters:
      audioSessionId - The audio session id.
    • onAudioSinkUnderrun

      public void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
      Description copied from interface: AudioRendererListener
      Called when an AudioSink underrun occurs.
      Specified by:
      onAudioSinkUnderrun in interface AudioRendererListener
      Parameters:
      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.
    • onPositionFramesMismatch

      public void onPositionFramesMismatch(long audioTimestampPositionFrames, long audioTimestampSystemTimeUs, long systemTimeUs, long playbackPositionUs)
      Description copied from interface: AudioRendererListener
      Called when the frame position is too far from the expected frame position.
      Specified by:
      onPositionFramesMismatch in interface AudioRendererListener
      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: AudioRendererListener
      Called when the system time associated with the last known audio track timestamp is unexpectedly far from the current time.
      Specified by:
      onSystemTimeUsMismatch in interface AudioRendererListener
      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.