VideoFrameReleaseControl.FrameTimingEvaluator


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 functions

Boolean
shouldDropFrame(
    earlyUs: Long,
    elapsedRealtimeUs: Long,
    isLastFrame: Boolean
)

Returns whether the frame should be dropped.

Boolean
shouldForceReleaseFrame(earlyUs: Long, elapsedSinceLastReleaseUs: Long)

Whether a frame should be forced for release.

Boolean
shouldIgnoreFrame(
    earlyUs: Long,
    positionUs: Long,
    elapsedRealtimeUs: Long,
    isLastFrame: Boolean,
    treatDroppedBuffersAsSkipped: Boolean
)

Returns whether this frame should be ignored.

Public functions

shouldDropFrame

fun shouldDropFrame(
    earlyUs: Long,
    elapsedRealtimeUs: Long,
    isLastFrame: Boolean
): Boolean

Returns whether the frame should be dropped.

Parameters
earlyUs: Long

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

elapsedRealtimeUs: Long

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

isLastFrame: Boolean

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

shouldForceReleaseFrame

fun shouldForceReleaseFrame(earlyUs: Long, elapsedSinceLastReleaseUs: Long): Boolean

Whether a frame should be forced for release.

Parameters
earlyUs: Long

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

elapsedSinceLastReleaseUs: Long

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

Returns
Boolean

Whether the video frame should be force released.

shouldIgnoreFrame

fun shouldIgnoreFrame(
    earlyUs: Long,
    positionUs: Long,
    elapsedRealtimeUs: Long,
    isLastFrame: Boolean,
    treatDroppedBuffersAsSkipped: Boolean
): Boolean

Returns whether this frame should be ignored.

Parameters
earlyUs: Long

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

positionUs: Long

The playback position, in microseconds.

elapsedRealtimeUs: Long

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

isLastFrame: Boolean

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

treatDroppedBuffersAsSkipped: Boolean

Whether dropped buffers should be treated as intentionally skipped.

Returns
Boolean

Whether this frame should be ignored.