Monado OpenXR Runtime
ipc_server_objects.h
Go to the documentation of this file.
1// Copyright 2025-2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Tracking objects to IDs.
6 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
7 * @ingroup ipc_server
8 */
9
10#pragma once
11
12#include "xrt/xrt_results.h"
13
14struct ipc_client_state;
15
16
17/*!
18 *
19 * Device functions.
20 *
21 */
22
23/*!
24 * Get a device by ID, must only be called from the per client
25 * thread as this function accesses the client state's memory.
26 *
27 * @param ics The client state instance.
28 * @param id The device ID.
29 * @param out_xdev Will be filled with the device object on success.
30 * @return XRT_SUCCESS on success, some other result on failure.
31 *
32 * @ingroup ipc_server
33 */
36 uint32_t id,
37 struct xrt_device **out_xdev);
38
39/*!
40 * Get a device ID for a given device object, must only be called from the per
41 * client thread as this function accesses the client state's memory.
42 *
43 * @param ics The client state instance.
44 * @param xdev The device object.
45 * @param out_id Will be filled with the device ID on success.
46 * @return XRT_SUCCESS on success, some other result on failure.
47 *
48 * @ingroup ipc_server
49 */
51ipc_server_objects_get_xdev_id_or_add(volatile struct ipc_client_state *ics, struct xrt_device *xdev, uint32_t *out_id);
52
53
54/*!
55 *
56 * Tracking origin functions.
57 *
58 */
59
60/*!
61 * Get a tracking origin by ID, must only be called from the per client
62 * thread as this function accesses the client state's memory.
63 *
64 * @param ics The client state instance.
65 * @param id The tracking origin ID.
66 * @param out_xtrack Will be filled with the tracking origin object on success.
67 * @return XRT_SUCCESS on success, some other result on failure.
68 *
69 * @ingroup ipc_server
70 */
73 uint32_t id,
74 struct xrt_tracking_origin **out_xtrack);
75
76/*!
77 * Get a tracking origin ID for a given tracking origin object, must only be
78 * called from the per client thread as this function accesses the client
79 * state's memory.
80 *
81 * @param ics The client state instance.
82 * @param xtrack The tracking origin object.
83 * @param out_id Will be filled with the tracking origin ID on success.
84 * @return XRT_SUCCESS on success, some other result on failure.
85 *
86 * @ingroup ipc_server
87 */
90 struct xrt_tracking_origin *xtrack,
91 uint32_t *out_id);
xrt_result_t ipc_server_objects_get_xdev_and_validate(volatile struct ipc_client_state *ics, uint32_t id, struct xrt_device **out_xdev)
Device functions.
Definition: ipc_server_objects.c:28
xrt_result_t ipc_server_objects_get_xdev_id_or_add(volatile struct ipc_client_state *ics, struct xrt_device *xdev, uint32_t *out_id)
Get a device ID for a given device object, must only be called from the per client thread as this fun...
Definition: ipc_server_objects.c:49
xrt_result_t ipc_server_objects_get_xtrack_and_validate(volatile struct ipc_client_state *ics, uint32_t id, struct xrt_tracking_origin **out_xtrack)
Tracking origin functions.
Definition: ipc_server_objects.c:93
xrt_result_t ipc_server_objects_get_xtrack_id_or_add(volatile struct ipc_client_state *ics, struct xrt_tracking_origin *xtrack, uint32_t *out_id)
Get a tracking origin ID for a given tracking origin object, must only be called from the per client ...
Definition: ipc_server_objects.c:114
enum xrt_result xrt_result_t
Result type used across Monado.
Holds the state for a single client.
Definition: ipc_server.h:94
A single HMD or input device.
Definition: xrt_device.h:310
A tracking system or device origin.
Definition: xrt_tracking.h:75
Internal result type for XRT.