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_set_format_t)(const struct device *dev, struct video_format *fmt);
247
254typedef int (*video_api_get_format_t)(const struct device *dev, struct video_format *fmt);
255
262typedef int (*video_api_set_frmival_t)(const struct device *dev, struct video_frmival *frmival);
263
270typedef int (*video_api_get_frmival_t)(const struct device *dev, struct video_frmival *frmival);
271
278typedef int (*video_api_enum_frmival_t)(const struct device *dev, struct video_frmival_enum *fie);
279
286typedef int (*video_api_enqueue_t)(const struct device *dev, struct video_buffer *buf);
287
294typedef int (*video_api_dequeue_t)(const struct device *dev, struct video_buffer **buf,
295 k_timeout_t timeout);
296
304typedef int (*video_api_flush_t)(const struct device *dev, bool cancel);
305
318typedef int (*video_api_set_stream_t)(const struct device *dev, bool enable,
319 enum video_buf_type type);
320
328typedef int (*video_api_ctrl_t)(const struct device *dev, uint32_t cid);
329
336typedef int (*video_api_get_caps_t)(const struct device *dev, struct video_caps *caps);
337
344typedef int (*video_api_set_signal_t)(const struct device *dev, struct k_poll_signal *sig);
345
363
377static inline int video_set_format(const struct device *dev, struct video_format *fmt)
378{
379 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
380
381 if (api->set_format == NULL) {
382 return -ENOSYS;
383 }
384
385 return api->set_format(dev, fmt);
386}
387
398static inline int video_get_format(const struct device *dev, struct video_format *fmt)
399{
400 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
401
402 if (api->get_format == NULL) {
403 return -ENOSYS;
404 }
405
406 return api->get_format(dev, fmt);
407}
408
425static inline int video_set_frmival(const struct device *dev, struct video_frmival *frmival)
426{
427 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
428
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 = (const struct video_driver_api *)dev->api;
452
453 if (api->get_frmival == NULL) {
454 return -ENOSYS;
455 }
456
457 return api->get_frmival(dev, frmival);
458}
459
477static inline int video_enum_frmival(const struct device *dev, struct video_frmival_enum *fie)
478{
479 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
480
481 if (api->enum_frmival == NULL) {
482 return -ENOSYS;
483 }
484
485 return api->enum_frmival(dev, fie);
486}
487
501static inline int video_enqueue(const struct device *dev, struct video_buffer *buf)
502{
503 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
504
505 if (api->enqueue == NULL) {
506 return -ENOSYS;
507 }
508
509 return api->enqueue(dev, buf);
510}
511
526static inline int video_dequeue(const struct device *dev, struct video_buffer **buf,
527 k_timeout_t timeout)
528{
529 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
530
531 if (api->dequeue == NULL) {
532 return -ENOSYS;
533 }
534
535 return api->dequeue(dev, buf, timeout);
536}
537
551static inline int video_flush(const struct device *dev, bool cancel)
552{
553 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
554
555 if (api->flush == NULL) {
556 return -ENOSYS;
557 }
558
559 return api->flush(dev, cancel);
560}
561
577static inline int video_stream_start(const struct device *dev, enum video_buf_type type)
578{
579 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
580
581 if (api->set_stream == NULL) {
582 return -ENOSYS;
583 }
584
585 return api->set_stream(dev, true, type);
586}
587
600static inline int video_stream_stop(const struct device *dev, enum video_buf_type type)
601{
602 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
603 int ret;
604
605 if (api->set_stream == NULL) {
606 return -ENOSYS;
607 }
608
609 ret = api->set_stream(dev, false, type);
610 video_flush(dev, true);
611
612 return ret;
613}
614
623static inline int video_get_caps(const struct device *dev, struct video_caps *caps)
624{
625 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
626
627 if (api->get_caps == NULL) {
628 return -ENOSYS;
629 }
630
631 return api->get_caps(dev, caps);
632}
633
648int video_set_ctrl(const struct device *dev, struct video_control *control);
649
664int video_get_ctrl(const struct device *dev, struct video_control *control);
665
666struct video_ctrl_query;
667
687int video_query_ctrl(const struct device *dev, struct video_ctrl_query *cq);
688
699void video_print_ctrl(const struct device *const dev, const struct video_ctrl_query *const cq);
700
713static inline int video_set_signal(const struct device *dev, struct k_poll_signal *sig)
714{
715 const struct video_driver_api *api = (const struct video_driver_api *)dev->api;
716
717 if (api->set_signal == NULL) {
718 return -ENOSYS;
719 }
720
721 return api->set_signal(dev, sig);
722}
723
733struct video_buffer *video_buffer_aligned_alloc(size_t size, size_t align, k_timeout_t timeout);
734
744
751
762int video_format_caps_index(const struct video_format_cap *fmts, const struct video_format *fmt,
763 size_t *idx);
764
772static inline uint64_t video_frmival_nsec(const struct video_frmival *frmival)
773{
774 return (uint64_t)NSEC_PER_SEC * frmival->numerator / frmival->denominator;
775}
776
785 const struct video_frmival *desired,
786 struct video_frmival *match);
787
805void video_closest_frmival(const struct device *dev, struct video_frmival_enum *match);
806
818#define VIDEO_FOURCC(a, b, c, d) \
819 ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
820
830#define VIDEO_FOURCC_FROM_STR(str) VIDEO_FOURCC((str)[0], (str)[1], (str)[2], (str)[3])
831
841#define VIDEO_FOURCC_TO_STR(fourcc) \
842 ((char[]){ \
843 (char)((fourcc) & 0xFF), \
844 (char)(((fourcc) >> 8) & 0xFF), \
845 (char)(((fourcc) >> 16) & 0xFF), \
846 (char)(((fourcc) >> 24) & 0xFF), \
847 '\0' \
848 })
849
871#define VIDEO_PIX_FMT_SBGGR8 VIDEO_FOURCC('B', 'A', '8', '1')
872
880#define VIDEO_PIX_FMT_SGBRG8 VIDEO_FOURCC('G', 'B', 'R', 'G')
881
889#define VIDEO_PIX_FMT_SGRBG8 VIDEO_FOURCC('G', 'R', 'B', 'G')
890
898#define VIDEO_PIX_FMT_SRGGB8 VIDEO_FOURCC('R', 'G', 'G', 'B')
899
907#define VIDEO_PIX_FMT_SBGGR10P VIDEO_FOURCC('p', 'B', 'A', 'A')
908
916#define VIDEO_PIX_FMT_SGBRG10P VIDEO_FOURCC('p', 'G', 'A', 'A')
917
925#define VIDEO_PIX_FMT_SGRBG10P VIDEO_FOURCC('p', 'g', 'A', 'A')
926
934#define VIDEO_PIX_FMT_SRGGB10P VIDEO_FOURCC('p', 'R', 'A', 'A')
935
943#define VIDEO_PIX_FMT_SBGGR12P VIDEO_FOURCC('p', 'B', 'C', 'C')
944
952#define VIDEO_PIX_FMT_SGBRG12P VIDEO_FOURCC('p', 'G', 'C', 'C')
953
961#define VIDEO_PIX_FMT_SGRBG12P VIDEO_FOURCC('p', 'g', 'C', 'C')
962
970#define VIDEO_PIX_FMT_SRGGB12P VIDEO_FOURCC('p', 'R', 'C', 'C')
971
979#define VIDEO_PIX_FMT_SBGGR14P VIDEO_FOURCC('p', 'B', 'E', 'E')
980
988#define VIDEO_PIX_FMT_SGBRG14P VIDEO_FOURCC('p', 'G', 'E', 'E')
989
997#define VIDEO_PIX_FMT_SGRBG14P VIDEO_FOURCC('p', 'g', 'E', 'E')
998
1006#define VIDEO_PIX_FMT_SRGGB14P VIDEO_FOURCC('p', 'R', 'E', 'E')
1007
1014#define VIDEO_PIX_FMT_SBGGR10 VIDEO_FOURCC('B', 'G', '1', '0')
1015
1022#define VIDEO_PIX_FMT_SGBRG10 VIDEO_FOURCC('G', 'B', '1', '0')
1023
1030#define VIDEO_PIX_FMT_SGRBG10 VIDEO_FOURCC('B', 'A', '1', '0')
1031
1038#define VIDEO_PIX_FMT_SRGGB10 VIDEO_FOURCC('R', 'G', '1', '0')
1039
1046#define VIDEO_PIX_FMT_SBGGR12 VIDEO_FOURCC('B', 'G', '1', '2')
1047
1054#define VIDEO_PIX_FMT_SGBRG12 VIDEO_FOURCC('G', 'B', '1', '2')
1055
1062#define VIDEO_PIX_FMT_SGRBG12 VIDEO_FOURCC('B', 'A', '1', '2')
1063
1070#define VIDEO_PIX_FMT_SRGGB12 VIDEO_FOURCC('R', 'G', '1', '2')
1071
1078#define VIDEO_PIX_FMT_SBGGR14 VIDEO_FOURCC('B', 'G', '1', '4')
1079
1086#define VIDEO_PIX_FMT_SGBRG14 VIDEO_FOURCC('G', 'B', '1', '4')
1087
1094#define VIDEO_PIX_FMT_SGRBG14 VIDEO_FOURCC('G', 'R', '1', '4')
1095
1102#define VIDEO_PIX_FMT_SRGGB14 VIDEO_FOURCC('R', 'G', '1', '4')
1103
1110#define VIDEO_PIX_FMT_SBGGR16 VIDEO_FOURCC('B', 'Y', 'R', '2')
1111
1118#define VIDEO_PIX_FMT_SGBRG16 VIDEO_FOURCC('G', 'B', '1', '6')
1119
1126#define VIDEO_PIX_FMT_SGRBG16 VIDEO_FOURCC('G', 'R', '1', '6')
1127
1134#define VIDEO_PIX_FMT_SRGGB16 VIDEO_FOURCC('R', 'G', '1', '6')
1135
1161#define VIDEO_PIX_FMT_GREY VIDEO_FOURCC('G', 'R', 'E', 'Y')
1162
1169#define VIDEO_PIX_FMT_Y10P VIDEO_FOURCC('Y', '1', '0', 'P')
1170
1178#define VIDEO_PIX_FMT_Y12P VIDEO_FOURCC('Y', '1', '2', 'P')
1179
1187#define VIDEO_PIX_FMT_Y14P VIDEO_FOURCC('Y', '1', '4', 'P')
1188
1208#define VIDEO_PIX_FMT_RGB565X VIDEO_FOURCC('R', 'G', 'B', 'R')
1209
1219#define VIDEO_PIX_FMT_RGB565 VIDEO_FOURCC('R', 'G', 'B', 'P')
1220
1228#define VIDEO_PIX_FMT_BGR24 VIDEO_FOURCC('B', 'G', 'R', '3')
1229
1237#define VIDEO_PIX_FMT_RGB24 VIDEO_FOURCC('R', 'G', 'B', '3')
1238
1245#define VIDEO_PIX_FMT_ARGB32 VIDEO_FOURCC('B', 'A', '2', '4')
1246
1253#define VIDEO_PIX_FMT_ABGR32 VIDEO_FOURCC('A', 'R', '2', '4')
1254
1261#define VIDEO_PIX_FMT_RGBA32 VIDEO_FOURCC('A', 'B', '2', '4')
1262
1269#define VIDEO_PIX_FMT_BGRA32 VIDEO_FOURCC('R', 'A', '2', '4')
1270
1278#define VIDEO_PIX_FMT_XRGB32 VIDEO_FOURCC('B', 'X', '2', '4')
1279
1298#define VIDEO_PIX_FMT_YUYV VIDEO_FOURCC('Y', 'U', 'Y', 'V')
1299
1305#define VIDEO_PIX_FMT_YVYU VIDEO_FOURCC('Y', 'V', 'Y', 'U')
1306
1312#define VIDEO_PIX_FMT_VYUY VIDEO_FOURCC('V', 'Y', 'U', 'Y')
1313
1319#define VIDEO_PIX_FMT_UYVY VIDEO_FOURCC('U', 'Y', 'V', 'Y')
1320
1328#define VIDEO_PIX_FMT_XYUV32 VIDEO_FOURCC('X', 'Y', 'U', 'V')
1329
1342#define VIDEO_PIX_FMT_JPEG VIDEO_FOURCC('J', 'P', 'E', 'G')
1343
1356static inline unsigned int video_bits_per_pixel(uint32_t pixfmt)
1357{
1358 switch (pixfmt) {
1363 case VIDEO_PIX_FMT_GREY:
1364 return 8;
1369 case VIDEO_PIX_FMT_Y10P:
1370 return 10;
1375 case VIDEO_PIX_FMT_Y12P:
1376 return 12;
1381 case VIDEO_PIX_FMT_Y14P:
1382 return 14;
1384 case VIDEO_PIX_FMT_YUYV:
1385 case VIDEO_PIX_FMT_YVYU:
1386 case VIDEO_PIX_FMT_UYVY:
1387 case VIDEO_PIX_FMT_VYUY:
1404 return 16;
1407 return 24;
1414 return 32;
1415 default:
1416 /* Variable number of bits per pixel or unknown format */
1417 return 0;
1418 }
1419}
1420
1425#ifdef __cplusplus
1426}
1427#endif
1428
1433#endif /* ZEPHYR_INCLUDE_VIDEO_H_ */
#define NSEC_PER_SEC
number of nanoseconds per second
Definition sys_clock.h:113
#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:286
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:318
int(* video_api_get_caps_t)(const struct device *dev, struct video_caps *caps)
Get capabilities of a video endpoint.
Definition video.h:336
static int video_dequeue(const struct device *dev, struct video_buffer **buf, k_timeout_t timeout)
Dequeue a video buffer.
Definition video.h:526
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:294
int(* video_api_get_frmival_t)(const struct device *dev, struct video_frmival *frmival)
Get current video frame interval.
Definition video.h:270
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:772
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.
int(* video_api_set_frmival_t)(const struct device *dev, struct video_frmival *frmival)
Set video frame interval.
Definition video.h:262
static int video_enum_frmival(const struct device *dev, struct video_frmival_enum *fie)
List video frame intervals.
Definition video.h:477
static int video_stream_start(const struct device *dev, enum video_buf_type type)
Start the video device function.
Definition video.h:577
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:623
int(* video_api_get_format_t)(const struct device *dev, struct video_format *fmt)
Get current video format.
Definition video.h:254
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:278
int(* video_api_set_format_t)(const struct device *dev, struct video_format *fmt)
Set video format.
Definition video.h:246
int(* video_api_ctrl_t)(const struct device *dev, uint32_t cid)
Set/Get a video control value.
Definition video.h:328
static int video_flush(const struct device *dev, bool cancel)
Flush endpoint buffers.
Definition video.h:551
static int video_stream_stop(const struct device *dev, enum video_buf_type type)
Stop the video device function.
Definition video.h:600
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:304
static int video_set_format(const struct device *dev, struct video_format *fmt)
Set video format.
Definition video.h:377
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:713
static int video_set_frmival(const struct device *dev, struct video_frmival *frmival)
Set video frame interval.
Definition video.h:425
static int video_enqueue(const struct device *dev, struct video_buffer *buf)
Enqueue a video buffer.
Definition video.h:501
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:344
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:398
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.
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:1030
#define VIDEO_PIX_FMT_XYUV32
The first byte is empty (X) for each pixel.
Definition video.h:1328
#define VIDEO_PIX_FMT_SGRBG12P
Definition video.h:961
#define VIDEO_PIX_FMT_RGB24
24 bit RGB format with 8 bit per component
Definition video.h:1237
#define VIDEO_PIX_FMT_SBGGR10
Definition video.h:1014
#define VIDEO_PIX_FMT_SGRBG8
Definition video.h:889
#define VIDEO_PIX_FMT_SRGGB10
Definition video.h:1038
#define VIDEO_PIX_FMT_Y12P
Definition video.h:1178
#define VIDEO_PIX_FMT_YVYU
Definition video.h:1305
#define VIDEO_PIX_FMT_SRGGB12P
Definition video.h:970
#define VIDEO_PIX_FMT_SBGGR10P
Definition video.h:907
#define VIDEO_PIX_FMT_SBGGR14
Definition video.h:1078
#define VIDEO_PIX_FMT_SGRBG16
Definition video.h:1126
#define VIDEO_PIX_FMT_SRGGB16
Definition video.h:1134
#define VIDEO_PIX_FMT_Y10P
Definition video.h:1169
#define VIDEO_PIX_FMT_BGRA32
Definition video.h:1269
#define VIDEO_PIX_FMT_ARGB32
Definition video.h:1245
#define VIDEO_PIX_FMT_SRGGB10P
Definition video.h:934
#define VIDEO_PIX_FMT_VYUY
Definition video.h:1312
#define VIDEO_PIX_FMT_SRGGB14P
Definition video.h:1006
#define VIDEO_PIX_FMT_SGBRG14
Definition video.h:1086
#define VIDEO_PIX_FMT_SRGGB12
Definition video.h:1070
#define VIDEO_PIX_FMT_SGBRG16
Definition video.h:1118
#define VIDEO_PIX_FMT_SGBRG14P
Definition video.h:988
#define VIDEO_PIX_FMT_XRGB32
The first byte is empty (X) for each pixel.
Definition video.h:1278
#define VIDEO_PIX_FMT_SGBRG10
Definition video.h:1022
#define VIDEO_PIX_FMT_RGBA32
Definition video.h:1261
#define VIDEO_PIX_FMT_SGRBG10P
Definition video.h:925
#define VIDEO_PIX_FMT_SBGGR12
Definition video.h:1046
#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:1161
#define VIDEO_PIX_FMT_SGBRG12
Definition video.h:1054
#define VIDEO_PIX_FMT_SRGGB14
Definition video.h:1102
#define VIDEO_PIX_FMT_SGBRG8
Definition video.h:880
#define VIDEO_PIX_FMT_SBGGR12P
Definition video.h:943
#define VIDEO_PIX_FMT_SBGGR8
Definition video.h:871
static unsigned int video_bits_per_pixel(uint32_t pixfmt)
Get number of bits per pixel of a pixel format.
Definition video.h:1356
#define VIDEO_PIX_FMT_SRGGB8
Definition video.h:898
#define VIDEO_PIX_FMT_SBGGR14P
Definition video.h:979
#define VIDEO_PIX_FMT_YUYV
There is either a missing channel per pixel, U or V.
Definition video.h:1298
#define VIDEO_PIX_FMT_SGBRG10P
Definition video.h:916
#define VIDEO_PIX_FMT_Y14P
Definition video.h:1187
#define VIDEO_PIX_FMT_UYVY
Definition video.h:1319
#define VIDEO_PIX_FMT_SGRBG14P
Definition video.h:997
#define VIDEO_PIX_FMT_SBGGR16
Definition video.h:1110
#define VIDEO_PIX_FMT_SGBRG12P
Definition video.h:952
#define VIDEO_PIX_FMT_RGB565
5 red bits [15:11], 6 green bits [10:5], 5 blue bits [4:0].
Definition video.h:1219
#define VIDEO_PIX_FMT_SGRBG12
Definition video.h:1062
#define VIDEO_PIX_FMT_BGR24
24 bit RGB format with 8 bit per component
Definition video.h:1228
#define VIDEO_PIX_FMT_SGRBG14
Definition video.h:1094
#define VIDEO_PIX_FMT_ABGR32
Definition video.h:1253
#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
__INT16_TYPE__ int16_t
Definition stdint.h:73
Runtime device structure (in ROM) per driver instance.
Definition device.h:504
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:510
Definition kernel.h:6014
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:407
Definition video-controls.h:454
Definition video.h:346
video_api_ctrl_t set_ctrl
Definition video.h:356
video_api_enqueue_t enqueue
Definition video.h:353
video_api_set_signal_t set_signal
Definition video.h:358
video_api_get_format_t get_format
Definition video.h:349
video_api_enum_frmival_t enum_frmival
Definition video.h:361
video_api_get_caps_t get_caps
Definition video.h:351
video_api_set_format_t set_format
Definition video.h:348
video_api_flush_t flush
Definition video.h:355
video_api_dequeue_t dequeue
Definition video.h:354
video_api_get_frmival_t get_frmival
Definition video.h:360
video_api_set_stream_t set_stream
Definition video.h:350
video_api_set_frmival_t set_frmival
Definition video.h:359
video_api_ctrl_t get_volatile_ctrl
Definition video.h:357
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