public interface VideoRendererEventListener
Renderer events. All methods have no-op default implementations to
allow selective overrides.| Modifier and Type | Interface and Description |
|---|---|
static class |
VideoRendererEventListener.EventDispatcher
Dispatches events to a
VideoRendererEventListener. |
| Modifier and Type | Method and Description |
|---|---|
default void |
onDroppedFrames(int count,
long elapsedMs)
Called to report the number of frames dropped by the renderer.
|
default void |
onRenderedFirstFrame(android.view.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.
|
default void |
onVideoDecoderInitialized(java.lang.String decoderName,
long initializedTimestampMs,
long initializationDurationMs)
Called when a decoder is created.
|
default void |
onVideoDisabled(DecoderCounters counters)
Called when the renderer is disabled.
|
default void |
onVideoEnabled(DecoderCounters counters)
Called when the renderer is enabled.
|
default void |
onVideoInputFormatChanged(Format format)
Called when the format of the media being consumed by the renderer changes.
|
default void |
onVideoSizeChanged(int width,
int height,
int unappliedRotationDegrees,
float pixelWidthHeightRatio)
Called before a frame is rendered for the first time since setting the surface, and each time
there's a change in the size, rotation or pixel aspect ratio of the video being rendered.
|
default void onVideoEnabled(DecoderCounters counters)
counters - DecoderCounters that will be updated by the renderer for as long as it
remains enabled.default void onVideoDecoderInitialized(java.lang.String decoderName,
long initializedTimestampMs,
long initializationDurationMs)
decoderName - The decoder that was created.initializedTimestampMs - SystemClock.elapsedRealtime() when initialization
finished.initializationDurationMs - The time taken to initialize the decoder in milliseconds.default void onVideoInputFormatChanged(Format format)
format - The new format.default void onDroppedFrames(int count,
long elapsedMs)
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.default void onVideoSizeChanged(int width,
int height,
int unappliedRotationDegrees,
float pixelWidthHeightRatio)
width - The video width in pixels.height - The video height in pixels.unappliedRotationDegrees - For videos that require a rotation, this is the clockwise
rotation in degrees that the application should apply for the video for it to be rendered
in the correct orientation. This value will always be zero on API levels 21 and above,
since the renderer will apply all necessary rotations internally. On earlier API levels
this is not possible. Applications that use TextureView can apply the rotation by
calling TextureView.setTransform(android.graphics.Matrix). Applications that do not expect to encounter
rotated videos can safely ignore this parameter.pixelWidthHeightRatio - The width to height ratio of each pixel. For the normal case of
square pixels this will be equal to 1.0. Different values are indicative of anamorphic
content.default void onRenderedFirstFrame(@Nullable
android.view.Surface surface)
surface - The Surface to which a first frame has been rendered, or null if
the renderer renders to something that isn't a Surface.default void onVideoDisabled(DecoderCounters counters)
counters - DecoderCounters that were updated by the renderer.