Zephyr Project API 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
video.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 2019 Linaro Limited.
9 * Copyright 2025 NXP
10 *
11 * SPDX-License-Identifier: Apache-2.0
12 */
13#ifndef ZEPHYR_INCLUDE_VIDEO_H_
14#define ZEPHYR_INCLUDE_VIDEO_H_
15
25#include <zephyr/device.h>
26#include <stddef.h>
27#include <zephyr/kernel.h>
28
29#include <zephyr/types.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/*
36 * Flag used by @ref video_caps structure to indicate endpoint operates on
37 * buffers the size of the video frame
38 */
39#define LINE_COUNT_HEIGHT (-1)
40
41struct video_control;
42
57
82
105
138
168
180
193
208
219 const struct video_format *format;
223 union {
224 struct video_frmival discrete;
225 struct video_frmival_stepwise stepwise;
226 };
227};
228
239
246typedef int (*video_api_format_t)(const struct device *dev, struct video_format *fmt);
247
254typedef int (*video_api_frmival_t)(const struct device *dev, struct video_frmival *frmival);
255
262typedef int (*video_api_enum_frmival_t)(const struct device *dev, struct video_frmival_enum *fie);
263
270typedef int (*video_api_enqueue_t)(const struct device *dev, struct video_buffer *buf);
271
278typedef int (*video_api_dequeue_t)(const struct device *dev, struct video_buffer **buf,
279 k_timeout_t timeout);
280
288typedef int (*video_api_flush_t)(const struct device *dev, bool cancel);
289
302typedef int (*video_api_set_stream_t)(const struct device *dev, bool enable,
303 enum video_buf_type type);
304
312typedef int (*video_api_ctrl_t)(const struct device *dev, uint32_t cid);
313
320typedef int (*video_api_get_caps_t)(const struct device *dev, struct video_caps *caps);
321
328typedef int (*video_api_set_signal_t)(const struct device *dev, struct k_poll_signal *sig);
329
347
361static inline int video_set_format(const struct device *dev, struct video_format *fmt)
362{
363 const struct video_driver_api *api;
364
365 __ASSERT_NO_MSG(dev != NULL);
366 __ASSERT_NO_MSG(fmt != NULL);
367
368 api = (const struct video_driver_api *)dev->api;
369 if (api->set_format == NULL) {
370 return -ENOSYS;
371 }
372
373 return api->set_format(dev, fmt);
374}
375
386static inline int video_get_format(const struct device *dev, struct video_format *fmt)
387{
388 const struct video_driver_api *api;
389
390 __ASSERT_NO_MSG(dev != NULL);
391 __ASSERT_NO_MSG(fmt != NULL);
392
393 api = (const struct video_driver_api *)dev->api;
394 if (api->get_format == NULL) {
395 return -ENOSYS;
396 }
397
398 return api->get_format(dev, fmt);
399}
400
417static inline int video_set_frmival(const struct device *dev, struct video_frmival *frmival)
418{
419 const struct video_driver_api *api;
420
421 __ASSERT_NO_MSG(dev != NULL);
422 __ASSERT_NO_MSG(frmival != NULL);
423
424 if (frmival->numerator == 0 || frmival->denominator == 0) {
425 return -EINVAL;
426 }
427
428 api = (const struct video_driver_api *)dev->api;
429 if (api->set_frmival == NULL) {
430 return -ENOSYS;
431 }
432
433 return api->set_frmival(dev, frmival);
434}
435
449static inline int video_get_frmival(const struct device *dev, struct video_frmival *frmival)
450{
451 const struct video_driver_api *api;
452
453 __ASSERT_NO_MSG(dev != NULL);
454 __ASSERT_NO_MSG(frmival != NULL);
455
456 api = (const struct video_driver_api *)dev->api;
457 if (api->get_frmival == NULL) {
458 return -ENOSYS;
459 }
460
461 return api->get_frmival(dev, frmival);
462}
463
481static inline int video_enum_frmival(const struct device *dev, struct video_frmival_enum *fie)
482{
483 const struct video_driver_api *api;
484
485 __ASSERT_NO_MSG(dev != NULL);
486 __ASSERT_NO_MSG(fie != NULL);
487 __ASSERT_NO_MSG(fie->format != NULL);
488
489 api = (const struct video_driver_api *)dev->api;
490 if (api->enum_frmival == NULL) {
491 return -ENOSYS;
492 }
493
494 return api->enum_frmival(dev, fie);
495}
496
510static inline int video_enqueue(const struct device *dev, struct video_buffer *buf)
511{
512 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
513
514 __ASSERT_NO_MSG(dev != NULL);
515 __ASSERT_NO_MSG(buf != NULL);
516 __ASSERT_NO_MSG(buf->buffer != NULL);
517
518 api = (const struct video_driver_api *)dev->api;
519 if (api->enqueue == NULL) {
520 return -ENOSYS;
521 }
522
523 return api->enqueue(dev, buf);
524}
525
540static inline int video_dequeue(const struct device *dev, struct video_buffer **buf,
541 k_timeout_t timeout)
542{
543 const struct video_driver_api *api;
544
545 __ASSERT_NO_MSG(dev != NULL);
546 __ASSERT_NO_MSG(buf != NULL);
547
548 api = (const struct video_driver_api *)dev->api;
549 if (api->dequeue == NULL) {
550 return -ENOSYS;
551 }
552
553 return api->dequeue(dev, buf, timeout);
554}
555
569static inline int video_flush(const struct device *dev, bool cancel)
570{
571 const struct video_driver_api *api;
572
573 __ASSERT_NO_MSG(dev != NULL);
574
575 api = (const struct video_driver_api *)dev->api;
576 if (api->flush == NULL) {
577 return -ENOSYS;
578 }
579
580 return api->flush(dev, cancel);
581}
582
598static inline int video_stream_start(const struct device *dev, enum video_buf_type type)
599{
600 const struct video_driver_api *api;
601
602 __ASSERT_NO_MSG(dev != NULL);
603
604 api = (const struct video_driver_api *)dev->api;
605 if (api->set_stream == NULL) {
606 return -ENOSYS;
607 }
608
609 return api->set_stream(dev, true, type);
610}
611
624static inline int video_stream_stop(const struct device *dev, enum video_buf_type type)
625{
626 const struct video_driver_api *api;
627 int ret;
628
629 __ASSERT_NO_MSG(dev != NULL);
630
631 api = (const struct video_driver_api *)dev->api;
632 if (api->set_stream == NULL) {
633 return -ENOSYS;
634 }
635
636 ret = api->set_stream(dev, false, type);
637 video_flush(dev, true);
638
639 return ret;
640}
641
650static inline int video_get_caps(const struct device *dev, struct video_caps *caps)
651{
652 const struct video_driver_api *api;
653
654 __ASSERT_NO_MSG(dev != NULL);
655 __ASSERT_NO_MSG(caps != NULL);
656
657 api = (const struct video_driver_api *)dev->api;
658 if (api->get_caps == NULL) {
659 return -ENOSYS;
660 }
661
662 return api->get_caps(dev, caps);
663}
664
679int video_set_ctrl(const struct device *dev, struct video_control *control);
680
695int video_get_ctrl(const struct device *dev, struct video_control *control);
696
697struct video_ctrl_query;
698
718
728void video_print_ctrl(const struct video_ctrl_query *const cq);
729
742static inline int video_set_signal(const struct device *dev, struct k_poll_signal *sig)
743{
744 const struct video_driver_api *api;
745
746 __ASSERT_NO_MSG(dev != NULL);
747 __ASSERT_NO_MSG(sig != NULL);
748
749 api = (const struct video_driver_api *)dev->api;
750 if (api->set_signal == NULL) {
751 return -ENOSYS;
752 }
753
754 return api->set_signal(dev, sig);
755}
756
766struct video_buffer *video_buffer_aligned_alloc(size_t size, size_t align, k_timeout_t timeout);
767
777
784
795int video_format_caps_index(const struct video_format_cap *fmts, const struct video_format *fmt,
796 size_t *idx);
797
805static inline uint64_t video_frmival_nsec(const struct video_frmival *frmival)
806{
807 __ASSERT_NO_MSG(frmival != NULL);
808 __ASSERT_NO_MSG(frmival->denominator != 0);
809
810 return (uint64_t)NSEC_PER_SEC * frmival->numerator / frmival->denominator;
811}
812
821 const struct video_frmival *desired,
822 struct video_frmival *match);
823
841void video_closest_frmival(const struct device *dev, struct video_frmival_enum *match);
842
858int64_t video_get_csi_link_freq(const struct device *dev, uint8_t bpp, uint8_t lane_nb);
859
871#define VIDEO_FOURCC(a, b, c, d) \
872 ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
873
883#define VIDEO_FOURCC_FROM_STR(str) VIDEO_FOURCC((str)[0], (str)[1], (str)[2], (str)[3])
884
894#define VIDEO_FOURCC_TO_STR(fourcc) \
895 ((char[]){ \
896 (char)((fourcc) & 0xFF), \
897 (char)(((fourcc) >> 8) & 0xFF), \
898 (char)(((fourcc) >> 16) & 0xFF), \
899 (char)(((fourcc) >> 24) & 0xFF), \
900 '\0' \
901 })
902
924#define VIDEO_PIX_FMT_SBGGR8 VIDEO_FOURCC('B', 'A', '8', '1')
925
933#define VIDEO_PIX_FMT_SGBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G')
934
942#define VIDEO_PIX_FMT_SGRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G')
943
951#define VIDEO_PIX_FMT_SRGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B')
952
960#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A')
961
969#define VIDEO_PIX_FMT_SGBRG10P VIDEO_FOURCC('p', 'G', 'A', 'A')
970
978#define VIDEO_PIX_FMT_SGRBG10P VIDEO_FOURCC('p', 'g', 'A', 'A')
979
987#define VIDEO_PIX_FMT_SRGGB10P VIDEO_FOURCC('p', 'R', 'A', 'A')
988
996#define VIDEO_PIX_FMT_SBGGR12P VIDEO_FOURCC('p', 'B', 'C', 'C')
997
1005#define VIDEO_PIX_FMT_SGBRG12P VIDEO_FOURCC('p', 'G', 'C', 'C')
1006
1014#define VIDEO_PIX_FMT_SGRBG12P VIDEO_FOURCC('p', 'g', 'C', 'C')
1015
1023#define VIDEO_PIX_FMT_SRGGB12P VIDEO_FOURCC('p', 'R', 'C', 'C')
1024
1032#define VIDEO_PIX_FMT_SBGGR14P VIDEO_FOURCC('p', 'B', 'E', 'E')
1033
1041#define VIDEO_PIX_FMT_SGBRG14P VIDEO_FOURCC('p', 'G', 'E', 'E')
1042
1050#define VIDEO_PIX_FMT_SGRBG14P VIDEO_FOURCC('p', 'g', 'E', 'E')
1051
1059#define VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E')
1060
1067#define VIDEO_PIX_FMT_SBGGR10 VIDEO_FOURCC('B', 'G', '1', '0')
1068
1075#define VIDEO_PIX_FMT_SGBRG10 VIDEO_FOURCC('G', 'B', '1', '0')
1076
1083#define VIDEO_PIX_FMT_SGRBG10 VIDEO_FOURCC('B', 'A', '1', '0')
1084
1091#define VIDEO_PIX_FMT_SRGGB10 VIDEO_FOURCC('R', 'G', '1', '0')
1092
1099#define VIDEO_PIX_FMT_SBGGR12 VIDEO_FOURCC('B', 'G', '1', '2')
1100
1107#define VIDEO_PIX_FMT_SGBRG12 VIDEO_FOURCC('G', 'B', '1', '2')
1108
1115#define VIDEO_PIX_FMT_SGRBG12 VIDEO_FOURCC('B', 'A', '1', '2')
1116
1123#define VIDEO_PIX_FMT_SRGGB12 VIDEO_FOURCC('R', 'G', '1', '2')
1124
1131#define VIDEO_PIX_FMT_SBGGR14 VIDEO_FOURCC('B', 'G', '1', '4')
1132
1139#define VIDEO_PIX_FMT_SGBRG14 VIDEO_FOURCC('G', 'B', '1', '4')
1140
1147#define VIDEO_PIX_FMT_SGRBG14 VIDEO_FOURCC('G', 'R', '1', '4')
1148
1155#define VIDEO_PIX_FMT_SRGGB14 VIDEO_FOURCC('R', 'G', '1', '4')
1156
1163#define VIDEO_PIX_FMT_SBGGR16 VIDEO_FOURCC('B', 'Y', 'R', '2')
1164
1171#define VIDEO_PIX_FMT_SGBRG16 VIDEO_FOURCC('G', 'B', '1', '6')
1172
1179#define VIDEO_PIX_FMT_SGRBG16 VIDEO_FOURCC('G', 'R', '1', '6')
1180
1187#define VIDEO_PIX_FMT_SRGGB16 VIDEO_FOURCC('R', 'G', '1', '6')
1188
1214#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y')
1215
1222#define VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P')
1223
1231#define VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P')
1232
1240#define VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P')
1241
1261#define VIDEO_PIX_FMT_RGB565X VIDEO_FOURCC('R', 'G', 'B', 'R')
1262
1272#define VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P')
1273
1281#define VIDEO_PIX_FMT_BGR24 VIDEO_FOURCC('B', 'G', 'R', '3')
1282
1290#define VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3')
1291
1298#define VIDEO_PIX_FMT_ARGB32 VIDEO_FOURCC('B', 'A', '2', '4')
1299
1306#define VIDEO_PIX_FMT_ABGR32 VIDEO_FOURCC('A', 'R', '2', '4')
1307
1314#define VIDEO_PIX_FMT_RGBA32 VIDEO_FOURCC('A', 'B', '2', '4')
1315
1322#define VIDEO_PIX_FMT_BGRA32 VIDEO_FOURCC('R', 'A', '2', '4')
1323
1331#define VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4')
1332
1351#define VIDEO_PIX_FMT_YUYV VIDEO_FOURCC('Y', 'U', 'Y', 'V')
1352
1358#define VIDEO_PIX_FMT_YVYU VIDEO_FOURCC('Y', 'V', 'Y', 'U')
1359
1365#define VIDEO_PIX_FMT_VYUY VIDEO_FOURCC('V', 'Y', 'U', 'Y')
1366
1372#define VIDEO_PIX_FMT_UYVY VIDEO_FOURCC('U', 'Y', 'V', 'Y')
1373
1381#define VIDEO_PIX_FMT_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V')
1382
1395#define VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G')
1396
1409static inline unsigned int video_bits_per_pixel(uint32_t pixfmt)
1410{
1411 switch (pixfmt) {
1416 case VIDEO_PIX_FMT_GREY:
1417 return 8;
1422 case VIDEO_PIX_FMT_Y10P:
1423 return 10;
1428 case VIDEO_PIX_FMT_Y12P:
1429 return 12;
1434 case VIDEO_PIX_FMT_Y14P:
1435 return 14;
1437 case VIDEO_PIX_FMT_YUYV:
1438 case VIDEO_PIX_FMT_YVYU:
1439 case VIDEO_PIX_FMT_UYVY:
1440 case VIDEO_PIX_FMT_VYUY:
1457 return 16;
1460 return 24;
1467 return 32;
1468 default:
1469 /* Variable number of bits per pixel or unknown format */
1470 return 0;
1471 }
1472}
1473
1483#define VIDEO_MIPI_CSI2_DT_NULL 0x10
1484#define VIDEO_MIPI_CSI2_DT_BLANKING 0x11
1485#define VIDEO_MIPI_CSI2_DT_EMBEDDED_8 0x12
1486#define VIDEO_MIPI_CSI2_DT_YUV420_8 0x18
1487#define VIDEO_MIPI_CSI2_DT_YUV420_10 0x19
1488#define VIDEO_MIPI_CSI2_DT_YUV420_CSPS_8 0x1c
1489#define VIDEO_MIPI_CSI2_DT_YUV420_CSPS_10 0x1d
1490#define VIDEO_MIPI_CSI2_DT_YUV422_8 0x1e
1491#define VIDEO_MIPI_CSI2_DT_YUV422_10 0x1f
1492#define VIDEO_MIPI_CSI2_DT_RGB444 0x20
1493#define VIDEO_MIPI_CSI2_DT_RGB555 0x21
1494#define VIDEO_MIPI_CSI2_DT_RGB565 0x22
1495#define VIDEO_MIPI_CSI2_DT_RGB666 0x23
1496#define VIDEO_MIPI_CSI2_DT_RGB888 0x24
1497#define VIDEO_MIPI_CSI2_DT_RAW6 0x28
1498#define VIDEO_MIPI_CSI2_DT_RAW7 0x29
1499#define VIDEO_MIPI_CSI2_DT_RAW8 0x2a
1500#define VIDEO_MIPI_CSI2_DT_RAW10 0x2b
1501#define VIDEO_MIPI_CSI2_DT_RAW12 0x2c
1502#define VIDEO_MIPI_CSI2_DT_RAW14 0x2d
1503
1504/* User-defined Data-Type range from 0x30 to 0x37 */
1505#define VIDEO_MIPI_CSI2_DT_USER(n) (0x30 + (n))
1506
1511#ifdef __cplusplus
1512}
1513#endif
1514
1519#endif /* ZEPHYR_INCLUDE_VIDEO_H_ */
#define NSEC_PER_SEC
number of nanoseconds per second
Definition sys_clock.h:113
#define EINVAL
Invalid argument.
Definition errno.h:60
#define ENOSYS
Function not implemented.
Definition errno.h:82
video_signal_result
video_event enum
Definition video.h:234
struct video_buffer * video_buffer_aligned_alloc(size_t size, size_t align, k_timeout_t timeout)
Allocate aligned video buffer.
int video_set_ctrl(const struct device *dev, struct video_control *control)
Set the value of a control.
int(* video_api_enqueue_t)(const struct device *dev, struct video_buffer *buf)
Enqueue a buffer in the driver’s incoming queue.
Definition video.h:270
int(* video_api_set_stream_t)(const struct device *dev, bool enable, enum video_buf_type type)
Start or stop streaming on the video device.
Definition video.h:302
void video_print_ctrl(const struct video_ctrl_query *const cq)
Print all the information of a control.
int(* video_api_get_caps_t)(const struct device *dev, struct video_caps *caps)
Get capabilities of a video endpoint.
Definition video.h:320
int64_t video_get_csi_link_freq(const struct device *dev, uint8_t bpp, uint8_t lane_nb)
Return the link-frequency advertised by a device.
static int video_dequeue(const struct device *dev, struct video_buffer **buf, k_timeout_t timeout)
Dequeue a video buffer.
Definition video.h:540
int(* video_api_dequeue_t)(const struct device *dev, struct video_buffer **buf, k_timeout_t timeout)
Dequeue a buffer from the driver’s outgoing queue.
Definition video.h:278
video_frmival_type
video_frmival_type enum
Definition video.h:174
static uint64_t video_frmival_nsec(const struct video_frmival *frmival)
Compute the difference between two frame intervals.
Definition video.h:805
int video_get_ctrl(const struct device *dev, struct video_control *control)
Get the current value of a control.
static int video_enum_frmival(const struct device *dev, struct video_frmival_enum *fie)
List video frame intervals.
Definition video.h:481
static int video_stream_start(const struct device *dev, enum video_buf_type type)
Start the video device function.
Definition video.h:598
int(* video_api_frmival_t)(const struct device *dev, struct video_frmival *frmival)
Function pointer type for video_set/get_frmival()
Definition video.h:254
int video_query_ctrl(struct video_ctrl_query *cq)
Query information about a control.
static int video_get_caps(const struct device *dev, struct video_caps *caps)
Get the capabilities of a video endpoint.
Definition video.h:650
int(* video_api_enum_frmival_t)(const struct device *dev, struct video_frmival_enum *fie)
List all supported frame intervals of a given format.
Definition video.h:262
int(* video_api_ctrl_t)(const struct device *dev, uint32_t cid)
Set/Get a video control value.
Definition video.h:312
static int video_flush(const struct device *dev, bool cancel)
Flush endpoint buffers.
Definition video.h:569
static int video_stream_stop(const struct device *dev, enum video_buf_type type)
Stop the video device function.
Definition video.h:624
int(* video_api_flush_t)(const struct device *dev, bool cancel)
Flush endpoint buffers, buffer are moved from incoming queue to outgoing queue.
Definition video.h:288
static int video_set_format(const struct device *dev, struct video_format *fmt)
Set video format.
Definition video.h:361
static int video_set_signal(const struct device *dev, struct k_poll_signal *sig)
Register/Unregister k_poll signal for a video endpoint.
Definition video.h:742
static int video_set_frmival(const struct device *dev, struct video_frmival *frmival)
Set video frame interval.
Definition video.h:417
static int video_enqueue(const struct device *dev, struct video_buffer *buf)
Enqueue a video buffer.
Definition video.h:510
void video_closest_frmival_stepwise(const struct video_frmival_stepwise *stepwise, const struct video_frmival *desired, struct video_frmival *match)
Find the closest match to a frame interval value within a stepwise frame interval.
void video_buffer_release(struct video_buffer *buf)
Release a video buffer.
int(* video_api_set_signal_t)(const struct device *dev, struct k_poll_signal *sig)
Register/Unregister poll signal for buffer events.
Definition video.h:328
video_buf_type
video_buf_type enum
Definition video.h:51
static int video_get_format(const struct device *dev, struct video_format *fmt)
Get video format.
Definition video.h:386
int video_format_caps_index(const struct video_format_cap *fmts, const struct video_format *fmt, size_t *idx)
Search for a format that matches in a list of capabilities.
int(* video_api_format_t)(const struct device *dev, struct video_format *fmt)
Function pointer type for video_set/get_format()
Definition video.h:246
struct video_buffer * video_buffer_alloc(size_t size, k_timeout_t timeout)
Allocate video buffer.
void video_closest_frmival(const struct device *dev, struct video_frmival_enum *match)
Find the closest match to a frame interval value within a video device.
static int video_get_frmival(const struct device *dev, struct video_frmival *frmival)
Get video frame interval.
Definition video.h:449
@ VIDEO_BUF_ABORTED
Definition video.h:236
@ VIDEO_BUF_DONE
Definition video.h:235
@ VIDEO_BUF_ERROR
Definition video.h:237
@ VIDEO_FRMIVAL_TYPE_DISCRETE
discrete frame interval type
Definition video.h:176
@ VIDEO_FRMIVAL_TYPE_STEPWISE
stepwise frame interval type
Definition video.h:178
@ VIDEO_BUF_TYPE_INPUT
input buffer type
Definition video.h:53
@ VIDEO_BUF_TYPE_OUTPUT
output buffer type
Definition video.h:55
#define VIDEO_PIX_FMT_SGRBG10
Definition video.h:1083
#define VIDEO_PIX_FMT_XYUV32
The first byte is empty (X) for each pixel.
Definition video.h:1381
#define VIDEO_PIX_FMT_SGRBG12P
Definition video.h:1014
#define VIDEO_PIX_FMT_RGB24
24 bit RGB format with 8 bit per component
Definition video.h:1290
#define VIDEO_PIX_FMT_SBGGR10
Definition video.h:1067
#define VIDEO_PIX_FMT_SGRBG8
Definition video.h:942
#define VIDEO_PIX_FMT_SRGGB10
Definition video.h:1091
#define VIDEO_PIX_FMT_Y12P
Definition video.h:1231
#define VIDEO_PIX_FMT_YVYU
Definition video.h:1358
#define VIDEO_PIX_FMT_SRGGB12P
Definition video.h:1023
#define VIDEO_PIX_FMT_SBGGR10P
Definition video.h:960
#define VIDEO_PIX_FMT_SBGGR14
Definition video.h:1131
#define VIDEO_PIX_FMT_SGRBG16
Definition video.h:1179
#define VIDEO_PIX_FMT_SRGGB16
Definition video.h:1187
#define VIDEO_PIX_FMT_Y10P
Definition video.h:1222
#define VIDEO_PIX_FMT_BGRA32
Definition video.h:1322
#define VIDEO_PIX_FMT_ARGB32
Definition video.h:1298
#define VIDEO_PIX_FMT_SRGGB10P
Definition video.h:987
#define VIDEO_PIX_FMT_VYUY
Definition video.h:1365
#define VIDEO_PIX_FMT_SRGGB14P
Definition video.h:1059
#define VIDEO_PIX_FMT_SGBRG14
Definition video.h:1139
#define VIDEO_PIX_FMT_SRGGB12
Definition video.h:1123
#define VIDEO_PIX_FMT_SGBRG16
Definition video.h:1171
#define VIDEO_PIX_FMT_SGBRG14P
Definition video.h:1041
#define VIDEO_PIX_FMT_XRGB32
The first byte is empty (X) for each pixel.
Definition video.h:1331
#define VIDEO_PIX_FMT_SGBRG10
Definition video.h:1075
#define VIDEO_PIX_FMT_RGBA32
Definition video.h:1314
#define VIDEO_PIX_FMT_SGRBG10P
Definition video.h:978
#define VIDEO_PIX_FMT_SBGGR12
Definition video.h:1099
#define VIDEO_PIX_FMT_GREY
Same as Y8 (8-bit luma-only) following the standard FOURCC naming, or L8 in some graphics libraries.
Definition video.h:1214
#define VIDEO_PIX_FMT_SGBRG12
Definition video.h:1107
#define VIDEO_PIX_FMT_SRGGB14
Definition video.h:1155
#define VIDEO_PIX_FMT_SGBRG8
Definition video.h:933
#define VIDEO_PIX_FMT_SBGGR12P
Definition video.h:996
#define VIDEO_PIX_FMT_SBGGR8
Definition video.h:924
static unsigned int video_bits_per_pixel(uint32_t pixfmt)
Get number of bits per pixel of a pixel format.
Definition video.h:1409
#define VIDEO_PIX_FMT_SRGGB8
Definition video.h:951
#define VIDEO_PIX_FMT_SBGGR14P
Definition video.h:1032
#define VIDEO_PIX_FMT_YUYV
There is either a missing channel per pixel, U or V.
Definition video.h:1351
#define VIDEO_PIX_FMT_SGBRG10P
Definition video.h:969
#define VIDEO_PIX_FMT_Y14P
Definition video.h:1240
#define VIDEO_PIX_FMT_UYVY
Definition video.h:1372
#define VIDEO_PIX_FMT_SGRBG14P
Definition video.h:1050
#define VIDEO_PIX_FMT_SBGGR16
Definition video.h:1163
#define VIDEO_PIX_FMT_SGBRG12P
Definition video.h:1005
#define VIDEO_PIX_FMT_RGB565
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0].
Definition video.h:1272
#define VIDEO_PIX_FMT_SGRBG12
Definition video.h:1115
#define VIDEO_PIX_FMT_BGR24
24 bit RGB format with 8 bit per component
Definition video.h:1281
#define VIDEO_PIX_FMT_SGRBG14
Definition video.h:1147
#define VIDEO_PIX_FMT_ABGR32
Definition video.h:1306
#define NULL
Definition iar_missing_defs.h:20
Public kernel APIs.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT64_TYPE__ int64_t
Definition stdint.h:75
__INT16_TYPE__ int16_t
Definition stdint.h:73
Runtime device structure (in ROM) per driver instance.
Definition device.h:510
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:516
Definition kernel.h:6068
Kernel timeout type.
Definition sys_clock.h:65
Video buffer structure.
Definition video.h:145
uint32_t bytesused
number of bytes occupied by the valid data in the buffer.
Definition video.h:155
uint32_t size
size of the buffer in bytes.
Definition video.h:153
enum video_buf_type type
type of the buffer
Definition video.h:147
uint8_t * buffer
pointer to the start of the buffer.
Definition video.h:151
void * driver_data
pointer to driver specific data.
Definition video.h:149
uint16_t line_offset
Line offset within frame this buffer represents, from the beginning of the frame.
Definition video.h:166
uint32_t timestamp
time reference in milliseconds at which the last data byte was actually received for input endpoints ...
Definition video.h:160
Video format capabilities.
Definition video.h:112
uint8_t min_vbuf_count
minimal count of video buffers to enqueue before being able to start the stream.
Definition video.h:120
enum video_buf_type type
type of the buffer
Definition video.h:114
int16_t min_line_count
Denotes minimum line count of a video buffer that this endpoint can fill or process.
Definition video.h:129
int16_t max_line_count
Denotes maximum line count of a video buffer that this endpoint can fill or process.
Definition video.h:136
const struct video_format_cap * format_caps
list of video format capabilities (zero terminated).
Definition video.h:116
Video control structure.
Definition video-controls.h:410
Definition video-controls.h:457
const struct device * dev
device being queried, application needs to set this field
Definition video-controls.h:459
Definition video.h:330
video_api_format_t set_format
Definition video.h:332
video_api_ctrl_t set_ctrl
Definition video.h:340
video_api_enqueue_t enqueue
Definition video.h:337
video_api_set_signal_t set_signal
Definition video.h:342
video_api_enum_frmival_t enum_frmival
Definition video.h:345
video_api_get_caps_t get_caps
Definition video.h:335
video_api_format_t get_format
Definition video.h:333
video_api_flush_t flush
Definition video.h:339
video_api_dequeue_t dequeue
Definition video.h:338
video_api_frmival_t get_frmival
Definition video.h:344
video_api_frmival_t set_frmival
Definition video.h:343
video_api_set_stream_t set_stream
Definition video.h:334
video_api_ctrl_t get_volatile_ctrl
Definition video.h:341
Video format capability.
Definition video.h:89
uint16_t height_step
height step size in pixels.
Definition video.h:103
uint32_t width_min
minimum supported frame width in pixels.
Definition video.h:93
uint32_t width_max
maximum supported frame width in pixels.
Definition video.h:95
uint16_t width_step
width step size in pixels.
Definition video.h:101
uint32_t height_max
maximum supported frame height in pixels.
Definition video.h:99
uint32_t height_min
minimum supported frame height in pixels.
Definition video.h:97
uint32_t pixelformat
FourCC pixel format value (Video pixel formats).
Definition video.h:91
Video format structure.
Definition video.h:64
uint32_t height
frame height in pixels.
Definition video.h:72
enum video_buf_type type
type of the buffer
Definition video.h:66
uint32_t width
frame width in pixels.
Definition video.h:70
uint32_t pitch
line stride.
Definition video.h:80
uint32_t pixelformat
FourCC pixel format value (Video pixel formats)
Definition video.h:68
Video frame interval enumeration structure.
Definition video.h:215
uint32_t index
frame interval index during enumeration
Definition video.h:217
const struct video_format * format
video format for which the query is made
Definition video.h:219
enum video_frmival_type type
frame interval type the device supports
Definition video.h:221
Video frame interval stepwise structure.
Definition video.h:200
struct video_frmival min
minimum frame interval in seconds
Definition video.h:202
struct video_frmival max
maximum frame interval in seconds
Definition video.h:204
struct video_frmival step
frame interval step size in seconds
Definition video.h:206
Video frame interval structure.
Definition video.h:187
uint32_t numerator
numerator of the frame interval
Definition video.h:189
uint32_t denominator
denominator of the frame interval
Definition video.h:191