Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
718int video_query_ctrl(const struct device *dev, struct video_ctrl_query *cq);
719
730void video_print_ctrl(const struct device *const dev, const struct video_ctrl_query *const cq);
731
744static inline int video_set_signal(const struct device *dev, struct k_poll_signal *sig)
745{
746 const struct video_driver_api *api;
747
748 __ASSERT_NO_MSG(dev != NULL);
749 __ASSERT_NO_MSG(sig != NULL);
750
751 api = (const struct video_driver_api *)dev->api;
752 if (api->set_signal == NULL) {
753 return -ENOSYS;
754 }
755
756 return api->set_signal(dev, sig);
757}
758
768struct video_buffer *video_buffer_aligned_alloc(size_t size, size_t align, k_timeout_t timeout);
769
779
786
797int video_format_caps_index(const struct video_format_cap *fmts, const struct video_format *fmt,
798 size_t *idx);
799
807static inline uint64_t video_frmival_nsec(const struct video_frmival *frmival)
808{
809 __ASSERT_NO_MSG(frmival != NULL);
810 __ASSERT_NO_MSG(frmival->denominator != 0);
811
812 return (uint64_t)NSEC_PER_SEC * frmival->numerator / frmival->denominator;
813}
814
823 const struct video_frmival *desired,
824 struct video_frmival *match);
825
843void video_closest_frmival(const struct device *dev, struct video_frmival_enum *match);
844
860int64_t video_get_csi_link_freq(const struct device *dev, uint8_t bpp, uint8_t lane_nb);
861
873#define VIDEO_FOURCC(a, b, c, d) \
874 ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
875
885#define VIDEO_FOURCC_FROM_STR(str) VIDEO_FOURCC((str)[0], (str)[1], (str)[2], (str)[3])
886
896#define VIDEO_FOURCC_TO_STR(fourcc) \
897 ((char[]){ \
898 (char)((fourcc) & 0xFF), \
899 (char)(((fourcc) >> 8) & 0xFF), \
900 (char)(((fourcc) >> 16) & 0xFF), \
901 (char)(((fourcc) >> 24) & 0xFF), \
902 '\0' \
903 })
904
926#define VIDEO_PIX_FMT_SBGGR8 VIDEO_FOURCC('B', 'A', '8', '1')
927
935#define VIDEO_PIX_FMT_SGBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G')
936
944#define VIDEO_PIX_FMT_SGRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G')
945
953#define VIDEO_PIX_FMT_SRGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B')
954
962#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A')
963
971#define VIDEO_PIX_FMT_SGBRG10P VIDEO_FOURCC('p', 'G', 'A', 'A')
972
980#define VIDEO_PIX_FMT_SGRBG10P VIDEO_FOURCC('p', 'g', 'A', 'A')
981
989#define VIDEO_PIX_FMT_SRGGB10P VIDEO_FOURCC('p', 'R', 'A', 'A')
990
998#define VIDEO_PIX_FMT_SBGGR12P VIDEO_FOURCC('p', 'B', 'C', 'C')
999
1007#define VIDEO_PIX_FMT_SGBRG12P VIDEO_FOURCC('p', 'G', 'C', 'C')
1008
1016#define VIDEO_PIX_FMT_SGRBG12P VIDEO_FOURCC('p', 'g', 'C', 'C')
1017
1025#define VIDEO_PIX_FMT_SRGGB12P VIDEO_FOURCC('p', 'R', 'C', 'C')
1026
1034#define VIDEO_PIX_FMT_SBGGR14P VIDEO_FOURCC('p', 'B', 'E', 'E')
1035
1043#define VIDEO_PIX_FMT_SGBRG14P VIDEO_FOURCC('p', 'G', 'E', 'E')
1044
1052#define VIDEO_PIX_FMT_SGRBG14P VIDEO_FOURCC('p', 'g', 'E', 'E')
1053
1061#define VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E')
1062
1069#define VIDEO_PIX_FMT_SBGGR10 VIDEO_FOURCC('B', 'G', '1', '0')
1070
1077#define VIDEO_PIX_FMT_SGBRG10 VIDEO_FOURCC('G', 'B', '1', '0')
1078
1085#define VIDEO_PIX_FMT_SGRBG10 VIDEO_FOURCC('B', 'A', '1', '0')
1086
1093#define VIDEO_PIX_FMT_SRGGB10 VIDEO_FOURCC('R', 'G', '1', '0')
1094
1101#define VIDEO_PIX_FMT_SBGGR12 VIDEO_FOURCC('B', 'G', '1', '2')
1102
1109#define VIDEO_PIX_FMT_SGBRG12 VIDEO_FOURCC('G', 'B', '1', '2')
1110
1117#define VIDEO_PIX_FMT_SGRBG12 VIDEO_FOURCC('B', 'A', '1', '2')
1118
1125#define VIDEO_PIX_FMT_SRGGB12 VIDEO_FOURCC('R', 'G', '1', '2')
1126
1133#define VIDEO_PIX_FMT_SBGGR14 VIDEO_FOURCC('B', 'G', '1', '4')
1134
1141#define VIDEO_PIX_FMT_SGBRG14 VIDEO_FOURCC('G', 'B', '1', '4')
1142
1149#define VIDEO_PIX_FMT_SGRBG14 VIDEO_FOURCC('G', 'R', '1', '4')
1150
1157#define VIDEO_PIX_FMT_SRGGB14 VIDEO_FOURCC('R', 'G', '1', '4')
1158
1165#define VIDEO_PIX_FMT_SBGGR16 VIDEO_FOURCC('B', 'Y', 'R', '2')
1166
1173#define VIDEO_PIX_FMT_SGBRG16 VIDEO_FOURCC('G', 'B', '1', '6')
1174
1181#define VIDEO_PIX_FMT_SGRBG16 VIDEO_FOURCC('G', 'R', '1', '6')
1182
1189#define VIDEO_PIX_FMT_SRGGB16 VIDEO_FOURCC('R', 'G', '1', '6')
1190
1216#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y')
1217
1224#define VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P')
1225
1233#define VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P')
1234
1242#define VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P')
1243
1263#define VIDEO_PIX_FMT_RGB565X VIDEO_FOURCC('R', 'G', 'B', 'R')
1264
1274#define VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P')
1275
1283#define VIDEO_PIX_FMT_BGR24 VIDEO_FOURCC('B', 'G', 'R', '3')
1284
1292#define VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3')
1293
1300#define VIDEO_PIX_FMT_ARGB32 VIDEO_FOURCC('B', 'A', '2', '4')
1301
1308#define VIDEO_PIX_FMT_ABGR32 VIDEO_FOURCC('A', 'R', '2', '4')
1309
1316#define VIDEO_PIX_FMT_RGBA32 VIDEO_FOURCC('A', 'B', '2', '4')
1317
1324#define VIDEO_PIX_FMT_BGRA32 VIDEO_FOURCC('R', 'A', '2', '4')
1325
1333#define VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4')
1334
1353#define VIDEO_PIX_FMT_YUYV VIDEO_FOURCC('Y', 'U', 'Y', 'V')
1354
1360#define VIDEO_PIX_FMT_YVYU VIDEO_FOURCC('Y', 'V', 'Y', 'U')
1361
1367#define VIDEO_PIX_FMT_VYUY VIDEO_FOURCC('V', 'Y', 'U', 'Y')
1368
1374#define VIDEO_PIX_FMT_UYVY VIDEO_FOURCC('U', 'Y', 'V', 'Y')
1375
1383#define VIDEO_PIX_FMT_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V')
1384
1397#define VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G')
1398
1411static inline unsigned int video_bits_per_pixel(uint32_t pixfmt)
1412{
1413 switch (pixfmt) {
1418 case VIDEO_PIX_FMT_GREY:
1419 return 8;
1424 case VIDEO_PIX_FMT_Y10P:
1425 return 10;
1430 case VIDEO_PIX_FMT_Y12P:
1431 return 12;
1436 case VIDEO_PIX_FMT_Y14P:
1437 return 14;
1439 case VIDEO_PIX_FMT_YUYV:
1440 case VIDEO_PIX_FMT_YVYU:
1441 case VIDEO_PIX_FMT_UYVY:
1442 case VIDEO_PIX_FMT_VYUY:
1459 return 16;
1462 return 24;
1469 return 32;
1470 default:
1471 /* Variable number of bits per pixel or unknown format */
1472 return 0;
1473 }
1474}
1475
1485#define VIDEO_MIPI_CSI2_DT_NULL 0x10
1486#define VIDEO_MIPI_CSI2_DT_BLANKING 0x11
1487#define VIDEO_MIPI_CSI2_DT_EMBEDDED_8 0x12
1488#define VIDEO_MIPI_CSI2_DT_YUV420_8 0x18
1489#define VIDEO_MIPI_CSI2_DT_YUV420_10 0x19
1490#define VIDEO_MIPI_CSI2_DT_YUV420_CSPS_8 0x1c
1491#define VIDEO_MIPI_CSI2_DT_YUV420_CSPS_10 0x1d
1492#define VIDEO_MIPI_CSI2_DT_YUV422_8 0x1e
1493#define VIDEO_MIPI_CSI2_DT_YUV422_10 0x1f
1494#define VIDEO_MIPI_CSI2_DT_RGB444 0x20
1495#define VIDEO_MIPI_CSI2_DT_RGB555 0x21
1496#define VIDEO_MIPI_CSI2_DT_RGB565 0x22
1497#define VIDEO_MIPI_CSI2_DT_RGB666 0x23
1498#define VIDEO_MIPI_CSI2_DT_RGB888 0x24
1499#define VIDEO_MIPI_CSI2_DT_RAW6 0x28
1500#define VIDEO_MIPI_CSI2_DT_RAW7 0x29
1501#define VIDEO_MIPI_CSI2_DT_RAW8 0x2a
1502#define VIDEO_MIPI_CSI2_DT_RAW10 0x2b
1503#define VIDEO_MIPI_CSI2_DT_RAW12 0x2c
1504#define VIDEO_MIPI_CSI2_DT_RAW14 0x2d
1505
1506/* User-defined Data-Type range from 0x30 to 0x37 */
1507#define VIDEO_MIPI_CSI2_DT_USER(n) (0x30 + (n))
1508
1513#ifdef __cplusplus
1514}
1515#endif
1516
1521#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
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_get_caps_t)(const struct device *dev, struct video_caps *caps)
Get capabilities of a video endpoint.
Definition video.h:320
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.
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.
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
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_ctrl_t)(const struct device *dev, uint32_t cid)
Set/Get a video control value.
Definition video.h:312
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:807
void video_print_ctrl(const struct device *const dev, const struct video_ctrl_query *const cq)
Print all the information of a control.
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_query_ctrl(const struct device *dev, 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_format_t)(const struct device *dev, struct video_format *fmt)
Function pointer type for video_set/get_format()
Definition video.h:246
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_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
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:744
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
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_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.
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_api_set_signal_t)(const struct device *dev, struct k_poll_signal *sig)
Register/Unregister poll signal for buffer events.
Definition video.h:328
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_enqueue_t)(const struct device *dev, struct video_buffer *buf)
Enqueue a buffer in the driver’s incoming queue.
Definition video.h:270
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
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
@ 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:1085
#define VIDEO_PIX_FMT_XYUV32
The first byte is empty (X) for each pixel.
Definition video.h:1383
#define VIDEO_PIX_FMT_SGRBG12P
Definition video.h:1016
#define VIDEO_PIX_FMT_RGB24
24 bit RGB format with 8 bit per component
Definition video.h:1292
#define VIDEO_PIX_FMT_SBGGR10
Definition video.h:1069
#define VIDEO_PIX_FMT_SGRBG8
Definition video.h:944
#define VIDEO_PIX_FMT_SRGGB10
Definition video.h:1093
#define VIDEO_PIX_FMT_Y12P
Definition video.h:1233
#define VIDEO_PIX_FMT_YVYU
Definition video.h:1360
#define VIDEO_PIX_FMT_SRGGB12P
Definition video.h:1025
#define VIDEO_PIX_FMT_SBGGR10P
Definition video.h:962
#define VIDEO_PIX_FMT_SBGGR14
Definition video.h:1133
#define VIDEO_PIX_FMT_SGRBG16
Definition video.h:1181
#define VIDEO_PIX_FMT_SRGGB16
Definition video.h:1189
#define VIDEO_PIX_FMT_Y10P
Definition video.h:1224
#define VIDEO_PIX_FMT_BGRA32
Definition video.h:1324
#define VIDEO_PIX_FMT_ARGB32
Definition video.h:1300
#define VIDEO_PIX_FMT_SRGGB10P
Definition video.h:989
#define VIDEO_PIX_FMT_VYUY
Definition video.h:1367
#define VIDEO_PIX_FMT_SRGGB14P
Definition video.h:1061
#define VIDEO_PIX_FMT_SGBRG14
Definition video.h:1141
#define VIDEO_PIX_FMT_SRGGB12
Definition video.h:1125
#define VIDEO_PIX_FMT_SGBRG16
Definition video.h:1173
#define VIDEO_PIX_FMT_SGBRG14P
Definition video.h:1043
#define VIDEO_PIX_FMT_XRGB32
The first byte is empty (X) for each pixel.
Definition video.h:1333
#define VIDEO_PIX_FMT_SGBRG10
Definition video.h:1077
#define VIDEO_PIX_FMT_RGBA32
Definition video.h:1316
#define VIDEO_PIX_FMT_SGRBG10P
Definition video.h:980
#define VIDEO_PIX_FMT_SBGGR12
Definition video.h:1101
#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:1216
#define VIDEO_PIX_FMT_SGBRG12
Definition video.h:1109
#define VIDEO_PIX_FMT_SRGGB14
Definition video.h:1157
#define VIDEO_PIX_FMT_SGBRG8
Definition video.h:935
#define VIDEO_PIX_FMT_SBGGR12P
Definition video.h:998
#define VIDEO_PIX_FMT_SBGGR8
Definition video.h:926
static unsigned int video_bits_per_pixel(uint32_t pixfmt)
Get number of bits per pixel of a pixel format.
Definition video.h:1411
#define VIDEO_PIX_FMT_SRGGB8
Definition video.h:953
#define VIDEO_PIX_FMT_SBGGR14P
Definition video.h:1034
#define VIDEO_PIX_FMT_YUYV
There is either a missing channel per pixel, U or V.
Definition video.h:1353
#define VIDEO_PIX_FMT_SGBRG10P
Definition video.h:971
#define VIDEO_PIX_FMT_Y14P
Definition video.h:1242
#define VIDEO_PIX_FMT_UYVY
Definition video.h:1374
#define VIDEO_PIX_FMT_SGRBG14P
Definition video.h:1052
#define VIDEO_PIX_FMT_SBGGR16
Definition video.h:1165
#define VIDEO_PIX_FMT_SGBRG12P
Definition video.h:1007
#define VIDEO_PIX_FMT_RGB565
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0].
Definition video.h:1274
#define VIDEO_PIX_FMT_SGRBG12
Definition video.h:1117
#define VIDEO_PIX_FMT_BGR24
24 bit RGB format with 8 bit per component
Definition video.h:1283
#define VIDEO_PIX_FMT_SGRBG14
Definition video.h:1149
#define VIDEO_PIX_FMT_ABGR32
Definition video.h:1308
#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
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