UIKitVideoRenderer

Converts software frames away from the caller and presents the newest finished image in its layer.

The caller owns the layer. In particular, closing this renderer gives up the renderer's image references but does not clear or replace the layer's last contents.

Constructors

Link copied to clipboard
constructor(layer: CALayer, convert: (VideoFrame) -> ByteArray, toneMapped: (VideoFrame) -> Boolean = { false })

Properties

Link copied to clipboard
open override val events: Flow<RendererEvent>

This renderer used to publish nothing at all, which was true when it had nothing to say. It converts colour, so it can now say the one thing only a converter knows: that HDR was rolled off to be shown. Everything else here is still silent by construction.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val showsHdr: Boolean
Link copied to clipboard

Functions

Link copied to clipboard
open fun accepts(shape: FrameShape): Boolean
Link copied to clipboard
open override fun clearPicture()

Lets go of a frame waiting to convert, counted superseded, and has the worker forget the retained picture and deliver the background with the cues over it. The layer's contents become a transparent image, so whatever the caller put behind the picture shows.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun present(frame: VideoFrame, targetNanos: Long): Boolean
Link copied to clipboard
open override fun setAdjustments(adjustments: VideoAdjustments)

A paused picture shows the change too: the retained pixels re-draw.

Link copied to clipboard
open fun setHdrPolicy(policy: HdrPolicy)
Link copied to clipboard
open suspend override fun setOverlay(overlay: SubtitleOverlay?)

Stored wholesale and drawn above every later frame. A paused picture shows the change on the next frame, the same honest note as the Metal renderer; cue edges republish during playback at most one frame away.

Link copied to clipboard
open fun setRenderQuality(quality: RenderQuality)
Link copied to clipboard
open override fun setScaleMode(mode: VideoScale)
Link copied to clipboard
open override fun setTransform(transform: VideoTransform)

The framing half. Same delivery law as setAdjustments.

Link copied to clipboard
open override fun setViewport(width: Int, height: Int, scale: Float)
Link copied to clipboard
Link copied to clipboard
open override fun supports(format: PlayerPixelFormat): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun vsyncIntervalNanos(): Long?