Expand description
Normalization of decoded frames into the virtual device’s fixed format.
The device is a fixed-function camera: one raw pixel format at one size. Whatever the client camera delivers (any size, full- or limited-range luma) is fitted into that: the frame is scaled to fit with black bars when its size differs, full-range (JPEG) samples are compressed into the limited range every V4L2 consumer assumes, and the planes are emitted as I420, NV12 or YUYV. The common path — a frame already at the device size, limited range, I420 device — is a plain plane copy straight into the ring slot.
Structs§
- Device
Format - Target geometry: the device format the ring advertises.
- I420
Buffer - Owned, tightly packed I420 buffer used as the normalization scratch.
- I420
View - Borrowed I420 planes with arbitrary strides.
- Normalizer
- Scratch state kept across frames so normalization allocates only on geometry changes.
- Orientation
- One upright transform: clockwise quarter turns, then a horizontal mirror.
Functions§
- fit
- Largest even-aligned size of
swxshthat fits intodwxdhpreserving aspect, and the even-aligned offsets that center it. - orient_
i420 - Apply
otosrc, producing a tightly packed upright copy inout. The chroma planes of the rotated picture are exactly the rotated chroma planes (odd-turn chroma dimensions transpose with them), so each plane is oriented independently.