# VideoSink

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/VideoSink.java+class:androidx.media3.exoplayer.video.VideoSink)

*** ** * ** ***

<br />

```
@UnstableApi
interface VideoSink
```

<br />

*** ** * ** ***

A sink that consumes decoded video frames and images.

## 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/VideoSink.FirstFrameReleaseInstruction` The instruction provided when the stream changes for releasing the first frame. |
| `@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/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.InputType` Specifies how the input frames are made available to the video sink. |
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.Listener` Listener for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink` events. |
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoFrameHandler` Handler for a video frame. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoSinkException : https://developer.android.com/reference/java/lang/Exception.html` Thrown by `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink` implementations. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#INPUT_TYPE_BITMAP() = 2` Input frames come from a `https://developer.android.com/reference/android/graphics/Bitmap.html`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#INPUT_TYPE_SURFACE() = 1` Input frames come from a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#getInputSurface()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#RELEASE_FIRST_FRAME_IMMEDIATELY() = 0` Instructs to release the first frame as soon as possible. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#RELEASE_FIRST_FRAME_WHEN_PREVIOUS_STREAM_PROCESSED() = 2` Instructs to release the first frame when the playback position reaches the stream start position. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#RELEASE_FIRST_FRAME_WHEN_STARTED() = 1` Instructs to release the first frame when rendering starts. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#allowReleaseFirstFrameBeforeStarted()()` Allows the sink to release the first frame even if rendering is not `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#startRendering()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#clearOutputSurfaceInfo()()` Clears the set output surface info. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#flush(boolean)(resetPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Flushes the video sink. |
| `https://developer.android.com/reference/android/view/Surface.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#getInputSurface()()` Returns the input `https://developer.android.com/reference/android/view/Surface.html` where the video sink consumes input frames from. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#handleInputBitmap(android.graphics.Bitmap,androidx.media3.common.util.TimestampIterator)( inputBitmap: https://developer.android.com/reference/android/graphics/Bitmap.html!, bufferTimestampIterator: https://developer.android.com/reference/kotlin/androidx/media3/common/util/TimestampIterator! )` Handles an input `https://developer.android.com/reference/android/graphics/Bitmap.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#handleInputFrame(long,androidx.media3.exoplayer.video.VideoSink.VideoFrameHandler)( bufferPresentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, videoFrameHandler: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoFrameHandler! )` Handles a video input frame. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#initialize(androidx.media3.common.Format)(sourceFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Initializes the video sink. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#isEnded()()` Returns whether all the data has been rendered to the output surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#isInitialized()()` Returns whether the video sink is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#initialize(androidx.media3.common.Format)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#isReady(boolean)(otherwiseReady: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns whether the video sink is able to immediately render media to its output surface from the current position. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#join(boolean)(renderNextFrameImmediately: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Joins the video sink to a new stream. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#onInputStreamChanged(int,androidx.media3.common.Format,long,int,java.util.List<androidx.media3.common.Effect>)( @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.InputType inputType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, startPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.FirstFrameReleaseInstruction firstFrameReleaseInstruction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, videoEffects: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Effect!>! )` Informs the video sink that a new input stream will be queued with the given effects. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#redraw()()` Redraws the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#setVideoEffects(java.util.List<androidx.media3.common.Effect>)` immediately. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#release()()` Releases the sink. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#render(long,long)(positionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, elapsedRealtimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Incrementally renders processed video frames to the output surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#setBufferTimestampAdjustmentUs(long)(bufferTimestampAdjustmentUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the buffer timestamp adjustment. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#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/VideoSink#setListener(androidx.media3.exoplayer.video.VideoSink.Listener,java.util.concurrent.Executor)(listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.Listener!, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!)` Sets a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.Listener` on this sink. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#setOutputSurfaceInfo(android.view.Surface,androidx.media3.common.util.Size)(outputSurface: https://developer.android.com/reference/android/view/Surface.html!, outputResolution: https://developer.android.com/reference/kotlin/androidx/media3/common/util/Size!)` Sets the output surface info. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#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/VideoSink#setVideoEffects(java.util.List<androidx.media3.common.Effect>)(videoEffects: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Effect!>!)` Sets `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect` to apply immediately. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#setVideoFrameMetadataListener(androidx.media3.exoplayer.video.VideoFrameMetadataListener)( videoFrameMetadataListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameMetadataListener! )` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameMetadataListener`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#signalEndOfCurrentInputStream()()` Signals the end of the current input stream. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#signalEndOfInput()()` Signals the end of the last input stream. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#startRendering()()` Starts rendering to the output surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#stopRendering()()` Stops rendering to the output surface. |

## Constants

### INPUT_TYPE_BITMAP

```
const val INPUT_TYPE_BITMAP = 2: Int
```

Input frames come from a `https://developer.android.com/reference/android/graphics/Bitmap.html`.

### INPUT_TYPE_SURFACE

```
const val INPUT_TYPE_SURFACE = 1: Int
```

Input frames come from a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#getInputSurface()`.

### RELEASE_FIRST_FRAME_IMMEDIATELY

```
const val RELEASE_FIRST_FRAME_IMMEDIATELY = 0: Int
```

Instructs to release the first frame as soon as possible.

### RELEASE_FIRST_FRAME_WHEN_PREVIOUS_STREAM_PROCESSED

```
const val RELEASE_FIRST_FRAME_WHEN_PREVIOUS_STREAM_PROCESSED = 2: Int
```

Instructs to release the first frame when the playback position reaches the stream start position.

### RELEASE_FIRST_FRAME_WHEN_STARTED

```
const val RELEASE_FIRST_FRAME_WHEN_STARTED = 1: Int
```

Instructs to release the first frame when rendering starts.

## Public functions

### allowReleaseFirstFrameBeforeStarted

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

Allows the sink to release the first frame even if rendering is not `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#startRendering()`.

This is used to update the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.FirstFrameReleaseInstruction` of the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#onInputStreamChanged(int,androidx.media3.common.Format,long,int,java.util.List<androidx.media3.common.Effect>)` that is currently being processed.

### clearOutputSurfaceInfo

```
fun clearOutputSurfaceInfo(): Unit
```

Clears the set output surface info.

### flush

```
fun flush(resetPosition: Boolean): Unit
```

Flushes the video sink.

After calling this method, any frames stored inside the video sink are discarded.

| Parameters |
|---|---|
| `resetPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to reset the current position. |

### getInputSurface

```
fun getInputSurface(): Surface!
```

Returns the input `https://developer.android.com/reference/android/view/Surface.html` where the video sink consumes input frames from.

Must be called after the sink is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#initialize(androidx.media3.common.Format)`.

### handleInputBitmap

```
fun handleInputBitmap(
    inputBitmap: Bitmap!,
    bufferTimestampIterator: TimestampIterator!
): Boolean
```

Handles an input `https://developer.android.com/reference/android/graphics/Bitmap.html`.

Must be called after the corresponding stream is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#onInputStreamChanged(int,androidx.media3.common.Format,long,int,java.util.List<androidx.media3.common.Effect>)`.

| Parameters |
|---|---|
| `inputBitmap: https://developer.android.com/reference/android/graphics/Bitmap.html!` | The `https://developer.android.com/reference/android/graphics/Bitmap.html` to queue to the video sink. |
| `bufferTimestampIterator: https://developer.android.com/reference/kotlin/androidx/media3/common/util/TimestampIterator!` | The buffer presentation times within the current stream that the bitmap should be shown at. The timestamps should be monotonically increasing. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the bitmap was queued successfully. If `false`, the caller can try again later. |

### handleInputFrame

```
fun handleInputFrame(
    bufferPresentationTimeUs: Long,
    videoFrameHandler: VideoSink.VideoFrameHandler!
): Boolean
```

Handles a video input frame.

Must be called after the corresponding stream is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#onInputStreamChanged(int,androidx.media3.common.Format,long,int,java.util.List<androidx.media3.common.Effect>)`.

| Parameters |
|---|---|
| `bufferPresentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The buffer presentation time, in microseconds. |
| `videoFrameHandler: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoFrameHandler!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoFrameHandler` used to handle the input frame. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the frame was handled successfully. If `false`, the caller can try again later. |

### initialize

```
fun initialize(sourceFormat: Format!): Boolean
```

Initializes the video sink.

| Parameters |
|---|---|
| `sourceFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The format of the first input video or image. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether initialization succeeded. If `false`, the caller should try again later. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoSinkException` | If initializing the sink failed. |

### isEnded

```
fun isEnded(): Boolean
```

Returns whether all the data has been rendered to the output surface.

This method returns `true` if the end of the last input stream has been `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#signalEndOfCurrentInputStream()` and all the input frames have been rendered. Note that a new input stream can be `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#onInputStreamChanged(int,androidx.media3.common.Format,long,int,java.util.List<androidx.media3.common.Effect>)` even when this method returns true (in which case the sink will not be ended anymore).

### isInitialized

```
fun isInitialized(): Boolean
```

Returns whether the video sink is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#initialize(androidx.media3.common.Format)`.

### isReady

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

Returns whether the video sink is able to immediately render media to its output surface from the current position.

The caller should be ready if and only if the video sink is ready.

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

### join

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

Joins the video sink to a new stream.

The sink will mask `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#isReady(boolean)` as `true` for a short time to avoid interrupting an ongoing playback, even if the first frame hasn't yet been rendered to the output surface.

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

### onInputStreamChanged

```
fun onInputStreamChanged(
    @VideoSink.InputType inputType: Int,
    format: Format!,
    startPositionUs: Long,
    @VideoSink.FirstFrameReleaseInstruction firstFrameReleaseInstruction: Int,
    videoEffects: (Mutable)List<Effect!>!
): Unit
```

Informs the video sink that a new input stream will be queued with the given effects.

Must be called after the sink is `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#initialize(androidx.media3.common.Format)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.InputType inputType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.InputType` of the stream. |
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` of the stream. |
| `startPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The start position of the buffer presentation timestamps of the stream, in microseconds. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.FirstFrameReleaseInstruction firstFrameReleaseInstruction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.FirstFrameReleaseInstruction` indicating when to release the stream's first frame. |
| `videoEffects: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/Effect!>!` | The `https://developer.android.com/reference/java/util/List.html` to apply to the new stream. |

### redraw

```
fun redraw(): Unit
```

Redraws the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink#setVideoEffects(java.util.List<androidx.media3.common.Effect>)` immediately.

### release

```
fun release(): Unit
```

Releases the sink.

### render

```
fun render(positionUs: Long, elapsedRealtimeUs: Long): Unit
```

Incrementally renders processed video frames to the output surface.

| Parameters |
|---|---|
| `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`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.VideoSinkException` | If an error occurs during rendering. |

### setBufferTimestampAdjustmentUs

```
fun setBufferTimestampAdjustmentUs(bufferTimestampAdjustmentUs: Long): Unit
```

Sets the buffer timestamp adjustment.

| Parameters |
|---|---|
| `bufferTimestampAdjustmentUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The timestamp adjustment to add to the buffer presentation timestamps to convert them to frame presentation timestamps, in microseconds. |

### 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()`.

### setListener

```
fun setListener(listener: VideoSink.Listener!, executor: Executor!): Unit
```

Sets a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.Listener` on this sink. Callbacks are triggered on the supplied `https://developer.android.com/reference/java/util/concurrent/Executor.html`.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.Listener!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoSink.Listener`. |
| `executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!` | The `https://developer.android.com/reference/java/util/concurrent/Executor.html` to dispatch the callbacks. |

### setOutputSurfaceInfo

```
fun setOutputSurfaceInfo(outputSurface: Surface!, outputResolution: Size!): Unit
```

Sets the output surface info.

### setPlaybackSpeed

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

Sets the playback speed.

### setVideoEffects

```
fun setVideoEffects(videoEffects: (Mutable)List<Effect!>!): Unit
```

Sets `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect` to apply immediately.

### setVideoFrameMetadataListener

```
fun setVideoFrameMetadataListener(
    videoFrameMetadataListener: VideoFrameMetadataListener!
): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoFrameMetadataListener`.

### signalEndOfCurrentInputStream

```
fun signalEndOfCurrentInputStream(): Unit
```

Signals the end of the current input stream.

### signalEndOfInput

```
fun signalEndOfInput(): Unit
```

Signals the end of the last input stream.

### startRendering

```
fun startRendering(): Unit
```

Starts rendering to the output surface.

### stopRendering

```
fun stopRendering(): Unit
```

Stops rendering to the output surface.