Monado OpenXR Runtime
ipc_client_xdev.h
Go to the documentation of this file.
1// Copyright 2020-2023, Collabora, Ltd.
2// Copyright 2025, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Shared functions for IPC client @ref xrt_device.
7 * @author Pete Black <pblack@collabora.com>
8 * @author Jakob Bornecrantz <jakob@collabora.com>
9 * @author Jakob Bornecrantz <tbornecrantz@nvidia.com>
10 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
11 * @ingroup ipc_client
12 */
13
14#pragma once
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21struct ipc_connection;
22
23/*!
24 * An IPC client proxy for an @ref xrt_device.
25 *
26 * @implements xrt_device
27 * @ingroup ipc_client
28 */
30{
31 struct xrt_device base;
32
33 struct ipc_connection *ipc_c;
34
35 uint32_t device_id;
36};
37
38/*!
39 * Convenience helper to go from a xdev to @ref ipc_client_xdev.
40 *
41 * @ingroup ipc_client
42 */
43static inline struct ipc_client_xdev *
45{
46 return (struct ipc_client_xdev *)xdev;
47}
48
49/*!
50 * Initializes a ipc_client_xdev so that it's basically fully usable as a
51 * @ref xrt_device object. Does not fill in the destroy function or the any
52 * if the HMD components / functions.
53 *
54 * @ingroup ipc_client
55 * @public @memberof ipc_client_xdev
56 */
57void
59 struct ipc_connection *ipc_c,
60 struct xrt_tracking_origin *xtrack,
61 uint32_t device_id);
62
63/*!
64 * Frees any memory that was allocated as part of init and resets some pointers.
65 *
66 * @ingroup ipc_client
67 * @public @memberof ipc_client_xdev
68 */
69void
71
72
73#ifdef __cplusplus
74}
75#endif
void ipc_client_xdev_fini(struct ipc_client_xdev *icx)
Frees any memory that was allocated as part of init and resets some pointers.
Definition: ipc_client_xdev.c:438
void ipc_client_xdev_init(struct ipc_client_xdev *icx, struct ipc_connection *ipc_c, struct xrt_tracking_origin *xtrack, uint32_t device_id)
Initializes a ipc_client_xdev so that it's basically fully usable as a xrt_device object.
Definition: ipc_client_xdev.c:354
static struct ipc_client_xdev * ipc_client_xdev(struct xrt_device *xdev)
Convenience helper to go from a xdev to ipc_client_xdev.
Definition: ipc_client_xdev.h:44
An IPC client proxy for an xrt_device.
Definition: ipc_client_xdev.h:30
Connection.
Definition: ipc_client.h:59
A single HMD or input device.
Definition: xrt_device.h:281
A tracking system or device origin.
Definition: xrt_tracking.h:71