# VideoFrameReleaseControl

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)

*** ** * ** ***


```
@UnstableApi
class VideoFrameReleaseControl
```

<br />

*** ** * ** ***

Controls the releasing of video frames.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi @https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` The frame release action returned by `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#getFrameReleaseAction(long,long,long,long,boolean,boolean,long,long,androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameReleaseInfo)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#probeFrameReleaseAction(long,long,long,long,long,long,androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameReleaseInfo)`. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo` Per `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` metadata. |
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator` Decides whether a frame should be forced to be released, or dropped. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_DROP() = 2` Signals a frame should be dropped. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_IGNORE() = 4` Signals that a frame should be ignored. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_IMMEDIATELY() = 0` Signals a frame should be released immediately. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_SCHEDULED() = 1` Signals a frame should be scheduled for release. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_SKIP() = 3` Signals that a frame should be skipped. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_TRY_AGAIN_LATER() = 5` Signals that a frame should not be released and the caller should try again later. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#VideoFrameReleaseControl(android.content.Context,androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameTimingEvaluator,long,boolean)( applicationContext: https://developer.android.com/reference/android/content/Context.html!, frameTimingEvaluator: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator!, allowedJoiningTimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, skipBuffersWithIdenticalReleaseTime: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Creates an instance. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#allowReleaseFirstFrameBeforeStarted()()` Allows the frame control to indicate the first frame can be released before this instance is started. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#getFrameReleaseAction(long,long,long,long,boolean,boolean,long,long,androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameReleaseInfo)( presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, elapsedRealtimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, outputStreamStartPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, isDecodeOnlyFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isLastFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, frameDurationNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, frameIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, frameReleaseInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo! )` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` for a video frame which instructs the caller what to do with the frame. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#isJoining()()` Returns whether the release control is currently joining. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#isReady(boolean)(otherwiseReady: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Whether the release control is ready to start playback. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#join(boolean)(renderNextFrameImmediately: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Joins the release control to a new stream. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#onFrameReleasedIsFirstFrame()()` Called when a frame has been released. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#onStarted()()` Called when rendering starts. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#onStopped()()` Called when rendering stops. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#onStreamChanged(int)( @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.FirstFrameReleaseInstruction firstFrameReleaseInstruction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Called when the stream changes. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#probeFrameReleaseAction(long,long,long,long,long,long,androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameReleaseInfo)( presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, elapsedRealtimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, outputStreamStartPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, frameDurationNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, frameIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, frameReleaseInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo! )` Probes the expected `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` and populates `frameReleaseInfo` for a pending video frame without mutating release state or invoking `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldIgnoreFrame(long,long,long,boolean,boolean)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#reset()()` Resets the release control. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setChangeFrameRateStrategy(int)( @https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy changeFrameRateStrategy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Changes the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy` used when calling `https://developer.android.com/reference/android/view/Surface.html#setFrameRate(float, int)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setClock(androidx.media3.common.util.Clock)(clock: https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock!)` Sets the clock that will be used. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/ExperimentalApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setEarlySchedulingThresholdUs(long)(earlySchedulingThresholdUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the threshold for how early a frame may be scheduled for release on the surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setOutputSurface(android.view.Surface)(outputSurface: https://developer.android.com/reference/android/view/Surface.html?)` Called when the display surface changed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setPlaybackSpeed(float)(speed: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the playback speed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setRequiresOutputSurface(boolean)(requiresOutputSurface: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether an output surface is required for the release control to release frames. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setSurfaceMediaFrameRate(float)(surfaceMediaFrameRate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the surface media frame rate. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/VisibleForTesting https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#setVsyncData(long,long)(vsyncSampleTimeNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, vsyncDurationNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the vsync timing data. |

## Constants

### FRAME_RELEASE_DROP

```
const val FRAME_RELEASE_DROP = 2: Int
```

Signals a frame should be dropped.

### FRAME_RELEASE_IGNORE

```
const val FRAME_RELEASE_IGNORE = 4: Int
```

Signals that a frame should be ignored.

### FRAME_RELEASE_IMMEDIATELY

```
const val FRAME_RELEASE_IMMEDIATELY = 0: Int
```

Signals a frame should be released immediately.

### FRAME_RELEASE_SCHEDULED

```
const val FRAME_RELEASE_SCHEDULED = 1: Int
```

Signals a frame should be scheduled for release. The release timestamp will be returned by `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo#getReleaseTimeNs()`.

### FRAME_RELEASE_SKIP

```
const val FRAME_RELEASE_SKIP = 3: Int
```

Signals that a frame should be skipped.

### FRAME_RELEASE_TRY_AGAIN_LATER

```
const val FRAME_RELEASE_TRY_AGAIN_LATER = 5: Int
```

Signals that a frame should not be released and the caller should try again later.

## Public constructors

### VideoFrameReleaseControl

```
VideoFrameReleaseControl(
    applicationContext: Context!,
    frameTimingEvaluator: VideoFrameReleaseControl.FrameTimingEvaluator!,
    allowedJoiningTimeMs: Long,
    skipBuffersWithIdenticalReleaseTime: Boolean
)
```

Creates an instance.

| Parameters |
|---|---|
| `applicationContext: https://developer.android.com/reference/android/content/Context.html!` | The application context. |
| `frameTimingEvaluator: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator` that will assist in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#getFrameReleaseAction(long,long,long,long,boolean,boolean,long,long,androidx.media3.exoplayer.video.VideoFrameReleaseControl.FrameReleaseInfo)`. |
| `allowedJoiningTimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The maximum duration in milliseconds for which the caller can attempt to seamlessly join an ongoing playback. |
| `skipBuffersWithIdenticalReleaseTime: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to skip buffers that have an identical release time as the previous released buffer. |

## Public functions

### allowReleaseFirstFrameBeforeStarted

```
fun allowReleaseFirstFrameBeforeStarted(): Unit
```

Allows the frame control to indicate the first frame can be released before this instance is started.

### getFrameReleaseAction

```
@VideoFrameReleaseControl.FrameReleaseAction
fun getFrameReleaseAction(
    presentationTimeUs: Long,
    positionUs: Long,
    elapsedRealtimeUs: Long,
    outputStreamStartPositionUs: Long,
    isDecodeOnlyFrame: Boolean,
    isLastFrame: Boolean,
    frameDurationNs: Long,
    frameIndex: Long,
    frameReleaseInfo: VideoFrameReleaseControl.FrameReleaseInfo!
): Int
```

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` for a video frame which instructs the caller what to do with the frame.

| Parameters |
|---|---|
| `presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation time of the video frame, in microseconds. |
| `positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current playback position, in microseconds. |
| `elapsedRealtimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` in microseconds, taken approximately at the time the playback position was `positionUs`. |
| `outputStreamStartPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The stream's start position, in microseconds. |
| `isDecodeOnlyFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the frame is decode-only because its presentation time is before the intended start time. |
| `isLastFrame: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the frame is known to contain the last frame of the current stream. |
| `frameDurationNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The estimated fixed frame duration in nanoseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `frameIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | A monotonically increasing index for the frame, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()` if unknown. |
| `frameReleaseInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo` that will be filled with detailed data only if the method returns `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_IMMEDIATELY()` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#FRAME_RELEASE_SCHEDULED()`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` that should instruct the caller whether to release the frame or not. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlaybackException` |   |

### isJoining

```
fun isJoining(): Boolean
```

Returns whether the release control is currently joining.

### isReady

```
fun isReady(otherwiseReady: Boolean): Boolean
```

Whether the release control is ready to start playback.

| Parameters |
|---|---|
| `otherwiseReady: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the caller is ready except for the release control. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the release control is ready. |

### join

```
fun join(renderNextFrameImmediately: Boolean): Unit
```

Joins the release control to a new stream.

The release control will pretend to be `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl#isReady(boolean)` for a short time even if the first frame hasn't been rendered yet to avoid interrupting an ongoing playback.

| Parameters |
|---|---|
| `renderNextFrameImmediately: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the next frame should be released as soon as possible or only at its preferred scheduled release time. |

### onFrameReleasedIsFirstFrame

```
fun onFrameReleasedIsFirstFrame(): Boolean
```

Called when a frame has been released.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this is the first released frame. |

### onStarted

```
fun onStarted(): Unit
```

Called when rendering starts.

### onStopped

```
fun onStopped(): Unit
```

Called when rendering stops.

### onStreamChanged

```
fun onStreamChanged(
    @VideoSink.FirstFrameReleaseInstruction firstFrameReleaseInstruction: Int
): Unit
```

Called when the stream changes.

Must also be called for the first stream.

### probeFrameReleaseAction

```
@VideoFrameReleaseControl.FrameReleaseAction
fun probeFrameReleaseAction(
    presentationTimeUs: Long,
    positionUs: Long,
    elapsedRealtimeUs: Long,
    outputStreamStartPositionUs: Long,
    frameDurationNs: Long,
    frameIndex: Long,
    frameReleaseInfo: VideoFrameReleaseControl.FrameReleaseInfo!
): Int
```

Probes the expected `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` and populates `frameReleaseInfo` for a pending video frame without mutating release state or invoking `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameTimingEvaluator#shouldIgnoreFrame(long,long,long,boolean,boolean)`.

| Parameters |
|---|---|
| `presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation time of the video frame, in microseconds. |
| `positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current playback position, in microseconds. |
| `elapsedRealtimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` in microseconds, taken approximately at the time the playback position was `positionUs`. |
| `outputStreamStartPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The stream's start position, in microseconds. |
| `frameDurationNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The estimated fixed frame duration in nanoseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `frameIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | A monotonically increasing index for the frame, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()` if unknown. |
| `frameReleaseInfo: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseInfo` that will be filled with timing details. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The expected `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameReleaseControl.FrameReleaseAction` for the frame. |

### reset

```
fun reset(): Unit
```

Resets the release control.

### setChangeFrameRateStrategy

```
fun setChangeFrameRateStrategy(
    @C.VideoChangeFrameRateStrategy changeFrameRateStrategy: Int
): Unit
```

Changes the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoChangeFrameRateStrategy` used when calling `https://developer.android.com/reference/android/view/Surface.html#setFrameRate(float, int)`.

The default value is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#VIDEO_CHANGE_FRAME_RATE_STRATEGY_ONLY_IF_SEAMLESS()`.

### setClock

```
fun setClock(clock: Clock!): Unit
```

Sets the clock that will be used.

### setEarlySchedulingThresholdUs

```
@ExperimentalApi
fun setEarlySchedulingThresholdUs(earlySchedulingThresholdUs: Long): Unit
```

Sets the threshold for how early a frame may be scheduled for release on the surface.

Frames that are earlier than this threshold will be held and 'release' will be tried again later.

This value is in microseconds. The default value is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/MediaCodecVideoRenderer#DEFAULT_EARLY_SCHEDULING_THRESHOLD_US()`.

This method is experimental and will be renamed or removed in a future release.

| Parameters |
|---|---|
| `earlySchedulingThresholdUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The maximum early time threshold in microseconds. |

### setOutputSurface

```
fun setOutputSurface(outputSurface: Surface?): Unit
```

Called when the display surface changed.

### setPlaybackSpeed

```
fun setPlaybackSpeed(speed: @FloatRange(from = 0, fromInclusive = false) Float): Unit
```

Sets the playback speed.

### setRequiresOutputSurface

```
fun setRequiresOutputSurface(requiresOutputSurface: Boolean): Unit
```

Sets whether an output surface is required for the release control to release frames.

The default value is `true`.

### setSurfaceMediaFrameRate

```
fun setSurfaceMediaFrameRate(surfaceMediaFrameRate: Float): Unit
```

Sets the surface media frame rate.

### setVsyncData

```
@VisibleForTesting
fun setVsyncData(vsyncSampleTimeNs: Long, vsyncDurationNs: Long): Unit
```

Sets the vsync timing data.

| Parameters |
|---|---|
| `vsyncSampleTimeNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The vsync sample time in nanoseconds. |
| `vsyncDurationNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The vsync duration in nanoseconds. |