camera_frame_nv12_t

Updated: April 19, 2023

A frame descriptor used for NV12 frame types

Synopsis:

#include <camera/camera_api.h>
typedef struct {
    uint32_t height;
    uint32_t width;
    uint32_t stride;
    int64_t uv_offset;
    int64_t uv_stride;
} camera_frame_nv12_t;

Data:

uint32_t height
The height of the frame in pixels.
uint32_t width
The width of the frame in pixels.
uint32_t stride
The number of bytes, in memory, between the first pixel of the first row and the first pixel of the second row of the luminance (Y) plane.

Stride is often called pitch. For more information, see the uv_stride member.

int64_t uv_offset
The number of bytes, in memory, between the first pixel of the Y plane and the first pixel of the UV plane.

On a device where there is no gap between the Y and UV planes, uv_offset would be height times stride bytes. This equivalence is not guaranteed across all devices, so it is important to observe the uv_offset value rather than attempting to compute the offset.

int64_t uv_stride
The number of bytes, in memory, between the first pixel of the first row and the first pixel of the second row of the chrominance (UV) plane.

For more information, see the stride member.

Library:

libcamapi

Description:

Use this frame descriptor when CAMERA_FRAMETYPE_NV12 is reported as the camera_frametype_t.