# VideoFrameReleaseControl.FrameTimingEvaluator

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/video/VideoFrameReleaseControl.java+class:androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameTimingEvaluator)

*** ** * ** ***


```
public interface VideoFrameReleaseControl.FrameTimingEvaluator
```

<br />

Known direct subclasses [MediaCodecVideoRenderer](https://developer.android.com/reference/androidx/media3/exoplayer/video/MediaCodecVideoRenderer)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/video/MediaCodecVideoRenderer` | Decodes and renders video using `https://developer.android.com/reference/android/media/MediaCodec.html`. |

Known indirect subclasses [CapturingRenderersFactory.CapturingMediaCodecVideoRenderer](https://developer.android.com/reference/androidx/media3/test/utils/robolectric/CapturingRenderersFactory.CapturingMediaCodecVideoRenderer)

|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/robolectric/CapturingRenderersFactory.CapturingMediaCodecVideoRenderer` | A `https://developer.android.com/reference/androidx/media3/exoplayer/video/MediaCodecVideoRenderer` that will not skip or drop buffers due to slow processing. |

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldDropFrame(long,long,boolean)( long earlyUs, long elapsedRealtimeUs, boolean isLastFrame )` Returns whether the frame should be dropped. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldForceReleaseFrame(long,long)(long earlyUs, long elapsedSinceLastReleaseUs)` Whether a frame should be forced for release. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldIgnoreFrame(long,long,long,boolean,boolean)( 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` | `https://developer.android.com/reference/android/os/SystemClock.html#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` | `https://developer.android.com/reference/android/os/SystemClock.html#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. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlaybackException` | If an error occurs. |