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
ConstructorsConstructorDescriptionDefault constructor for AbstractVideoRendererListener. -
Method Summary
Modifier and TypeMethodDescriptionvoidonDroppedFrames(int count, long elapsedMs) Called to report the number of frames dropped by the renderer.voidonRenderedFirstFrame(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.voidonVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) Called when a decoder is created.voidonVideoDecoderReleased(String decoderName, long releasedTimestampMs, long releaseDurationMs) Called when a decoder is released.voidonVideoDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Called when the renderer is disabled.voidonVideoEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Called when the renderer is enabled.voidonVideoInputFormatChanged(com.google.android.exoplayer2.Format format) Called when the format of the media being consumed by the renderer changes.
-
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:VideoRendererListenerCalled when the renderer is enabled.- Specified by:
onVideoEnabledin interfaceVideoRendererListener- Parameters:
counters-DecoderCountersthat 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:VideoRendererListenerCalled when a decoder is created.- Specified by:
onVideoDecoderInitializedin interfaceVideoRendererListener- 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:VideoRendererListenerCalled when a decoder is released.- Specified by:
onVideoDecoderReleasedin interfaceVideoRendererListener- 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:VideoRendererListenerCalled when the format of the media being consumed by the renderer changes.- Specified by:
onVideoInputFormatChangedin interfaceVideoRendererListener- Parameters:
format- The new format.
-
onDroppedFrames
public void onDroppedFrames(int count, long elapsedMs) Description copied from interface:VideoRendererListenerCalled 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:
onDroppedFramesin 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:VideoRendererListenerCalled 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:
onRenderedFirstFramein interfaceVideoRendererListener- Parameters:
surface- TheSurfaceto which a first frame has been rendered, ornullif the renderer renders to something that isn't aSurface.
-
onVideoDisabled
public void onVideoDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters) Description copied from interface:VideoRendererListenerCalled when the renderer is disabled.- Specified by:
onVideoDisabledin interfaceVideoRendererListener- Parameters:
counters-DecoderCountersthat were updated by the renderer.
-