# VideoFrameReleaseControl.FrameTimingEvaluator

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator "View this page in Java")

<br />

```
interface VideoFrameReleaseControl.FrameTimingEvaluator
```

<br />

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

|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| [MediaCodecVideoRenderer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/MediaCodecVideoRenderer) | Decodes and renders video using[MediaCodec](https://developer.android.com/reference/android/media/MediaCodec.html). |

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

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CapturingRenderersFactory.CapturingMediaCodecVideoRenderer](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/CapturingRenderersFactory.CapturingMediaCodecVideoRenderer) | A[MediaCodecVideoRenderer](https://developer.android.com/reference/kotlin/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 functions                                 |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [shouldDropFrame](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldDropFrame(long,long,boolean))`(` ` earlyUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` elapsedRealtimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` isLastFrame: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Returns whether the frame should be dropped.                                                                                                                                                                                                                                           |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [shouldForceReleaseFrame](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldForceReleaseFrame(long,long))`(earlyUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, elapsedSinceLastReleaseUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Whether a frame should be forced for release.                                                                                                                                                                                                                                                                                                                                         |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [shouldIgnoreFrame](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldIgnoreFrame(long,long,long,boolean,boolean))`(` ` earlyUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` positionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` elapsedRealtimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` isLastFrame: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` treatDroppedBuffersAsSkipped: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)           | The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.                                                                             |
| `elapsedRealtimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [elapsedRealtime](https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime())in microseconds, measured at the start of the current iteration of the rendering loop. |
| `isLastFrame: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                   | The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late. |
| `elapsedSinceLastReleaseUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The elapsed time since the last frame was released, in microseconds.                                               |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|---------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                            | The time until the buffer should be presented in microseconds. A negative value indicates that the buffer is late.                                                                             |
| `positionUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                         | The playback position, in microseconds.                                                                                                                                                        |
| `elapsedRealtimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                  | [elapsedRealtime](https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime())in microseconds, measured at the start of the current iteration of the rendering loop. |
| `isLastFrame: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                  | Whether the buffer is the last buffer in the current stream.                                                                                                                                   |
| `treatDroppedBuffersAsSkipped: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether dropped buffers should be treated as intentionally skipped.                                                                                                                            |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|---------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether this frame should be ignored. |

|                                                                     Throws                                                                      |
|-------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|
| [androidx.media3.exoplayer.ExoPlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlaybackException) | If an error occurs. |