Package com.castlabs.android.player

# Class AbstractVideoRendererListener

java.lang.Object
com.castlabs.android.player.AbstractVideoRendererListener

All Implemented Interfaces:
  `VideoRendererListener`

public abstract class AbstractVideoRendererListener extends Object implements VideoRendererListener
Abstract implementation of the `VideoRendererListener`

Since:
  4.2.4

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractVideoRendererListener()`
  Default constructor for AbstractVideoRendererListener.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onDroppedFrames(int count, long elapsedMs)`
  Called to report the number of frames dropped by the renderer.
  `void`
  `onRenderedFirstFrame(Surface surface)`
  Called when a frame is rendered for the first time since setting the surface, and when a frame is rendered for the first time since the renderer was reset.
  `void`
  `onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)`
  Called when a decoder is created.
  `void`
  `onVideoDecoderReleased(String decoderName, long releasedTimestampMs, long releaseDurationMs)`
  Called when a decoder is released.
  `void`
  `onVideoDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)`
  Called when the renderer is disabled.
  `void`
  `onVideoEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)`
  Called when the renderer is enabled.
  `void`
  `onVideoInputFormatChanged(com.google.android.exoplayer2.Format format)`
  Called when the format of the media being consumed by the renderer changes.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AbstractVideoRendererListener

    public AbstractVideoRendererListener()
    Default constructor for AbstractVideoRendererListener.

- ## Method Details

  - ### onVideoEnabled

    public void onVideoEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
    Description copied from interface: `VideoRendererListener`
    Called when the renderer is enabled.
    Specified by:
      `onVideoEnabled` in interface `VideoRendererListener`
    Parameters:
      `counters` - `DecoderCounters` that will be updated by the renderer for as long as it remains enabled.

  - ### onVideoDecoderInitialized

    public void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
    Description copied from interface: `VideoRendererListener`
    Called when a decoder is created.
    Specified by:
      `onVideoDecoderInitialized` in interface `VideoRendererListener`
    Parameters:
      `decoderName` - The decoder that was created.
      `initializedTimestampMs` - `SystemClock.elapsedRealtime()` when initialization finished.
      `initializationDurationMs` - The time taken to initialize the decoder in milliseconds.

  - ### onVideoDecoderReleased

    public void onVideoDecoderReleased(@NonNull String decoderName, long releasedTimestampMs, long releaseDurationMs)
    Description copied from interface: `VideoRendererListener`
    Called when a decoder is released.
    Specified by:
      `onVideoDecoderReleased` in interface `VideoRendererListener`
    Parameters:
      `decoderName` - The decoder that was released.
      `releasedTimestampMs` - `SystemClock.elapsedRealtime()` when release finished.
      `releaseDurationMs` - The time taken to release the decoder in milliseconds.

  - ### onVideoInputFormatChanged

    public void onVideoInputFormatChanged(com.google.android.exoplayer2.Format format)
    Description copied from interface: `VideoRendererListener`
    Called when the format of the media being consumed by the renderer changes.
    Specified by:
      `onVideoInputFormatChanged` in interface `VideoRendererListener`
    Parameters:
      `format` - The new format.

  - ### onDroppedFrames

    public void onDroppedFrames(int count, long elapsedMs)
    Description copied from interface: `VideoRendererListener`
    Called to report the number of frames dropped by the renderer. Dropped frames are reported whenever the renderer is stopped having dropped frames, and optionally, whenever the count reaches a specified threshold whilst the renderer is started.
    Specified by:
      `onDroppedFrames` in interface `VideoRendererListener`
    Parameters:
      `count` - The number of dropped frames.
      `elapsedMs` - The duration in milliseconds over which the frames were dropped. This duration is timed from when the renderer was started or from when dropped frames were last reported (whichever was more recent), and not from when the first of the reported drops occurred.

  - ### onRenderedFirstFrame

    public void onRenderedFirstFrame(Surface surface)
    Description copied from interface: `VideoRendererListener`
    Called when a frame is rendered for the first time since setting the surface, and when a frame is rendered for the first time since the renderer was reset.
    Specified by:
      `onRenderedFirstFrame` in interface `VideoRendererListener`
    Parameters:
      `surface` - The `Surface` to which a first frame has been rendered, or `null` if the renderer renders to something that isn't a `Surface`.

  - ### onVideoDisabled

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