Expand description
Frame: one raw picture, and Surface: its pixels and where they live.
Representations chosen so the common path stays zero-copy:
Surface::PixelBufferis an AppleCVPixelBuffer(IOSurface-backed NV12). Capture and the VideoToolbox decoder both produce it, and the VideoToolbox encoder consumes it directly, no copy and no color conversion.Surface::Textureis a Windows Direct3D11 NV12 texture, produced by Media Foundation capture/decode and Windows.Graphics.Capture, one GPU blit removed from their pools (which they recycle, so a frame has to be lifted out of them), and consumed by the hardware encoder MFT on the same device with no copy at all, so a camera or a decoder reaches an encoder without touching the CPU. Drawing one still goes throughinto_i420, since the render module imports aPixelBufferbut has no Direct3D11 path yet.Surface::DmaBufis a Linux DRM allocation, produced by PipeWire capture. The Vulkan renderer imports supported packed formats directly, while CPU consumers map linear allocations only.Surface::Vulkanis an external Linux Vulkan image with an explicit timeline semaphore. Encoders import and convert it on its device, with no CPU download fallback, then return its producer slot after GPU completion.Surface::HardwareBufferis an AndroidAHardwareBuffer, produced by the MediaCodec decoder rendering into anImageReader. A GPU consumer imports it as a GL or Vulkan image;into_i420reads the planes back instead.Surface::I420is CPU-resident planar I420, for the CPU encode path and platforms without a zero-copy capture.
A backend that consumes a GPU surface takes the frame as-is; a CPU encoder
asks for I420 via Surface::into_i420, which downloads GPU frames that
permit readback. External Vulkan surfaces intentionally refuse that fallback.
Modules§
- cuda
- Linux CUDA device memory: the NV12
FramebehindSurface::Cuda, which NVDEC or aConverterproduces and NVENC scales into its own input on the GPU. - vulkan
- External Vulkan images and their producer-owned reuse slots.
Structs§
- DmaBuf
- A Linux DMA-BUF surface with an on-demand exported descriptor.
- DmaBuf
Export - An exported Linux DMA-BUF descriptor and its producer lease.
- DmaBuf
Plane - One plane within a Linux DMA-BUF allocation.
- DrmFormat
- A DRM pixel format code carried by a Linux DMA-BUF.
- Frame
- One raw (uncompressed) video frame: the pixels plus when they are shown.
- I420
- A raw video frame in planar I420 (YUV 4:2:0), tightly packed (no padding), at the encoder resolution. Width and height are even (chroma is 2x2).
Enums§
- Surface
- Where a frame’s pixels currently live.