|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Functions handle allocation and exchange of video buffers. More...
Functions | |
| int | video_enqueue (const struct device *dev, struct video_buffer *buf) |
| Pass a video buffer to a video device. | |
| int | video_dequeue (const struct device *dev, struct video_buffer **vbuf, k_timeout_t timeout) |
| Get a video buffer from a video device. | |
| 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. | |
| struct video_buffer * | video_import_buffer (uint8_t *mem, size_t sz) |
| Import an external memory to the video buffer pool. | |
| int | video_buffer_release (struct video_buffer *buf) |
| Release a video buffer. | |
| int | video_transfer_buffer (const struct device *src, const struct device *sink, enum video_buf_type src_type, enum video_buf_type sink_type, k_timeout_t timeout) |
| Transfer a buffer between 2 video device. | |
| int | video_set_signal (const struct device *dev, struct k_poll_signal *sig) |
| Register/Unregister k_poll signal for a video endpoint. | |
Functions handle allocation and exchange of video buffers.
| struct video_buffer * video_buffer_aligned_alloc | ( | size_t | size, |
| size_t | align, | ||
| k_timeout_t | timeout ) |
#include <video.h>
Allocate aligned video buffer.
| size | Size of the video buffer (in bytes). |
| align | Alignment of the requested memory, must be a power of two. |
| timeout | Timeout duration or K_NO_WAIT |
| struct video_buffer * video_buffer_alloc | ( | size_t | size, |
| k_timeout_t | timeout ) |
#include <video.h>
Allocate video buffer.
| size | Size of the video buffer (in bytes). |
| timeout | Timeout duration or K_NO_WAIT |
| int video_buffer_release | ( | struct video_buffer * | buf | ) |
#include <video.h>
Release a video buffer.
| buf | Pointer to the video buffer to release. |
| 0 | on success or a negative errno on failure |
| int video_dequeue | ( | const struct device * | dev, |
| struct video_buffer ** | vbuf, | ||
| k_timeout_t | timeout ) |
#include <video.h>
Get a video buffer from a video device.
Dequeue an empty (output) or filled (capturing) video buffer in the driver’s endpoint outgoing queue.
| dev | Pointer to the device structure for the driver instance. |
| vbuf | Buffer returned from the video device. |
| timeout | Timeout duration or K_NO_WAIT |
| 0 | Is successful. |
| -EINVAL | If parameters are invalid. |
| -EIO | General input / output error. |
| int video_enqueue | ( | const struct device * | dev, |
| struct video_buffer * | buf ) |
#include <video.h>
Pass a video buffer to a video device.
Enqueue an empty (capturing) or filled (output) video buffer in the driver’s endpoint incoming queue.
| dev | Pointer to the device structure for the driver instance. |
| buf | Pointer to the video buffer. |
| 0 | Is successful. |
| -EINVAL | If parameters are invalid. |
| -EIO | General input / output error. |
| struct video_buffer * video_import_buffer | ( | uint8_t * | mem, |
| size_t | sz ) |
#include <video.h>
Import an external memory to the video buffer pool.
Import an externally allocated memory as a video_buffer in the video buffer pool
| mem | Pointer to the external memory |
| sz | Size of the external memory |
| int video_set_signal | ( | const struct device * | dev, |
| struct k_poll_signal * | sig ) |
#include <video.h>
Register/Unregister k_poll signal for a video endpoint.
Register a poll signal to the endpoint, which will be signaled on frame completion (done, aborted, error). Registering a NULL poll signal unregisters any previously registered signal.
| dev | Pointer to the device structure for the driver instance. |
| sig | Pointer to k_poll_signal |
| 0 | If successful, -ERRNO code otherwise. |
| int video_transfer_buffer | ( | const struct device * | src, |
| const struct device * | sink, | ||
| enum video_buf_type | src_type, | ||
| enum video_buf_type | sink_type, | ||
| k_timeout_t | timeout ) |
#include <video.h>
Transfer a buffer between 2 video device.
Helper function which dequeues a buffer from a source device and enqueues it into a sink device, changing its buffer type between the two.
| src | Video device from where buffer is dequeued (source) |
| sink | Video device into which the buffer is queued (sink) |
| src_type | Video buffer type on the source device |
| sink_type | Video buffer type on the sink device |
| timeout | Timeout to be applied on dequeue |