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

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_buffervideo_buffer_aligned_alloc (size_t size, size_t align, k_timeout_t timeout)
 Allocate aligned video buffer.
struct video_buffervideo_buffer_alloc (size_t size, k_timeout_t timeout)
 Allocate video buffer.
struct video_buffervideo_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.

Detailed Description

Functions handle allocation and exchange of video buffers.

Function Documentation

◆ video_buffer_aligned_alloc()

struct video_buffer * video_buffer_aligned_alloc ( size_t size,
size_t align,
k_timeout_t timeout )

#include <zephyr/video/video.h>

Allocate aligned video buffer.

Parameters
sizeSize of the video buffer (in bytes).
alignAlignment of the requested memory, must be a power of two.
timeoutTimeout duration or K_NO_WAIT
Returns
pointer to allocated video buffer

◆ video_buffer_alloc()

struct video_buffer * video_buffer_alloc ( size_t size,
k_timeout_t timeout )

#include <zephyr/video/video.h>

Allocate video buffer.

Parameters
sizeSize of the video buffer (in bytes).
timeoutTimeout duration or K_NO_WAIT
Returns
pointer to allocated video buffer

◆ video_buffer_release()

int video_buffer_release ( struct video_buffer * buf)

#include <zephyr/video/video.h>

Release a video buffer.

Parameters
bufPointer to the video buffer to release.
Return values
0on success or a negative errno on failure

◆ video_dequeue()

int video_dequeue ( const struct device * dev,
struct video_buffer ** vbuf,
k_timeout_t timeout )

#include <zephyr/video/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.

Parameters
devPointer to the device structure for the driver instance.
vbufBuffer returned from the video device.
timeoutTimeout duration or K_NO_WAIT
Return values
0Is successful.
-EINVALIf parameters are invalid.
-EIOGeneral input / output error.

◆ video_enqueue()

int video_enqueue ( const struct device * dev,
struct video_buffer * buf )

#include <zephyr/video/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.

Parameters
devPointer to the device structure for the driver instance.
bufPointer to the video buffer.
Return values
0Is successful.
-EINVALIf parameters are invalid.
-EIOGeneral input / output error.

◆ video_import_buffer()

struct video_buffer * video_import_buffer ( uint8_t * mem,
size_t sz )

#include <zephyr/video/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

Parameters
memPointer to the external memory
szSize of the external memory
Returns
Pointer to the imported video_buffer holding the external memory on success, NULL on failure

◆ video_set_signal()

int video_set_signal ( const struct device * dev,
struct k_poll_signal * sig )

#include <zephyr/video/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.

Parameters
devPointer to the device structure for the driver instance.
sigPointer to k_poll_signal
Return values
0If successful, -ERRNO code otherwise.

◆ video_transfer_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 )

#include <zephyr/video/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.

Parameters
srcVideo device from where buffer is dequeued (source)
sinkVideo device into which the buffer is queued (sink)
src_typeVideo buffer type on the source device
sink_typeVideo buffer type on the sink device
timeoutTimeout to be applied on dequeue
Returns
0 on success, otherwise a negative errno code