Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Video capabilities APIs. More...

Functions

int video_get_caps (const struct device *dev, struct video_caps *caps)
 Get the capabilities of a video endpoint.
int video_transform_cap (const struct device *const dev, const struct video_format_cap *const cap, struct video_format_cap *const res_cap, enum video_buf_type type, uint16_t ind)
 Transform a video format capability from one end to the other end of a m2m video device.
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.

Detailed Description

Video capabilities APIs.

Function Documentation

◆ video_format_caps_index()

int video_format_caps_index ( const struct video_format_cap * fmts,
const struct video_format * fmt,
size_t * idx )

#include <zephyr/video/video.h>

Search for a format that matches in a list of capabilities.

Parameters
fmtsThe format capability list to search.
fmtThe format to find in the list.
idxThe pointer to a number of the first format that matches.
Returns
0 when a format is found.
-ENOENT when no matching format is found.

◆ video_get_caps()

int video_get_caps ( const struct device * dev,
struct video_caps * caps )

#include <zephyr/video/video.h>

Get the capabilities of a video endpoint.

Parameters
devPointer to the device structure for the driver instance.
capsPointer to the video_caps struct to fill.
Return values
0If successful, -ERRNO code otherwise.
-ENOSYSAPI is not implemented.

◆ video_transform_cap()

int video_transform_cap ( const struct device *const dev,
const struct video_format_cap *const cap,
struct video_format_cap *const res_cap,
enum video_buf_type type,
uint16_t ind )

#include <zephyr/video/video.h>

Transform a video format capability from one end to the other end of a m2m video device.

This function transforms a video_format_cap from one end to the other end of an m2m video device. It allows applications to iteratively get all the supported capabilities on one end of the device given a single input capability on the other end.

Applications pass the addresses of a single input cap and a single res_cap together with the type of the res_cap and the index (started from 0) to iterate through to the function. The driver fills the res_cap structure and return 0 each time. Index should be incremented to get the next res_cap until the function returns an errno e.g., -EINVAL. For example:

struct video_format_cap cap = {.pixelformat = VIDEO_PIX_FMT_RGB565};
struct video_format_cap res_cap = {0};
uint8_t ind = 0;
while (video_transform_cap(dev, &cap, &res_cap, VIDEO_BUF_TYPE_OUTPUT, ind) == 0) {
// Process output_cap here
ind++;
}
int video_transform_cap(const struct device *const dev, const struct video_format_cap *const cap, struct video_format_cap *const res_cap, enum video_buf_type type, uint16_t ind)
Transform a video format capability from one end to the other end of a m2m video device.
#define VIDEO_PIX_FMT_RGB565
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0].
Definition formats.h:676
@ VIDEO_BUF_TYPE_OUTPUT
output buffer type
Definition types.h:46
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Video format capability.
Definition types.h:135
Parameters
devPointer to the device structure.
capPointer to the source video format capability structure.
res_capPointer to the resulting video format capability structure, filled by the driver.
typeThe video_buf_type of the resulting transformed cap.
indIndex of the resulting transformed cap.
Return values
0on success.
-ENOSYSAPI is not implemented.
-ENOTSUPThe transformation is not supported.