Monado OpenXR Runtime
v4l2_interface.h
Go to the documentation of this file.
1// Copyright 2019-2022, 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
16extern "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 * @extends xrt_fs_mode
32 */
34{
35 struct xrt_fs_mode base;
36
37 char format_name[32];
38
39 struct
40 {
41 uint32_t width;
42 uint32_t height;
43 uint32_t format;
44 uint8_t extended_format;
45
46 size_t size;
47 size_t stride;
48 } stream;
49
50 /*!
51 * Offset from start off frame to start of pixels.
52 *
53 * Also known as crop_scanline_bytes_start.
54 *
55 * Special case for ps4 camera
56 */
57 size_t offset;
58 uint32_t rate;
59};
60
61
62
63/*!
64 * Create a v4l2 frameserver
65 *
66 * @ingroup drv_v4l2
67 */
68struct xrt_fs *
70 const char *path,
71 const char *product,
72 const char *manufacturer,
73 const char *serial);
74
75
76#ifdef __cplusplus
77}
78#endif
struct xrt_fs * v4l2_fs_create(struct xrt_frame_context *xfctx, const char *path, const char *product, const char *manufacturer, const char *serial)
Create a v4l2 frameserver.
Definition: v4l2_driver.c:669
Descriptor of a v4l2 source.
Definition: v4l2_interface.h:34
size_t offset
Offset from start off frame to start of pixels.
Definition: v4l2_interface.h:57
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
Definition: xrt_frameserver.h:44
Frameserver that generates frames.
Definition: xrt_frameserver.h:70
char product[32]
Frame server product identifier, matches the prober device.
Definition: xrt_frameserver.h:74
char serial[32]
Frame server serial number, matches the prober device.
Definition: xrt_frameserver.h:78
char manufacturer[32]
Frame server manufacturer, matches the prober device.
Definition: xrt_frameserver.h:76
Frameserver interface for video drivers.