VideoFrameReleaseControl.FrameTimingEvaluator


public interface VideoFrameReleaseControl.FrameTimingEvaluator

Known direct subclasses
MediaCodecVideoRenderer

Decodes and renders video using MediaCodec.


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

Summary

Public methods

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

Returns whether the frame should be dropped.

abstract boolean
shouldForceReleaseFrame(long earlyUs, long elapsedSinceLastReleaseUs)

Whether a frame should be forced for release.

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

Returns whether this frame should be ignored.

Public methods

shouldDropFrame

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

Returns whether the frame should be dropped.

Parameters
long earlyUs

The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.

long elapsedRealtimeUs

elapsedRealtime in microseconds, measured at the start of the current iteration of the rendering loop.

boolean isLastFrame

Whether the buffer is the last buffer in the current stream.

shouldForceReleaseFrame

abstract boolean shouldForceReleaseFrame(long earlyUs, long elapsedSinceLastReleaseUs)

Whether a frame should be forced for release.

Parameters
long earlyUs

The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.

long elapsedSinceLastReleaseUs

The elapsed time since the last frame was released, in microseconds.

Returns
boolean

Whether the video frame should be force released.

shouldIgnoreFrame

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

Returns whether this frame should be ignored.

Parameters
long earlyUs

The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.

long positionUs

The playback position, in microseconds.

long elapsedRealtimeUs

elapsedRealtime in microseconds, measured at the start of the current iteration of the rendering loop.

boolean isLastFrame

Whether the buffer is the last buffer in the current stream.

boolean treatDroppedBuffersAsSkipped

Whether dropped buffers should be treated as intentionally skipped.

Returns
boolean

Whether this frame should be ignored.