Monado OpenXR Runtime
Loading...
Searching...
No Matches
rift_sensor_internal.h
Go to the documentation of this file.
1// Copyright 2025-2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Internal structures for Oculus Rift sensor probing/initialization
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup drv_rift_sensor
8 */
9
10#include "xrt/xrt_frame.h"
11
12#include "os/os_threading.h"
13
15
16#include <libusb.h>
17
18
20{
21 struct xrt_frame_node node;
22
23 enum u_logging_level log_level;
24
25 struct libusb_context *usb_ctx;
26
27 struct rift_sensor *sensors;
28 uint32_t sensor_count;
29
30 struct os_thread_helper usb_thread;
31};
32
34{
35 enum rift_variant variant;
36 struct xrt_fs *frame_server;
37 struct t_camera_calibration calibration;
38 struct libusb_device_handle *hid_dev;
39 bool usb2;
40
41 time_duration_ns frame_interval;
42};
43
44#define SIZE_ASSERT(type, size) \
45 static_assert(sizeof(type) == (size), "Size of " #type " is not " #size " bytes as was expected")
46
47#pragma pack(push, 1)
48
50{
51 uint8_t unk1[18]; // 00
52 __lef64 fx; // 18
53 uint8_t unk2[4]; // 26
54 __lef64 fy; // 30
55 uint8_t unk3[4]; // 38
56 __lef64 cx; // 42
57 uint8_t unk4[4]; // 50
58 __lef64 cy; // 54
59 uint8_t unk5[4]; // 62
60 __lef64 k1; // 66
61 uint8_t unk6[4]; // 74
62 __lef64 k2; // 78
63 uint8_t unk7[4]; // 86
64 __lef64 p1; // 90
65 uint8_t unk8[4]; // 98
66 __lef64 p2; // 102
67 uint8_t unk9[4]; // 110
68 __lef64 k3; // 114
69 uint8_t pad[6]; // 122
70};
71SIZE_ASSERT(struct rift_sensor_dk2_calib, 128);
72
74{
75 uint8_t unk1[0x30]; // 0x00
76 __lef32 fxy; // 0x30
77 __lef32 cx; // 0x34
78 __lef32 cy; // 0x38
79 uint8_t unk2[0xC]; // 0x3c
80 __lef32 k1; // 0x48
81 __lef32 k2; // 0x4c
82 __lef32 k3; // 0x50
83 __lef32 k4; // 0x54
84 uint8_t pad[128 - 0x58]; // 0x58
85};
86SIZE_ASSERT(struct rift_sensor_cv1_calib, 128);
87
88#pragma pack(pop)
89
90static struct rift_sensor_context *
92{
93 return container_of(node, struct rift_sensor_context, node);
94}
u_logging_level
Logging level enum.
Definition u_logging.h:45
int64_t time_duration_ns
Integer duration type in nanoseconds.
Definition u_time.h:88
#define container_of(ptr, type, field)
Get the holder from a pointer to a field.
Definition xrt_compiler.h:226
Wrapper around OS threading native functions.
Interface to Oculus Rift sensor probing/initialization.
Little endian 32-bit float wrapper struct.
Definition xrt_byte_order.h:73
Little endian 64-bit float wrapper struct.
Definition xrt_byte_order.h:142
All in one helper that handles locking, waiting for change and starting a thread.
Definition os_threading.h:499
Definition rift_sensor_internal.h:20
Definition rift_sensor_internal.h:74
Definition rift_sensor_internal.h:50
Definition rift_sensor_internal.h:34
Essential calibration data for a single camera, or single lens/sensor of a stereo camera.
Definition t_tracking.h:236
A interface object used for destroying a frame graph.
Definition xrt_frame.h:87
Frameserver that generates frames.
Definition xrt_frameserver.h:70
Data frame header.