Monado OpenXR Runtime
v4l2_interface.h
Go to the documentation of this file.
1 // Copyright 2019, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief Header
6  * @author Pete Black <pblack@collabora.com>
7  * @author Jakob Bornecrantz <jakob@collabora.com>
8  * @ingroup drv_v4l2
9  */
10 
11 #pragma once
12 
13 #include "xrt/xrt_frameserver.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /*!
20  * @defgroup drv_v4l2 V4L2 frameserver driver
21  * @ingroup drv
22  *
23  * @brief Frameserver using the Video 4 Linux 2 framework.
24  */
25 
26 
27 /*!
28  * Descriptor of a v4l2 source.
29  *
30  * @ingroup drv_v4l2
31  */
33 {
34  struct xrt_fs_mode base;
35 
36  char format_name[32];
37 
38  struct
39  {
40  uint32_t width;
41  uint32_t height;
42  uint32_t format;
43  uint8_t extended_format;
44 
45  size_t size;
46  size_t stride;
47  } stream;
48 
49  /*!
50  * Offset from start off frame to start of pixels.
51  *
52  * Aka crop_scanline_bytes_start.
53  *
54  * Special case for ps4 camera
55  */
56  size_t offset;
57  uint32_t rate;
58 };
59 
60 /*!
61  * Create a v4l2 frameserver
62  *
63  * @ingroup drv_v4l2
64  */
65 struct xrt_fs *
66 v4l2_fs_create(struct xrt_frame_context *xfctx, const char *path);
67 
68 
69 #ifdef __cplusplus
70 }
71 #endif
Frameserver interface for video drivers.
size_t offset
Offset from start off frame to start of pixels.
Definition: v4l2_interface.h:56
Definition: xrt_frameserver.h:37
struct xrt_fs * v4l2_fs_create(struct xrt_frame_context *xfctx, const char *path)
Create a v4l2 frameserver.
Definition: v4l2_driver.c:729
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:87
Descriptor of a v4l2 source.
Definition: v4l2_interface.h:32
Frameserver that generates frame, multiple subframes (like stereo and mipmaps) can be generate in one...
Definition: xrt_frameserver.h:51