Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
|
4.1.99 |
Public APIs for Video. More...
Go to the source code of this file.
Data Structures | |
struct | video_format |
Video format structure. More... | |
struct | video_format_cap |
Video format capability. More... | |
struct | video_caps |
Video format capabilities. More... | |
struct | video_buffer |
Video buffer structure. More... | |
struct | video_frmival |
Video frame interval structure. More... | |
struct | video_frmival_stepwise |
Video frame interval stepwise structure. More... | |
struct | video_frmival_enum |
Video frame interval enumeration structure. More... | |
struct | video_driver_api |
Macros | |
#define | LINE_COUNT_HEIGHT (-1) |
#define | VIDEO_FOURCC(a, b, c, d) |
Four-character-code uniquely identifying the pixel format. | |
#define | VIDEO_FOURCC_FROM_STR(str) |
Convert a four-character-string to a four-character-code. | |
#define | VIDEO_FOURCC_TO_STR(fourcc) |
Convert a four-character-code to a four-character-string. | |
Bayer formats (R, G, B channels). | |
The full color information is spread over multiple pixels. When the format includes more than 8-bit per pixel, a strategy becomes needed to pack the bits over multiple bytes, as illustrated for each format. The number above the 'R', 'r', 'G', 'g', 'B', 'b' are hints about which pixel number the following bits belong to. | |
#define | VIDEO_PIX_FMT_SBGGR8 VIDEO_FOURCC('B', 'A', '8', '1') |
#define | VIDEO_PIX_FMT_SGBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G') |
#define | VIDEO_PIX_FMT_SGRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G') |
#define | VIDEO_PIX_FMT_SRGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B') |
#define | VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A') |
#define | VIDEO_PIX_FMT_SGBRG10P VIDEO_FOURCC('p', 'G', 'A', 'A') |
#define | VIDEO_PIX_FMT_SGRBG10P VIDEO_FOURCC('p', 'g', 'A', 'A') |
#define | VIDEO_PIX_FMT_SRGGB10P VIDEO_FOURCC('p', 'R', 'A', 'A') |
#define | VIDEO_PIX_FMT_SBGGR12P VIDEO_FOURCC('p', 'B', 'C', 'C') |
#define | VIDEO_PIX_FMT_SGBRG12P VIDEO_FOURCC('p', 'G', 'C', 'C') |
#define | VIDEO_PIX_FMT_SGRBG12P VIDEO_FOURCC('p', 'g', 'C', 'C') |
#define | VIDEO_PIX_FMT_SRGGB12P VIDEO_FOURCC('p', 'R', 'C', 'C') |
#define | VIDEO_PIX_FMT_SBGGR14P VIDEO_FOURCC('p', 'B', 'E', 'E') |
#define | VIDEO_PIX_FMT_SGBRG14P VIDEO_FOURCC('p', 'G', 'E', 'E') |
#define | VIDEO_PIX_FMT_SGRBG14P VIDEO_FOURCC('p', 'g', 'E', 'E') |
#define | VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E') |
#define | VIDEO_PIX_FMT_SBGGR10 VIDEO_FOURCC('B', 'G', '1', '0') |
#define | VIDEO_PIX_FMT_SGBRG10 VIDEO_FOURCC('G', 'B', '1', '0') |
#define | VIDEO_PIX_FMT_SGRBG10 VIDEO_FOURCC('B', 'A', '1', '0') |
#define | VIDEO_PIX_FMT_SRGGB10 VIDEO_FOURCC('R', 'G', '1', '0') |
#define | VIDEO_PIX_FMT_SBGGR12 VIDEO_FOURCC('B', 'G', '1', '2') |
#define | VIDEO_PIX_FMT_SGBRG12 VIDEO_FOURCC('G', 'B', '1', '2') |
#define | VIDEO_PIX_FMT_SGRBG12 VIDEO_FOURCC('B', 'A', '1', '2') |
#define | VIDEO_PIX_FMT_SRGGB12 VIDEO_FOURCC('R', 'G', '1', '2') |
#define | VIDEO_PIX_FMT_SBGGR14 VIDEO_FOURCC('B', 'G', '1', '4') |
#define | VIDEO_PIX_FMT_SGBRG14 VIDEO_FOURCC('G', 'B', '1', '4') |
#define | VIDEO_PIX_FMT_SGRBG14 VIDEO_FOURCC('G', 'R', '1', '4') |
#define | VIDEO_PIX_FMT_SRGGB14 VIDEO_FOURCC('R', 'G', '1', '4') |
#define | VIDEO_PIX_FMT_SBGGR16 VIDEO_FOURCC('B', 'Y', 'R', '2') |
#define | VIDEO_PIX_FMT_SGBRG16 VIDEO_FOURCC('G', 'B', '1', '6') |
#define | VIDEO_PIX_FMT_SGRBG16 VIDEO_FOURCC('G', 'R', '1', '6') |
#define | VIDEO_PIX_FMT_SRGGB16 VIDEO_FOURCC('R', 'G', '1', '6') |
Grayscale formats | |
Luminance (Y) channel only, in various bit depth and packing. When the format includes more than 8-bit per pixel, a strategy becomes needed to pack the bits over multiple bytes, as illustrated for each format. The number above the 'Y', 'y' are hints about which pixel number the following bits belong to. | |
#define | VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y') |
Same as Y8 (8-bit luma-only) following the standard FOURCC naming, or L8 in some graphics libraries. | |
#define | VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P') |
#define | VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P') |
#define | VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P') |
#define | VIDEO_PIX_FMT_Y10 VIDEO_FOURCC('Y', '1', '0', ' ') |
Little endian, with the 6 most significant bits set to Zero. | |
#define | VIDEO_PIX_FMT_Y12 VIDEO_FOURCC('Y', '1', '2', ' ') |
Little endian, with the 4 most significant bits set to Zero. | |
#define | VIDEO_PIX_FMT_Y14 VIDEO_FOURCC('Y', '1', '4', ' ') |
Little endian, with the 2 most significant bits set to Zero. | |
#define | VIDEO_PIX_FMT_Y16 VIDEO_FOURCC('Y', '1', '6', ' ') |
Little endian. | |
RGB formats | |
Per-color (R, G, B) channels. | |
#define | VIDEO_PIX_FMT_RGB565X VIDEO_FOURCC('R', 'G', 'B', 'R') |
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0]. | |
#define | VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P') |
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0]. | |
#define | VIDEO_PIX_FMT_BGR24 VIDEO_FOURCC('B', 'G', 'R', '3') |
24 bit RGB format with 8 bit per component | |
#define | VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3') |
24 bit RGB format with 8 bit per component | |
#define | VIDEO_PIX_FMT_ARGB32 VIDEO_FOURCC('B', 'A', '2', '4') |
#define | VIDEO_PIX_FMT_ABGR32 VIDEO_FOURCC('A', 'R', '2', '4') |
#define | VIDEO_PIX_FMT_RGBA32 VIDEO_FOURCC('A', 'B', '2', '4') |
#define | VIDEO_PIX_FMT_BGRA32 VIDEO_FOURCC('R', 'A', '2', '4') |
#define | VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4') |
The first byte is empty (X) for each pixel. | |
YUV formats | |
Luminance (Y) and chrominance (U, V) channels. | |
#define | VIDEO_PIX_FMT_YUYV VIDEO_FOURCC('Y', 'U', 'Y', 'V') |
There is either a missing channel per pixel, U or V. | |
#define | VIDEO_PIX_FMT_YVYU VIDEO_FOURCC('Y', 'V', 'Y', 'U') |
#define | VIDEO_PIX_FMT_VYUY VIDEO_FOURCC('V', 'Y', 'U', 'Y') |
#define | VIDEO_PIX_FMT_UYVY VIDEO_FOURCC('U', 'Y', 'V', 'Y') |
#define | VIDEO_PIX_FMT_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V') |
The first byte is empty (X) for each pixel. | |
Compressed formats | |
#define | VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G') |
Both JPEG (single frame) and Motion-JPEG (MJPEG, multiple JPEG frames concatenated) | |
MIPI CSI2 Data-types | |
#define | VIDEO_MIPI_CSI2_DT_NULL 0x10 |
#define | VIDEO_MIPI_CSI2_DT_BLANKING 0x11 |
#define | VIDEO_MIPI_CSI2_DT_EMBEDDED_8 0x12 |
#define | VIDEO_MIPI_CSI2_DT_YUV420_8 0x18 |
#define | VIDEO_MIPI_CSI2_DT_YUV420_10 0x19 |
#define | VIDEO_MIPI_CSI2_DT_YUV420_CSPS_8 0x1c |
#define | VIDEO_MIPI_CSI2_DT_YUV420_CSPS_10 0x1d |
#define | VIDEO_MIPI_CSI2_DT_YUV422_8 0x1e |
#define | VIDEO_MIPI_CSI2_DT_YUV422_10 0x1f |
#define | VIDEO_MIPI_CSI2_DT_RGB444 0x20 |
#define | VIDEO_MIPI_CSI2_DT_RGB555 0x21 |
#define | VIDEO_MIPI_CSI2_DT_RGB565 0x22 |
#define | VIDEO_MIPI_CSI2_DT_RGB666 0x23 |
#define | VIDEO_MIPI_CSI2_DT_RGB888 0x24 |
#define | VIDEO_MIPI_CSI2_DT_RAW6 0x28 |
#define | VIDEO_MIPI_CSI2_DT_RAW7 0x29 |
#define | VIDEO_MIPI_CSI2_DT_RAW8 0x2a |
#define | VIDEO_MIPI_CSI2_DT_RAW10 0x2b |
#define | VIDEO_MIPI_CSI2_DT_RAW12 0x2c |
#define | VIDEO_MIPI_CSI2_DT_RAW14 0x2d |
#define | VIDEO_MIPI_CSI2_DT_USER(n) |
Typedefs | |
typedef int(* | video_api_format_t) (const struct device *dev, struct video_format *fmt) |
Function pointer type for video_set/get_format() | |
typedef int(* | video_api_frmival_t) (const struct device *dev, struct video_frmival *frmival) |
Function pointer type for video_set/get_frmival() | |
typedef int(* | video_api_enum_frmival_t) (const struct device *dev, struct video_frmival_enum *fie) |
List all supported frame intervals of a given format. | |
typedef int(* | video_api_enqueue_t) (const struct device *dev, struct video_buffer *buf) |
Enqueue a buffer in the driver’s incoming queue. | |
typedef int(* | video_api_dequeue_t) (const struct device *dev, struct video_buffer **buf, k_timeout_t timeout) |
Dequeue a buffer from the driver’s outgoing queue. | |
typedef int(* | video_api_flush_t) (const struct device *dev, bool cancel) |
Flush endpoint buffers, buffer are moved from incoming queue to outgoing queue. | |
typedef int(* | video_api_set_stream_t) (const struct device *dev, bool enable, enum video_buf_type type) |
Start or stop streaming on the video device. | |
typedef int(* | video_api_ctrl_t) (const struct device *dev, uint32_t cid) |
Set/Get a video control value. | |
typedef int(* | video_api_get_caps_t) (const struct device *dev, struct video_caps *caps) |
Get capabilities of a video endpoint. | |
typedef int(* | video_api_set_signal_t) (const struct device *dev, struct k_poll_signal *sig) |
Register/Unregister poll signal for buffer events. | |
Enumerations | |
enum | video_buf_type { VIDEO_BUF_TYPE_INPUT , VIDEO_BUF_TYPE_OUTPUT } |
video_buf_type enum More... | |
enum | video_frmival_type { VIDEO_FRMIVAL_TYPE_DISCRETE = 1 , VIDEO_FRMIVAL_TYPE_STEPWISE = 2 } |
video_frmival_type enum More... | |
enum | video_signal_result { VIDEO_BUF_DONE , VIDEO_BUF_ABORTED , VIDEO_BUF_ERROR } |
video_event enum More... | |
Functions | |
static int | video_set_format (const struct device *dev, struct video_format *fmt) |
Set video format. | |
static int | video_get_format (const struct device *dev, struct video_format *fmt) |
Get video format. | |
static int | video_set_frmival (const struct device *dev, struct video_frmival *frmival) |
Set video frame interval. | |
static int | video_get_frmival (const struct device *dev, struct video_frmival *frmival) |
Get video frame interval. | |
static int | video_enum_frmival (const struct device *dev, struct video_frmival_enum *fie) |
List video frame intervals. | |
static int | video_enqueue (const struct device *dev, struct video_buffer *buf) |
Enqueue a video buffer. | |
static int | video_dequeue (const struct device *dev, struct video_buffer **buf, k_timeout_t timeout) |
Dequeue a video buffer. | |
static int | video_flush (const struct device *dev, bool cancel) |
Flush endpoint buffers. | |
static int | video_stream_start (const struct device *dev, enum video_buf_type type) |
Start the video device function. | |
static int | video_stream_stop (const struct device *dev, enum video_buf_type type) |
Stop the video device function. | |
static int | video_get_caps (const struct device *dev, struct video_caps *caps) |
Get the capabilities of a video endpoint. | |
int | video_set_ctrl (const struct device *dev, struct video_control *control) |
Set the value of a control. | |
int | video_get_ctrl (const struct device *dev, struct video_control *control) |
Get the current value of a control. | |
int | video_query_ctrl (struct video_ctrl_query *cq) |
Query information about a control. | |
void | video_print_ctrl (const struct video_ctrl_query *const cq) |
Print all the information of a control. | |
static int | video_set_signal (const struct device *dev, struct k_poll_signal *sig) |
Register/Unregister k_poll signal for a video endpoint. | |
struct video_buffer * | video_buffer_aligned_alloc (size_t size, size_t align, k_timeout_t timeout) |
Allocate aligned video buffer. | |
struct video_buffer * | video_buffer_alloc (size_t size, k_timeout_t timeout) |
Allocate video buffer. | |
void | video_buffer_release (struct video_buffer *buf) |
Release a video buffer. | |
int | video_format_caps_index (const struct video_format_cap *fmts, const struct video_format *fmt, size_t *idx) |
Search for a format that matches in a list of capabilities. | |
static uint64_t | video_frmival_nsec (const struct video_frmival *frmival) |
Compute the difference between two frame intervals. | |
void | video_closest_frmival_stepwise (const struct video_frmival_stepwise *stepwise, const struct video_frmival *desired, struct video_frmival *match) |
Find the closest match to a frame interval value within a stepwise frame interval. | |
void | video_closest_frmival (const struct device *dev, struct video_frmival_enum *match) |
Find the closest match to a frame interval value within a video device. | |
int64_t | video_get_csi_link_freq (const struct device *dev, uint8_t bpp, uint8_t lane_nb) |
Return the link-frequency advertised by a device. | |
static unsigned int | video_bits_per_pixel (uint32_t pixfmt) |
Get number of bits per pixel of a pixel format. | |
Public APIs for Video.