VideoSinkProvider


@UnstableApi
interface VideoSinkProvider


A provider of VideoSinks.

Summary

Public functions

Unit

Clears the set output surface info.

VideoSink!

Returns a VideoSink to forward video frames for processing.

VideoFrameReleaseControl?

Returns the VideoFrameReleaseControl that will be used for releasing of video frames during rendering.

Unit
initialize(sourceFormat: Format!)

Initializes the provider for video frame processing.

Boolean

Returns whether this provider is initialized for frame processing.

Unit

Releases the sink provider.

Unit
setClock(clock: Clock!)

Sets the Clock that the provider should use internally.

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

Sets the output surface info.

Unit

Sets video effects on this provider to apply when the next stream is registered on the VideoSink.

Unit
setStreamOffsetUs(streamOffsetUs: Long)

Sets the offset, in microseconds, that is added to the video frames presentation timestamps from the player.

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

Sets video effects on this provider to apply immediately.

Unit
setVideoFrameMetadataListener(
    videoFrameMetadataListener: VideoFrameMetadataListener!
)

Sets a VideoFrameMetadataListener which is used in the returned VideoSink.

Unit
setVideoFrameReleaseControl(
    videoFrameReleaseControl: VideoFrameReleaseControl!
)

Sets the VideoFrameReleaseControl that will be used for releasing of video frames during rendering.

Public functions

clearOutputSurfaceInfo

fun clearOutputSurfaceInfo(): Unit

Clears the set output surface info.

Must be called after the sink provider is initialized.

getSink

fun getSink(): VideoSink!

Returns a VideoSink to forward video frames for processing.

getVideoFrameReleaseControl

fun getVideoFrameReleaseControl(): VideoFrameReleaseControl?

Returns the VideoFrameReleaseControl that will be used for releasing of video frames during rendering.

If this value is null, it must be set to a non-null value before rendering begins.

initialize

fun initialize(sourceFormat: Format!): Unit

Initializes the provider for video frame processing. Can be called up to one time and only after video effects are set.

Parameters
sourceFormat: Format!

The format of the compressed video.

Throws
androidx.media3.exoplayer.video.VideoSink.VideoSinkException

If enabling the provider failed.

isInitialized

fun isInitialized(): Boolean

Returns whether this provider is initialized for frame processing.

release

fun release(): Unit

Releases the sink provider.

setClock

fun setClock(clock: Clock!): Unit

Sets the Clock that the provider should use internally.

Must be called before the sink provider is initialized.

setOutputSurfaceInfo

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

Sets the output surface info.

Must be called after the sink provider is initialized.

setPendingVideoEffects

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

Sets video effects on this provider to apply when the next stream is registered on the VideoSink.

setStreamOffsetUs

fun setStreamOffsetUs(streamOffsetUs: Long): Unit

Sets the offset, in microseconds, that is added to the video frames presentation timestamps from the player.

Must be called after the sink provider is initialized.

setVideoEffects

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

Sets video effects on this provider to apply immediately.

setVideoFrameMetadataListener

fun setVideoFrameMetadataListener(
    videoFrameMetadataListener: VideoFrameMetadataListener!
): Unit

Sets a VideoFrameMetadataListener which is used in the returned VideoSink.

setVideoFrameReleaseControl

fun setVideoFrameReleaseControl(
    videoFrameReleaseControl: VideoFrameReleaseControl!
): Unit

Sets the VideoFrameReleaseControl that will be used for releasing of video frames during rendering.

Must be called before, not after, the sink provider is initialized.