|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Video format APIs. More...
Functions | |
| int | video_estimate_fmt_size (struct video_format *fmt) |
| Estimate the size and pitch in bytes of a video_format. | |
| int | video_set_compose_format (const struct device *dev, struct video_format *fmt) |
| Set compose rectangle (if applicable) prior to setting format. | |
| int | video_set_format (const struct device *dev, struct video_format *fmt) |
| Set video format. | |
| int | video_get_format (const struct device *dev, struct video_format *fmt) |
| Get video format of a driver. | |
| int | video_set_selection (const struct device *dev, struct video_selection *sel) |
| Set video selection (crop/compose). | |
| int | video_get_selection (const struct device *dev, struct video_selection *sel) |
| Get video selection (crop/compose). | |
Video format APIs.
| int video_estimate_fmt_size | ( | struct video_format * | fmt | ) |
#include <zephyr/video/video.h>
Estimate the size and pitch in bytes of a video_format.
This helper should only be used by drivers that support the whole image frame.
For uncompressed formats, it gives the actual size and pitch of the whole raw image without any padding.
For compressed formats, it gives a rough estimate size of a complete compressed frame.
| fmt | Pointer to the video format structure |
| int video_get_format | ( | const struct device * | dev, |
| struct video_format * | fmt ) |
#include <zephyr/video/video.h>
Get video format of a driver.
Get video device current video format.
| dev | Pointer to the device structure for the driver instance. |
| fmt | Pointer to video format struct. |
| pointer | to video format |
| int video_get_selection | ( | const struct device * | dev, |
| struct video_selection * | sel ) |
#include <zephyr/video/video.h>
Get video selection (crop/compose).
Retrieve the current settings related to the crop and compose of the video device. This can also be used to read the native size of the input stream of the video device. This function can be used to read crop / compose capabilities of the device prior to performing configuration via the video_set_selection api.
| dev | Pointer to the device structure for the driver instance. |
| sel | Pointer to a video selection structure, type and target set by the caller |
| 0 | If successful. |
| -EINVAL | If parameters are invalid. |
| -ENOTSUP | If format is not supported. |
| -EIO | General input / output error. |
| int video_set_compose_format | ( | const struct device * | dev, |
| struct video_format * | fmt ) |
#include <zephyr/video/video.h>
Set compose rectangle (if applicable) prior to setting format.
Some devices expose compose capabilities, allowing them to apply a transformation (downscale / upscale) to the frame. For those devices, it is necessary to set the compose rectangle before being able to apply the frame format (which must have the same width / height as the compose rectangle width / height). In order to allow non-compose aware application to be able to control such devices, introduce a helper which, if available, will apply the compose rectangle prior to setting the format.
| dev | Pointer to the video device struct to set format |
| fmt | Pointer to a video format struct. |
| 0 | Is successful. |
| -EINVAL | If parameters are invalid. |
| -ENOTSUP | If format is not supported. |
| -EIO | General input / output error. |
| int video_set_format | ( | const struct device * | dev, |
| struct video_format * | fmt ) |
#include <zephyr/video/video.h>
Set video format.
Configure video device with a specific format.
| dev | Pointer to the device structure for the driver instance. |
| fmt | Pointer to a video format struct. |
| 0 | If successful. |
| -EINVAL | If parameters are invalid. |
| -ENOTSUP | If format is not supported. |
| -EIO | General input / output error. |
| int video_set_selection | ( | const struct device * | dev, |
| struct video_selection * | sel ) |
#include <zephyr/video/video.h>
Set video selection (crop/compose).
Configure the optional crop and compose feature of a video device. Crop is first applied on the input frame, and the result of that crop is applied to the compose. The result of the compose (width/height) is equal to the format width/height given to the video_set_format function.
Some targets are inter-dependents. For instance, setting a VIDEO_SEL_TGT_CROP will reset VIDEO_SEL_TGT_COMPOSE to the same size.
| dev | Pointer to the device structure for the driver instance. |
| sel | Pointer to a video selection structure |
| 0 | If successful. |
| -EINVAL | If parameters are invalid. |
| -ENOTSUP | If format is not supported. |
| -EIO | General input / output error. |