12#ifndef ZEPHYR_INCLUDE_VIDEO_H_
13#define ZEPHYR_INCLUDE_VIDEO_H_
350 return api->
enqueue(dev, ep, buf);
380 return api->
dequeue(dev, ep, buf, timeout);
405 if (api->
flush == NULL) {
409 return api->
flush(dev, ep, cancel);
481 return api->
get_caps(dev, ep, caps);
509 return api->
set_ctrl(dev, cid, value);
537 return api->
get_ctrl(dev, cid, value);
595#define video_fourcc(a, b, c, d)\
596 ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
610#define VIDEO_PIX_FMT_BGGR8 video_fourcc('B', 'G', 'G', 'R')
612#define VIDEO_PIX_FMT_GBRG8 video_fourcc('G', 'B', 'R', 'G')
614#define VIDEO_PIX_FMT_GRBG8 video_fourcc('G', 'R', 'B', 'G')
616#define VIDEO_PIX_FMT_RGGB8 video_fourcc('R', 'G', 'G', 'B')
628#define VIDEO_PIX_FMT_RGB565 video_fourcc('R', 'G', 'B', 'P')
631#define VIDEO_PIX_FMT_XRGB32 video_fourcc('B', 'X', '2', '4')
643#define VIDEO_PIX_FMT_YUYV video_fourcc('Y', 'U', 'Y', 'V')
646#define VIDEO_PIX_FMT_XYUV32 video_fourcc('X', 'Y', 'U', 'V')
659#define VIDEO_PIX_FMT_JPEG video_fourcc('J', 'P', 'E', 'G')
#define ENOSYS
Function not implemented.
Definition errno.h:82
int(* video_api_stream_start_t)(const struct device *dev)
Start the capture or output process.
Definition video.h:206
video_signal_result
video_event enum
Definition video.h:142
int(* video_api_enqueue_t)(const struct device *dev, enum video_endpoint_id ep, struct video_buffer *buf)
Enqueue a buffer in the driver’s incoming queue.
Definition video.h:174
int(* video_api_dequeue_t)(const struct device *dev, enum video_endpoint_id ep, struct video_buffer **buf, k_timeout_t timeout)
Dequeue a buffer from the driver’s outgoing queue.
Definition video.h:184
static int video_get_caps(const struct device *dev, enum video_endpoint_id ep, struct video_caps *caps)
Get the capabilities of a video endpoint.
Definition video.h:470
int(* video_api_stream_stop_t)(const struct device *dev)
Stop the capture or output process.
Definition video.h:214
static int video_stream_stop(const struct device *dev)
Stop the video device function.
Definition video.h:445
static int video_get_ctrl(const struct device *dev, unsigned int cid, void *value)
Get the current value of a control.
Definition video.h:527
static int video_stream_start(const struct device *dev)
Start the video device function.
Definition video.h:424
int(* video_api_get_format_t)(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Get current video format.
Definition video.h:164
struct video_buffer * video_buffer_alloc(size_t size)
Allocate video buffer.
static int video_set_ctrl(const struct device *dev, unsigned int cid, void *value)
Set the value of a control.
Definition video.h:499
static int video_dequeue(const struct device *dev, enum video_endpoint_id ep, struct video_buffer **buf, k_timeout_t timeout)
Dequeue a video buffer.
Definition video.h:368
struct video_buffer * video_buffer_aligned_alloc(size_t size, size_t align)
Allocate aligned video buffer.
int(* video_api_set_signal_t)(const struct device *dev, enum video_endpoint_id ep, struct k_poll_signal *signal)
Register/Unregister poll signal for buffer events.
Definition video.h:252
int(* video_api_get_ctrl_t)(const struct device *dev, unsigned int cid, void *value)
Get a video control value.
Definition video.h:232
static int video_set_signal(const struct device *dev, enum video_endpoint_id ep, struct k_poll_signal *signal)
Register/Unregister k_poll signal for a video endpoint.
Definition video.h:553
static int video_get_format(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Get video format.
Definition video.h:311
static int video_enqueue(const struct device *dev, enum video_endpoint_id ep, struct video_buffer *buf)
Enqueue a video buffer.
Definition video.h:339
void video_buffer_release(struct video_buffer *buf)
Release a video buffer.
int(* video_api_flush_t)(const struct device *dev, enum video_endpoint_id ep, bool cancel)
Flush endpoint buffers, buffer are moved from incoming queue to outgoing queue.
Definition video.h:196
int(* video_api_set_ctrl_t)(const struct device *dev, unsigned int cid, void *value)
Set a video control value.
Definition video.h:222
int(* video_api_get_caps_t)(const struct device *dev, enum video_endpoint_id ep, struct video_caps *caps)
Get capabilities of a video endpoint.
Definition video.h:242
static int video_set_format(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Set video format.
Definition video.h:286
static int video_flush(const struct device *dev, enum video_endpoint_id ep, bool cancel)
Flush endpoint buffers.
Definition video.h:398
int(* video_api_set_format_t)(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Set video format.
Definition video.h:154
video_endpoint_id
video_endpoint_id enum
Definition video.h:126
@ VIDEO_BUF_ABORTED
Definition video.h:144
@ VIDEO_BUF_DONE
Definition video.h:143
@ VIDEO_BUF_ERROR
Definition video.h:145
@ VIDEO_EP_IN
Targets all input endpoints of the device: those consuming data.
Definition video.h:132
@ VIDEO_EP_NONE
Targets some part of the video device not bound to an endpoint.
Definition video.h:128
@ VIDEO_EP_OUT
Targets all output endpoints of the device: those producing data.
Definition video.h:134
@ VIDEO_EP_ALL
Targets all input or output endpoints of the device.
Definition video.h:130
sighandler_t signal(int signo, sighandler_t handler)
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:409
Kernel timeout type.
Definition sys_clock.h:65
Video buffer structure.
Definition video.h:105
uint32_t bytesused
number of bytes occupied by the valid data in the buffer.
Definition video.h:113
uint32_t size
size of the buffer in bytes.
Definition video.h:111
uint8_t * buffer
pointer to the start of the buffer.
Definition video.h:109
void * driver_data
pointer to driver specific data.
Definition video.h:107
uint32_t timestamp
time reference in milliseconds at which the last data byte was actually received for input endpoints ...
Definition video.h:118
Video format capabilities.
Definition video.h:90
uint8_t min_vbuf_count
minimal count of video buffers to enqueue before being able to start the stream.
Definition video.h:96
const struct video_format_cap * format_caps
list of video format capabilities (zero terminated).
Definition video.h:92
video_api_stream_stop_t stream_stop
Definition video.h:261
video_api_set_ctrl_t set_ctrl
Definition video.h:267
video_api_stream_start_t stream_start
Definition video.h:260
video_api_set_ctrl_t get_ctrl
Definition video.h:268
video_api_enqueue_t enqueue
Definition video.h:264
video_api_set_signal_t set_signal
Definition video.h:269
video_api_get_format_t get_format
Definition video.h:259
video_api_get_caps_t get_caps
Definition video.h:262
video_api_set_format_t set_format
Definition video.h:258
video_api_flush_t flush
Definition video.h:266
video_api_dequeue_t dequeue
Definition video.h:265