public interface

VideoFrameReleaseControl.FrameTimingEvaluator

 androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameTimingEvaluator

Subclasses:

MediaCodecVideoRenderer

Overview

Decides whether a frame should be forced to be released, or dropped.

Summary

Methods
public booleanshouldDropFrame(long earlyUs, long elapsedRealtimeUs, boolean isLastFrame)

Returns whether the frame should be dropped.

public booleanshouldForceReleaseFrame(long earlyUs, long elapsedSinceLastReleaseUs)

Whether a frame should be forced for release.

public booleanshouldIgnoreFrame(long earlyUs, long positionUs, long elapsedRealtimeUs, boolean isLastFrame, boolean treatDroppedBuffersAsSkipped)

Returns whether this frame should be ignored.

Methods

public boolean shouldForceReleaseFrame(long earlyUs, long elapsedSinceLastReleaseUs)

Whether a frame should be forced for release.

Parameters:

earlyUs: The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.
elapsedSinceLastReleaseUs: The elapsed time since the last frame was released, in microseconds.

Returns:

Whether the video frame should be force released.

public boolean shouldDropFrame(long earlyUs, long elapsedRealtimeUs, boolean isLastFrame)

Returns whether the frame should be dropped.

Parameters:

earlyUs: The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.
elapsedRealtimeUs: in microseconds, measured at the start of the current iteration of the rendering loop.
isLastFrame: Whether the buffer is the last buffer in the current stream.

public boolean shouldIgnoreFrame(long earlyUs, long positionUs, long elapsedRealtimeUs, boolean isLastFrame, boolean treatDroppedBuffersAsSkipped)

Returns whether this frame should be ignored.

Parameters:

earlyUs: The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.
positionUs: The playback position, in microseconds.
elapsedRealtimeUs: in microseconds, measured at the start of the current iteration of the rendering loop.
isLastFrame: Whether the buffer is the last buffer in the current stream.
treatDroppedBuffersAsSkipped: Whether dropped buffers should be treated as intentionally skipped.

Returns:

Whether this frame should be ignored.