KiteFFmpegVideoFrame

A decoded video frame, still in native memory.

The pixels are not copied here and they never reach Kotlin memory unless a renderer asks for them. That is the whole point: a 1080p frame is 3.11 MB and a 4K 10-bit frame is 24.9 MB, so copying at 60 frames a second would cost between 187 MB/s and 1.5 GB/s for nothing.

Properties

Link copied to clipboard
open override val closedCaptions: ByteArray?

The A/53 caption bytes FFmpeg's decoder attached to this picture (#236). Unreadable side data costs this picture's captions and nothing more.

Link copied to clipboard
open override val colorSpace: ColorSpaceInfo
Link copied to clipboard
open override val crop: PictureCrop?

The container's crop, already checked to fit this frame.

Link copied to clipboard
open override val duration: Pts?
Link copied to clipboard
open override val generation: Generation
Link copied to clipboard
open override val hardwareSurface: HwSurfaceKind?
Link copied to clipboard

False when the decoder gave this frame no timestamp, so pts was counted forward from the previous frame rather than read from the media.

Link copied to clipboard
open override val hdr: HdrStaticMetadata?

The decoder's own reading first, because a raw HEVC or MPEG-TS stream says it only in the bitstream.

Link copied to clipboard
open override val mirrored: Boolean

Whether the stream's display matrix also mirrors the picture. No default, for the same reason.

Link copied to clipboard
open override val pixelFormat: PlayerPixelFormat
Link copied to clipboard
open override val planeCount: Int
Link copied to clipboard
open override val planeFormat: PlayerPixelFormat

The downloaded copy's format for a VideoToolbox frame, which downloads it on first read.

Link copied to clipboard
open override val pts: Pts

Already on the engine's relative timeline, and synthesised when the decoder gave none.

Link copied to clipboard
open override val rotationDegrees: Int

The stream's own clockwise rotation, from the container's display matrix.

Link copied to clipboard
open override val sceneMaxNits: Float?

The peak of this frame's scene, from the Dolby Vision RPU the decoder read, in nits.

Link copied to clipboard
open override val size: VideoSize

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun copyPlane(index: Int, into: ByteArray, offset: Int)
Link copied to clipboard

The CVPixelBuffer of a VideoToolbox frame, or null when the frame is not that kind.

Link copied to clipboard
fun SoftwareReadableFrame.encode(format: SnapshotFormat = SnapshotFormat.Jpeg): ByteArray

Encodes a frame with readable planes as a standalone image: a CapturedFrame from KitePlayer.captureFrame, or any software frame a backend produced.

Link copied to clipboard
open override fun planeHeight(index: Int): Int
Link copied to clipboard
open override fun planeStride(index: Int): Int
Link copied to clipboard

The frame's planes for texture upload, or null when the frame lives in hardware memory (use corePixelBufferOrNull there instead; downloading to feed a GPU that could wrap the surface directly would be the exact copy this path exists to avoid).