12#ifndef ZEPHYR_INCLUDE_VIDEO_H_
13#define ZEPHYR_INCLUDE_VIDEO_H_
325 return api->
enqueue(dev, ep, buf);
380 if (api->
flush == NULL) {
384 return api->
flush(dev, ep, cancel);
456 return api->
get_caps(dev, ep, caps);
484 return api->
set_ctrl(dev, cid, value);
512 return api->
get_ctrl(dev, cid, value);
560#define video_fourcc(a, b, c, d)\
561 ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
564#define VIDEO_PIX_FMT_BGGR8 video_fourcc('B', 'G', 'G', 'R')
565#define VIDEO_PIX_FMT_GBRG8 video_fourcc('G', 'B', 'R', 'G')
566#define VIDEO_PIX_FMT_GRBG8 video_fourcc('G', 'R', 'B', 'G')
567#define VIDEO_PIX_FMT_RGGB8 video_fourcc('R', 'G', 'G', 'B')
570#define VIDEO_PIX_FMT_RGB565 video_fourcc('R', 'G', 'B', 'P')
573#define VIDEO_PIX_FMT_JPEG video_fourcc('J', 'P', 'E', 'G')
576#define VIDEO_PIX_FMT_YUYV video_fourcc('Y', 'U', 'Y', 'V')
577#define VIDEO_PIX_FMT_YVYU video_fourcc('Y', 'V', 'Y', 'U')
578#define VIDEO_PIX_FMT_VYVU video_fourcc('V', 'Y', 'V', 'U')
579#define VIDEO_PIX_FMT_UYVY video_fourcc('U', 'Y', 'V', 'Y')
ZTEST_BMEM int timeout
Definition: main.c:31
#define ENOSYS
Definition: errno.h:83
int(* video_api_stream_start_t)(const struct device *dev)
Start the capture or output process. See video_stream_start() for argument descriptions.
Definition: video.h:186
int(* video_api_set_format_t)(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Set video format See video_set_format() for argument descriptions.
Definition: video.h:139
video_signal_result
video_event enum Identify video event.
Definition: video.h:128
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. See video_enqueue() for argument descriptions.
Definition: video.h:157
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. See video_set_signal() for argument descriptions.
Definition: video.h:227
int(* video_api_stream_stop_t)(const struct device *dev)
Stop the capture or output process. See video_stream_stop() for argument descriptions.
Definition: video.h:193
int(* video_api_get_format_t)(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
get current video format See video_get_format() for argument descriptions.
Definition: video.h:148
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:445
static int video_stream_stop(const struct device *dev)
Stop the video device function.
Definition: video.h:420
static int video_get_ctrl(const struct device *dev, unsigned int cid, void *value)
Get the current value of a control.
Definition: video.h:502
static int video_stream_start(const struct device *dev)
Start the video device function.
Definition: video.h:399
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:474
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. See video_flush() for...
Definition: video.h:177
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. See video_get_caps() for argument descriptions.
Definition: video.h:218
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:343
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. See video_dequeue() for argument descriptions.
Definition: video.h:166
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:528
static int video_get_format(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Get video format.
Definition: video.h:286
static int video_enqueue(const struct device *dev, enum video_endpoint_id ep, struct video_buffer *buf)
Enqueue a video buffer.
Definition: video.h:314
void video_buffer_release(struct video_buffer *buf)
Release a video buffer.
int(* video_api_get_ctrl_t)(const struct device *dev, unsigned int cid, void *value)
get a video control value. See video_get_ctrl() for argument descriptions.
Definition: video.h:209
static int video_set_format(const struct device *dev, enum video_endpoint_id ep, struct video_format *fmt)
Set video format.
Definition: video.h:261
static int video_flush(const struct device *dev, enum video_endpoint_id ep, bool cancel)
Flush endpoint buffers.
Definition: video.h:373
video_endpoint_id
video_endpoint_id enum Identify the video device endpoint.
Definition: video.h:117
int(* video_api_set_ctrl_t)(const struct device *dev, unsigned int cid, void *value)
set a video control value. See video_set_ctrl() for argument descriptions.
Definition: video.h:200
@ VIDEO_BUF_ABORTED
Definition: video.h:130
@ VIDEO_BUF_DONE
Definition: video.h:129
@ VIDEO_BUF_ERROR
Definition: video.h:131
@ VIDEO_EP_IN
Definition: video.h:120
@ VIDEO_EP_NONE
Definition: video.h:118
@ VIDEO_EP_ANY
Definition: video.h:119
@ VIDEO_EP_OUT
Definition: video.h:121
static ZTEST_BMEM volatile int ret
Definition: k_float_disable.c:28
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
const void * api
Definition: device.h:373
Definition: kernel.h:5405
Kernel timeout type.
Definition: sys_clock.h:65
video buffer structure
Definition: video.h:105
uint32_t bytesused
Definition: video.h:109
uint32_t size
Definition: video.h:108
uint8_t * buffer
Definition: video.h:107
void * driver_data
Definition: video.h:106
uint32_t timestamp
Definition: video.h:110
video capabilities
Definition: video.h:86
uint8_t min_vbuf_count
Definition: video.h:88
const struct video_format_cap * format_caps
Definition: video.h:87
video_api_stream_stop_t stream_stop
Definition: video.h:236
video_api_set_ctrl_t set_ctrl
Definition: video.h:242
video_api_stream_start_t stream_start
Definition: video.h:235
video_api_set_ctrl_t get_ctrl
Definition: video.h:243
video_api_enqueue_t enqueue
Definition: video.h:239
video_api_set_signal_t set_signal
Definition: video.h:244
video_api_get_format_t get_format
Definition: video.h:234
video_api_get_caps_t get_caps
Definition: video.h:237
video_api_set_format_t set_format
Definition: video.h:233
video_api_flush_t flush
Definition: video.h:241
video_api_dequeue_t dequeue
Definition: video.h:240
static struct k_poll_signal signal
Definition: test_poll.c:696