DecodedPixelLayout enum

Planar layout + bit depth of a CPU-resident decoded frame's tightly-packed bytes (from DecodedFrame.readBytes). The presenter routes to the matching YUV→RGBA converter; combined with DecodedFrame.isFullRange it fully determines the colour conversion. GPU/browser frames ignore this (they route by DecodedFrame.outputKind / DecodedFrame.webVideoFrame).

A software decoder MUST report the layout it actually produced — emitting 4:2:2 / 4:4:4 / 10-bit bytes while claiming i420 renders wrong colours.

Stride/pitch contract

CPU bytes (DecodedFrame.readBytes) are TIGHTLY PACKED: row stride == the layout's row byte-width (luma w / 2*w for 10-bit; chroma per the layout; nv12/p010 UV rows 2*ceil(w/2) samples), no per-row padding, planes back-to-back Y|U|V (or Y|UV). Decoders copy out of the codec's padded buffers into this shape (see the ffmpeg extractor); converters and the GPU upload path rely on it.

GPU handles (DecodedFrame.gpuHandle) are the OPPOSITE: an NV12/P010 texture's rows are DRIVER-PITCH aligned (D3D11 RowPitch, Vulkan rowPitch), which is ≥ and usually > the visible row width. An importer must take the pitch from the map/import API — importing or mapping with an assumed width-byte pitch shears the image. When a HW frame is mapped to CPU for the fallback path, the mapper must REPACK to the tight layout above (the MF decoder's NV12→I420 map does exactly this) before tagging the bytes with a DecodedPixelLayout.

Inheritance
Available extensions

Values

i420 → const DecodedPixelLayout

8-bit 4:2:0 planar (Y | U | V), chroma ceil(w/2)×ceil(h/2).

i422 → const DecodedPixelLayout

8-bit 4:2:2 planar, chroma ceil(w/2)×h.

i444 → const DecodedPixelLayout

8-bit 4:4:4 planar, chroma w×h.

i420p10 → const DecodedPixelLayout

10-bit 4:2:0 planar, 16-bit little-endian samples.

i422p10 → const DecodedPixelLayout

10-bit 4:2:2 planar.

i444p10 → const DecodedPixelLayout

10-bit 4:4:4 planar.

nv12 → const DecodedPixelLayout

8-bit 4:2:0, Y plane + interleaved UV plane.

p010 → const DecodedPixelLayout

10-bit 4:2:0, Y plane + interleaved UV plane (10-bit NV12): 16-bit little-endian samples with the 10 significant bits in the HIGH bits (15..6) — unlike i420p10, which uses the low bits. This is the D3D11/NVDEC/VideoToolbox hardware 10-bit surface layout.

rgba → const DecodedPixelLayout

Packed 8-bit RGBA8888 (w*h*4 bytes, alpha last) — already displayable, NO YUV->RGB conversion applies (DecodedFrame.isFullRange / DecodedFrame.colorMatrix are meaningless for it). Produced by decoders whose output is natively RGB: passthrough/debug codecs and VideoCodec.custom backends that decode straight to RGBA.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<DecodedPixelLayout>
A constant List of the values in this enum, in order of their declaration.