VideoSinkProvider


@UnstableApi
public interface VideoSinkProvider


A provider of VideoSinks.

Summary

Public methods

abstract void

Clears the set output surface info.

abstract VideoSink

Returns a VideoSink to forward video frames for processing.

abstract @Nullable VideoFrameReleaseControl

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

abstract void
initialize(Format sourceFormat)

Initializes the provider for video frame processing.

abstract boolean

Returns whether this provider is initialized for frame processing.

abstract void

Releases the sink provider.

abstract void
setClock(Clock clock)

Sets the Clock that the provider should use internally.

abstract void
setOutputSurfaceInfo(Surface outputSurface, Size outputResolution)

Sets the output surface info.

abstract void

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

abstract void
setStreamOffsetUs(long streamOffsetUs)

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

abstract void
setVideoEffects(List<Effect> videoEffects)

Sets video effects on this provider to apply immediately.

abstract void
setVideoFrameMetadataListener(
    VideoFrameMetadataListener videoFrameMetadataListener
)

Sets a VideoFrameMetadataListener which is used in the returned VideoSink.

abstract void
setVideoFrameReleaseControl(
    VideoFrameReleaseControl videoFrameReleaseControl
)

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

Public methods

clearOutputSurfaceInfo

abstract void clearOutputSurfaceInfo()

Clears the set output surface info.

Must be called after the sink provider is initialized.

getSink

abstract VideoSink getSink()

Returns a VideoSink to forward video frames for processing.

getVideoFrameReleaseControl

abstract @Nullable VideoFrameReleaseControl getVideoFrameReleaseControl()

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

abstract void initialize(Format sourceFormat)

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

Parameters
Format sourceFormat

The format of the compressed video.

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

If enabling the provider failed.

isInitialized

abstract boolean isInitialized()

Returns whether this provider is initialized for frame processing.

release

abstract void release()

Releases the sink provider.

setClock

abstract void setClock(Clock clock)

Sets the Clock that the provider should use internally.

Must be called before the sink provider is initialized.

setOutputSurfaceInfo

abstract void setOutputSurfaceInfo(Surface outputSurface, Size outputResolution)

Sets the output surface info.

Must be called after the sink provider is initialized.

setPendingVideoEffects

abstract void setPendingVideoEffects(List<Effect> videoEffects)

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

setStreamOffsetUs

abstract void setStreamOffsetUs(long streamOffsetUs)

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

abstract void setVideoEffects(List<Effect> videoEffects)

Sets video effects on this provider to apply immediately.

setVideoFrameMetadataListener

abstract void setVideoFrameMetadataListener(
    VideoFrameMetadataListener videoFrameMetadataListener
)

Sets a VideoFrameMetadataListener which is used in the returned VideoSink.

setVideoFrameReleaseControl

abstract void setVideoFrameReleaseControl(
    VideoFrameReleaseControl videoFrameReleaseControl
)

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.