Package com.castlabs.android.player
Class AbstractVideoRendererListener
java.lang.Object
com.castlabs.android.player.AbstractVideoRendererListener
- All Implemented Interfaces:
VideoRendererListener
Abstract implementation of the
VideoRendererListener
- Since:
- 4.2.4
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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.
-
Constructor Details
-
AbstractVideoRendererListener
public 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 interfaceVideoRendererListener
- 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 interfaceVideoRendererListener
- Parameters:
decoderName
- The decoder that was created.initializedTimestampMs
-SystemClock.elapsedRealtime()
when initialization finished.initializationDurationMs
- The time taken to initialize 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 interfaceVideoRendererListener
- 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 interfaceVideoRendererListener
- 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
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 interfaceVideoRendererListener
- Parameters:
surface
- TheSurface
to which a first frame has been rendered, ornull
if the renderer renders to something that isn't aSurface
.
-
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 interfaceVideoRendererListener
- Parameters:
counters
-DecoderCounters
that were updated by the renderer.
-