Monado OpenXR Runtime
Loading...
Searching...
No Matches
xrt_device.h
Go to the documentation of this file.
1// Copyright 2019-2024, Collabora, Ltd.
2// Copyright 2024-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Header defining an xrt display or controller device.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Moshi Turner <moshiturner@protonmail.com>
9 * @author Korcan Hussein <korcan.hussein@collabora.com>
10 * @ingroup xrt_iface
11 */
12
13#pragma once
14
15#include "xrt/xrt_defines.h"
18#include "xrt/xrt_limits.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct xrt_tracking;
25
26#define XRT_DEVICE_NAME_LEN 256
27
28
29/*!
30 * A per-lens/display view information.
31 *
32 * @ingroup xrt_iface
33 */
35{
36 /*!
37 * @brief Viewport position on the screen.
38 *
39 * In absolute screen coordinates on an unrotated display, like the
40 * HMD presents it to the OS.
41 *
42 * This field is only used by @ref comp to setup the device rendering.
43 *
44 * If the view is being rotated by xrt_view.rot 90° right in the
45 * distortion shader then `display.w_pixels == viewport.h_pixels` and
46 * `display.h_pixels == viewport.w_pixels`.
47 */
48 struct
49 {
50 uint32_t x_pixels;
51 uint32_t y_pixels;
52 uint32_t w_pixels;
53 uint32_t h_pixels;
55
56 /*!
57 * @brief Physical properties of this display (or the part of a display
58 * that covers this view).
59 *
60 * Not in absolute screen coordinates but like the clients see them i.e.
61 * after rotation is applied by xrt_view::rot.
62 * This field is only used for the clients' swapchain setup.
63 *
64 * The xrt_view::display::w_pixels and xrt_view::display::h_pixels
65 * become the recommended image size for this view, after being scaled
66 * by the debug environment variable `XRT_COMPOSITOR_SCALE_PERCENTAGE`.
67 */
68 struct
69 {
70 uint32_t w_pixels;
71 uint32_t h_pixels;
73
74 /*!
75 * @brief Rotation 2d matrix used to rotate the position of the output
76 * of the distortion shaders onto the screen.
77 *
78 * If the distortion shader is based on a mesh, then this matrix rotates
79 * the vertex positions.
80 */
82};
83
84/*!
85 * @brief Compositor information for a device.
86 */
88{
89 //! The direction scanout on the display occurs.
91 /*!
92 * The amount of time it takes to scanout the display in nanoseconds, from the start of the scanout, to the end
93 * of the scanout.
94 *
95 * @note alignas for 32 bit client support, see @ref ipc-design
96 */
97 XRT_ALIGNAS(8) int64_t scanout_time_ns;
98};
99
100/*!
101 * @brief Compositor mode information for a device.
102 */
104{
105 //! The amount of nanoseconds between frames.
107};
108
109/*!
110 * All of the device components that deals with interfacing to a users head.
111 *
112 * HMD is probably a bad name for the future but for now will have to do.
113 *
114 * @ingroup xrt_iface
115 */
117{
118 /*!
119 * @brief The hmd screen as an unrotated display, like the HMD presents
120 * it to the OS.
121 *
122 * This field is used by @ref comp to setup the extended mode window.
123 */
124 struct
125 {
126 int w_pixels;
127 int h_pixels;
128 //! Nominal frame interval
130 } screens[1];
131
132 /*!
133 * Display information.
134 *
135 * For now hardcoded display to two.
136 */
137 struct xrt_view views[XRT_MAX_VIEWS];
138
139 size_t view_count;
140 /*!
141 * Array of supported blend modes.
142 */
143 enum xrt_blend_mode blend_modes[XRT_MAX_DEVICE_BLEND_MODES];
144 size_t blend_mode_count;
145
146 /*!
147 * Distortion information.
148 */
149 struct
150 {
151 //! Supported distortion models, a bitfield.
153 //! Preferred disortion model, single value.
155
156 struct
157 {
158 //! Data.
159 float *vertices;
160 //! Number of vertices.
161 uint32_t vertex_count;
162 //! Stride of vertices
163 uint32_t stride;
164 //! 1 or 3 for (chromatic aberration).
166
167 //! Indices, for triangle strip.
169 //! Number of indices for the triangle strips (one per view).
170 uint32_t index_counts[XRT_MAX_VIEWS];
171 //! Offsets for the indices (one offset per view).
172 uint32_t index_offsets[XRT_MAX_VIEWS];
173 //! Total number of elements in mesh::indices array.
175 } mesh;
176
177 //! distortion is subject to the field of view
178 struct xrt_fov fov[XRT_MAX_VIEWS];
179 } distortion;
180};
181
182/*!
183 * A single named input, that sits on a @ref xrt_device.
184 *
185 * @ingroup xrt_iface
186 */
188{
189 //! Is this input active.
190 bool active;
191
192 //! alignas for 32 bit client support, see @ref ipc-design
193 XRT_ALIGNAS(8) int64_t timestamp;
194
195 enum xrt_input_name name;
196
197 union xrt_input_value value;
198};
199
200/*!
201 * A single named output, that sits on a @ref xrt_device.
202 *
203 * @ingroup xrt_iface
204 */
206{
207 enum xrt_output_name name;
208};
209
210
211/*!
212 * A binding pair, going @p from a binding point to a @p device input.
213 *
214 * @ingroup xrt_iface
215 */
217{
218 enum xrt_input_name from; //!< From which name.
219 enum xrt_input_name device; //!< To input on the device.
220};
221
222/*!
223 * A binding pair, going @p from a binding point to a @p device output.
224 *
225 * @ingroup xrt_iface
226 */
228{
229 enum xrt_output_name from; //!< From which name.
230 enum xrt_output_name device; //!< To output on the device.
231};
232
233/*!
234 * A binding profile, has lists of binding pairs to goes from device in @p name
235 * to the device it hangs off on.
236 *
237 * @ingroup xrt_iface
238 */
240{
241 //! Device this binding emulates.
243
244 struct xrt_binding_input_pair *inputs;
245 size_t input_count;
246 struct xrt_binding_output_pair *outputs;
247 size_t output_count;
248};
249
250/*!
251 * Higher level features for devices.
252 */
254{
255 XRT_DEVICE_FEATURE_HAND_TRACKING_LEFT = 0,
256 XRT_DEVICE_FEATURE_HAND_TRACKING_RIGHT,
257 XRT_DEVICE_FEATURE_EYE_TRACKING,
258 XRT_DEVICE_FEATURE_FACE_TRACKING,
259 XRT_DEVICE_FEATURE_MAX_ENUM,
260};
261
262/*!
263 * Output limits of a particular device
264 */
266{
267 //! The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
269};
270
271/*!
272 * Static data of supported features of the @ref xrt_device this struct sits on.
273 *
274 * This struct needs to always be a piece of data as it sits inside of the
275 * shared memory area in the IPC layer, so no pointers please.
276 *
277 * @ingroup xrt_iface
278 */
280{
281 bool orientation_tracking;
282 bool position_tracking;
283 bool hand_tracking;
284 bool eye_gaze;
285 bool presence;
286 bool force_feedback;
287 bool ref_space_usage;
288 bool form_factor_check;
289 bool stage;
290 bool face_tracking;
291 bool face_tracking_calibration_state;
292 bool body_tracking;
293 bool body_tracking_calibration;
294 bool battery_status;
295 bool brightness_control;
296 bool compositor_info;
297
298 bool planes;
299 enum xrt_plane_detection_capability_flags_ext plane_capability_flags;
300};
301
302/*!
303 * @interface xrt_device
304 *
305 * A single HMD or input device.
306 *
307 * @ingroup xrt_iface
308 */
310{
311 //! Enum identifier of the device.
313 enum xrt_device_type device_type;
314
315 //! A string describing the device.
316 char str[XRT_DEVICE_NAME_LEN];
317
318 //! A unique identifier. Persistent across configurations, if possible.
319 char serial[XRT_DEVICE_NAME_LEN];
320
321 //! Null if this device does not interface with the users head.
323
324 //! Always set, pointing to the tracking system for this device.
326
327 //! Number of bindings in xrt_device::binding_profiles
329 // Array of alternative binding profiles.
330 struct xrt_binding_profile *binding_profiles;
331
332 //! Number of inputs.
334 //! Array of input structs.
336
337 //! Number of outputs.
339 //! Array of output structs.
341
342 //! What features/functions/things does this device supports?
343 struct xrt_device_supported supported;
344
345
346 /*
347 *
348 * Functions.
349 *
350 */
351
352 /*!
353 * Update any attached inputs.
354 *
355 * @param[in] xdev The device.
356 */
357 xrt_result_t (*update_inputs)(struct xrt_device *xdev);
358
359 /*!
360 * @brief Get relationship of a tracked device to the tracking origin
361 * space as the base space.
362 *
363 * It is the responsibility of the device driver to do any prediction,
364 * there are helper functions available for this.
365 *
366 * The timestamps are system monotonic timestamps, such as returned by
367 * os_monotonic_get_ns().
368 *
369 * @param[in] xdev The device.
370 * @param[in] name Some devices may have multiple poses on
371 * them, select the one using this field. For
372 * HMDs use @p XRT_INPUT_GENERIC_HEAD_POSE.
373 * For Unbounded Reference Space you can use
374 * @p XRT_INPUT_GENERIC_UNBOUNDED_SPACE_POSE
375 * to get the origin of that space.
376 * @param[in] at_timestamp_ns If the device can predict or has a history
377 * of positions, this is when the caller
378 * wants the pose to be from.
379 * @param[out] out_relation The relation read from the device.
380 *
381 * @see xrt_input_name
382 */
383 xrt_result_t (*get_tracked_pose)(struct xrt_device *xdev,
384 enum xrt_input_name name,
385 int64_t at_timestamp_ns,
386 struct xrt_space_relation *out_relation);
387
388 /*!
389 * @brief Get relationship of hand joints to the tracking origin space as
390 * the base space.
391 *
392 * It is the responsibility of the device driver to either do prediction
393 * or return joints from a previous time and write that time out to
394 * @p out_timestamp_ns.
395 *
396 * The timestamps are system monotonic timestamps, such as returned by
397 * os_monotonic_get_ns().
398 *
399 * @param[in] xdev The device.
400 * @param[in] name Some devices may have multiple poses on
401 * them, select the one using this field. For
402 * hand tracking use @p XRT_INPUT_GENERIC_HAND_TRACKING_DEFAULT_SET.
403 * @param[in] desired_timestamp_ns If the device can predict or has a history
404 * of positions, this is when the caller
405 * wants the pose to be from.
406 * @param[out] out_value The hand joint data read from the device.
407 * @param[out] out_timestamp_ns The timestamp of the data being returned.
408 *
409 * @see xrt_input_name
410 */
411 xrt_result_t (*get_hand_tracking)(struct xrt_device *xdev,
412 enum xrt_input_name name,
413 int64_t desired_timestamp_ns,
414 struct xrt_hand_joint_set *out_value,
415 int64_t *out_timestamp_ns);
416
417 /*!
418 * @brief Get the requested blend shape properties & weights for a face tracker
419 *
420 * @param[in] xdev The device.
421 * @param[in] facial_expression_type The facial expression data type (XR_FB_face_tracking,
422 * XR_HTC_facial_tracking, etc).
423 * @param[in] at_timestamp_ns Timestamp to be optionally used for prediction/history. For OXR extensions
424 * that do not pass a timestamp, the current timestamp is used.
425 * @param[in] out_value Set of requested expression weights & blend shape properties.
426 *
427 * @see xrt_input_name
428 */
429 xrt_result_t (*get_face_tracking)(struct xrt_device *xdev,
430 enum xrt_input_name facial_expression_type,
431 int64_t at_timestamp_ns,
432 struct xrt_facial_expression_set *out_value);
433
434 /*!
435 * @brief Gets the face tracking calibration state
436 *
437 * @param[in] xdev The device.
438 * @param[in] out_face_is_calibrated Is face tracking calibrated?
439 *
440 * @see xrt_input_name
441 */
442 xrt_result_t (*get_face_calibration_state_android)(struct xrt_device *xdev, bool *out_face_is_calibrated);
443
444 /*!
445 * @brief Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc
446 *
447 * @param[in] xdev The device.
448 * @param[in] body_tracking_type The body joint set type (XR_FB_body_tracking,
449 * XR_META_body_tracking_full_body, etc).
450 * @param[in] out_value The body skeleton hierarchy/properties.
451 *
452 * @see xrt_input_name
453 */
454 xrt_result_t (*get_body_skeleton)(struct xrt_device *xdev,
455 enum xrt_input_name body_tracking_type,
456 struct xrt_body_skeleton *out_value);
457
458 /*!
459 * @brief Get the joint locations for a body tracker
460 *
461 * @param[in] xdev The device.
462 * @param[in] body_tracking_type The body joint set type (XR_FB_body_tracking,
463 * XR_META_body_tracking_full_body, etc).
464 * @param[in] desired_timestamp_ns If the device can predict or has a history
465 * of locations, this is when the caller
466 * @param[in] out_value Set of body joint locations & properties.
467 *
468 * @see xrt_input_name
469 */
470 xrt_result_t (*get_body_joints)(struct xrt_device *xdev,
471 enum xrt_input_name body_tracking_type,
472 int64_t desired_timestamp_ns,
473 struct xrt_body_joint_set *out_value);
474
475 /*!
476 * @brief XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration
477 *
478 * @param[in] xdev The body tracking device.
479 */
480 xrt_result_t (*reset_body_tracking_calibration_meta)(struct xrt_device *xdev);
481
482 /*!
483 * @brief XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration
484 * override
485 *
486 * @param[in] xdev The body tracking device.
487 * @param[in] new_body_height The suggested new body height to override.
488 */
489 xrt_result_t (*set_body_tracking_calibration_override_meta)(struct xrt_device *xdev, float new_body_height);
490
491 /*!
492 * Set a output value.
493 *
494 * @param[in] xdev The device.
495 * @param[in] name The output component name to set.
496 * @param[in] value The value to set the output to.
497 * @see xrt_output_name
498 */
499 xrt_result_t (*set_output)(struct xrt_device *xdev,
500 enum xrt_output_name name,
501 const struct xrt_output_value *value);
502
503 /*!
504 * Gets limits of this devices outputs.
505 *
506 * @param[in] xdev The device.
507 * @param[out] limits The returned limits.
508 */
509 xrt_result_t (*get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits);
510
511 /*!
512 * @brief Get current presence status of the device.
513 *
514 * @param[in] xdev The device.
515 * @param[out] presence The returned presence status.
516 */
517 xrt_result_t (*get_presence)(struct xrt_device *xdev, bool *presence);
518
519 /*!
520 * Begin a plane detection request
521 *
522 * @param[in] xdev The device.
523 * @param[in] begin_info The query specifying what type of planes are requested.
524 * @param[in] plane_detection_id The id for a previous plane detection request to be replaced or 0.
525 * @param[out] out_plane_detection_id The id of the new plane detection request generated by the xdev.
526 * @return generally XRT_SUCCESS, except for internal runtime failures.
527 */
528 xrt_result_t (*begin_plane_detection_ext)(struct xrt_device *xdev,
529 const struct xrt_plane_detector_begin_info_ext *begin_info,
530 uint64_t plane_detection_id,
531 uint64_t *out_plane_detection_id);
532
533 /*!
534 * Destroy internal resources associated with plane_detector_id.
535 *
536 * @param[in] xdev The device.
537 * @param[in] plane_detection_id An id generated by the xdev.
538 * @return generally XRT_SUCCESS, except for internal runtime failures.
539 */
540 xrt_result_t (*destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id);
541
542 /*!
543 * Get the state of a plane detection request.
544 *
545 * @param[in] xdev The device.
546 * @param[in] plane_detector_id An id generated by the xdev.
547 * @param[out] out_state The state of the plane detection.
548 * @return generally XRT_SUCCESS, except for internal runtime failures.
549 */
550 xrt_result_t (*get_plane_detection_state_ext)(struct xrt_device *xdev,
551 uint64_t plane_detection_id,
552 enum xrt_plane_detector_state_ext *out_state);
553
554 /*!
555 * Get results of a plane detection request.
556 *
557 * @param[in] xdev The device.
558 * @param[in] plane_detector_id An id generated by the xdev.
559 * @param[out] detections The detected planes, if any.
560 * @return generally XRT_SUCCESS, except for internal runtime failures.
561 */
562 xrt_result_t (*get_plane_detections_ext)(struct xrt_device *xdev,
563 uint64_t plane_detection_id,
564 struct xrt_plane_detections_ext *out_detections);
565
566 /*!
567 * @brief Get the per-view pose in relation to the view space.
568 *
569 * On most devices with coplanar displays and no built-in eye tracking
570 * or IPD sensing, this just calls a helper to process the provided
571 * eye relation, but this may also handle canted displays as well as
572 * eye tracking.
573 *
574 * Incorporates a call to xrt_device::get_tracked_pose or a wrapper for it
575 *
576 * @param[in] xdev The device.
577 * @param[in] default_eye_relation
578 * The interpupillary relation as a 3D position.
579 * Most simple stereo devices would just want to
580 * set `out_pose->position.[x|y|z] = ipd.[x|y|z]
581 * / 2.0f` and adjust for left vs right view.
582 * Not to be confused with IPD that is absolute
583 * distance, this is a full 3D translation
584 * If a device has a more accurate/dynamic way of
585 * knowing the eye relation, it may ignore this
586 * input.
587 * @param[in] at_timestamp_ns This is when the caller wants the poses and FOVs to be from.
588 * @param[in] view_count Number of views.
589 * @param[in] view_type Type of view configuration (mono or stereo).
590 * @param[out] out_head_relation
591 * The head pose in the device tracking space.
592 * Combine with @p out_poses to get the views in
593 * device tracking space.
594 * @param[out] out_fovs An array (of size @p view_count ) to populate
595 * with the device-suggested fields of view.
596 * @param[out] out_poses An array (of size @p view_count ) to populate
597 * with view output poses in head space. When
598 * implementing, be sure to also set orientation:
599 * most likely identity orientation unless you
600 * have canted screens.
601 * (Caution: Even if you have eye tracking, you
602 * won't use eye orientation here!)
603 */
604 xrt_result_t (*get_view_poses)(struct xrt_device *xdev,
605 const struct xrt_vec3 *default_eye_relation,
606 int64_t at_timestamp_ns,
607 enum xrt_view_type view_type,
608 uint32_t view_count,
609 struct xrt_space_relation *out_head_relation,
610 struct xrt_fov *out_fovs,
611 struct xrt_pose *out_poses);
612
613 /**
614 * Compute the distortion at a single point.
615 *
616 * The input is @p u @p v in screen/output space (that is, predistorted), you are to compute and return the u,v
617 * coordinates to sample the render texture. The compositor will step through a range of u,v parameters to build
618 * the lookup (vertex attribute or distortion texture) used to pre-distort the image as required by the device's
619 * optics.
620 *
621 * @param xdev the device
622 * @param view the view index
623 * @param u horizontal texture coordinate
624 * @param v vertical texture coordinate
625 * @param[out] out_result corresponding u,v pairs for all three color channels.
626 */
627 xrt_result_t (*compute_distortion)(
628 struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result);
629
630 /*!
631 * Get the visibility mask for this device.
632 *
633 * @param[in] xdev The device.
634 * @param[in] type The type of visibility mask.
635 * @param[in] view_index The index of the view to get the mask for.
636 * @param[out] out_mask Output mask, caller must free.
637 */
638 xrt_result_t (*get_visibility_mask)(struct xrt_device *xdev,
639 enum xrt_visibility_mask_type type,
640 uint32_t view_index,
641 struct xrt_visibility_mask **out_mask);
642
643 /*!
644 * Called by the @ref xrt_space_overseer when a reference space that is
645 * implemented by this device is first used, or when the last usage of
646 * the reference space stops.
647 *
648 * What is provided is both the @ref xrt_reference_space_type that
649 * triggered the usage change and the @ref xrt_input_name (if any) that
650 * is used to drive the space.
651 *
652 * @see xrt_space_overseer_ref_space_inc
653 * @see xrt_space_overseer_ref_space_dec
654 * @see xrt_input_name
655 * @see xrt_reference_space_type
656 */
657 xrt_result_t (*ref_space_usage)(struct xrt_device *xdev,
658 enum xrt_reference_space_type type,
659 enum xrt_input_name name,
660 bool used);
661
662 /*!
663 * @brief Check if given form factor is available or not.
664 *
665 * This should only be used in HMD device, if the device driver supports form factor check.
666 *
667 * @param[in] xdev The device.
668 * @param[in] form_factor Form factor to check.
669 * @param[out] out_available true if given form factor is available; otherwise false.
670 */
671 xrt_result_t (*is_form_factor_available)(struct xrt_device *xdev,
672 enum xrt_form_factor form_factor,
673 bool *out_available);
674
675 /*!
676 * @brief Get battery status information.
677 *
678 * @param[in] xdev The device.
679 * @param[out] out_present Whether battery status information exist for this device.
680 * @param[out] out_charging Whether the device's battery is being charged.
681 * @param[out] out_charge Battery charge as a value between 0 and 1.
682 */
683 xrt_result_t (*get_battery_status)(struct xrt_device *xdev,
684 bool *out_present,
685 bool *out_charging,
686 float *out_charge);
687
688 /*!
689 * @brief Get the current display brightness.
690 *
691 * @param[in] xdev The device.
692 * @param[out] out_brightness Current display brightness. Usually between 0 and 1. Some devices may
693 * exceed 1 if the supported range exceeds 100%
694 */
695 xrt_result_t (*get_brightness)(struct xrt_device *xdev, float *out_brightness);
696
697 /*!
698 * @brief Set the display brightness.
699 *
700 * @param[in] xdev The device.
701 * @param[in] brightness Desired display brightness. Usually between 0 and 1. Some devices may
702 * allow exceeding 1 if the supported range exceeds 100%, but it will be clamped to
703 * the supported range.
704 * @param[in] relative Whether to add \a brightness to the current brightness, instead of overwriting
705 * the current brightness.
706 */
707 xrt_result_t (*set_brightness)(struct xrt_device *xdev, float brightness, bool relative);
708
709 /*!
710 * @brief Gets the compositor info for a device for the given mode.
711 *
712 * This function should never block, and never wait on congested locks.
713 *
714 * @param[in] xdev The device.
715 * @param[in] mode The mode to query with.
716 * @param[out] out_info Populated with the output data.
717 */
718 xrt_result_t (*get_compositor_info)(struct xrt_device *xdev,
719 const struct xrt_device_compositor_mode *mode,
720 struct xrt_device_compositor_info *out_info);
721
722 /*!
723 * Enable the feature for this device.
724 *
725 * @param[in] xdev The device.
726 * @param[in] type The type of device feature.
727 */
728 xrt_result_t (*begin_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type);
729
730 /*!
731 * Disable the feature for this device.
732 *
733 * @param[in] xdev The device.
734 * @param[in] type The type of device feature.
735 */
736 xrt_result_t (*end_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type);
737
738 /*!
739 * Destroy device.
740 */
741 void (*destroy)(struct xrt_device *xdev);
742
743 // Add new functions above destroy.
744};
745
746/*!
747 * Helper function for @ref xrt_device::update_inputs.
748 *
749 * @copydoc xrt_device::update_inputs
750 *
751 * @public @memberof xrt_device
752 */
753XRT_NONNULL_ALL static inline xrt_result_t
755{
756 return xdev->update_inputs(xdev);
757}
758
759/*!
760 * Helper function for @ref xrt_device::get_tracked_pose.
761 *
762 * @copydoc xrt_device::get_tracked_pose
763 *
764 * @public @memberof xrt_device
765 */
766XRT_NONNULL_ALL static inline xrt_result_t
768 enum xrt_input_name name,
769 int64_t at_timestamp_ns,
770 struct xrt_space_relation *out_relation)
771{
772 return xdev->get_tracked_pose(xdev, name, at_timestamp_ns, out_relation);
773}
774
775/*!
776 * Helper function for @ref xrt_device::get_hand_tracking.
777 *
778 * @copydoc xrt_device::get_hand_tracking
779 *
780 * @public @memberof xrt_device
781 */
782XRT_NONNULL_ALL static inline xrt_result_t
784 enum xrt_input_name name,
785 int64_t desired_timestamp_ns,
786 struct xrt_hand_joint_set *out_value,
787 int64_t *out_timestamp_ns)
788{
789 return xdev->get_hand_tracking(xdev, name, desired_timestamp_ns, out_value, out_timestamp_ns);
790}
791
792/*!
793 * Helper function for @ref xrt_device::get_face_tracking.
794 *
795 * @copydoc xrt_device::get_face_tracking
796 *
797 * @public @memberof xrt_device
798 */
799XRT_NONNULL_ALL static inline xrt_result_t
801 enum xrt_input_name facial_expression_type,
802 int64_t at_timestamp_ns,
803 struct xrt_facial_expression_set *out_value)
804{
805 return xdev->get_face_tracking(xdev, facial_expression_type, at_timestamp_ns, out_value);
806}
807
808/*!
809 * Helper function for @ref xrt_device::get_face_calibration_state_android.
810 *
811 * @copydoc xrt_device::get_face_calibration_state_android
812 *
813 * @public @memberof xrt_device
814 */
815XRT_NONNULL_ALL static inline xrt_result_t
816xrt_device_get_face_calibration_state_android(struct xrt_device *xdev, bool *out_face_is_calibrated)
817{
818 return xdev->get_face_calibration_state_android(xdev, out_face_is_calibrated);
819}
820
821/*!
822 * Helper function for @ref xrt_device::get_body_skeleton.
823 *
824 * @copydoc xrt_device::get_body_skeleton
825 *
826 * @public @memberof xrt_device
827 */
828XRT_NONNULL_ALL static inline xrt_result_t
830 enum xrt_input_name body_tracking_type,
831 struct xrt_body_skeleton *out_value)
832{
833 return xdev->get_body_skeleton(xdev, body_tracking_type, out_value);
834}
835
836/*!
837 * Helper function for @ref xrt_device::get_body_joints.
838 *
839 * @copydoc xrt_device::get_body_joints
840 *
841 * @public @memberof xrt_device
842 */
843XRT_NONNULL_ALL static inline xrt_result_t
845 enum xrt_input_name body_tracking_type,
846 int64_t desired_timestamp_ns,
847 struct xrt_body_joint_set *out_value)
848{
849 return xdev->get_body_joints(xdev, body_tracking_type, desired_timestamp_ns, out_value);
850}
851
852/*!
853 * Helper function for @ref xrt_device::reset_body_tracking_calibration_meta.
854 *
855 * @copydoc xrt_device::reset_body_tracking_calibration_meta
856 *
857 * @public @memberof xrt_device
858 */
859XRT_NONNULL_ALL static inline xrt_result_t
867
868/*!
869 * Helper function for @ref xrt_device::set_body_tracking_calibration_override_meta.
870 *
871 * @copydoc xrt_device::set_body_tracking_calibration_override_meta
872 *
873 * @public @memberof xrt_device
874 */
875XRT_NONNULL_ALL static inline xrt_result_t
877{
880 }
881 return xdev->set_body_tracking_calibration_override_meta(xdev, new_body_height);
882}
883
884/*!
885 * Helper function for @ref xrt_device::set_output.
886 *
887 * @copydoc xrt_device::set_output
888 *
889 * @public @memberof xrt_device
890 */
891XRT_NONNULL_ALL static inline xrt_result_t
892xrt_device_set_output(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
893{
894 xdev->set_output(xdev, name, value);
895 return XRT_SUCCESS;
896}
897
898XRT_NONNULL_ALL static inline xrt_result_t
899xrt_device_get_output_limits(struct xrt_device *xdev, struct xrt_output_limits *limits)
900{
901 if (xdev->get_output_limits) {
902 return xdev->get_output_limits(xdev, limits);
903 } else {
905 }
906}
907
908/*!
909 * Helper function for @ref xrt_device::get_presence.
910 *
911 * @copydoc xrt_device::get_presence
912 *
913 * @public @memberof xrt_device
914 */
915XRT_NONNULL_ALL static inline xrt_result_t
916xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
917{
918 if (xdev->get_presence) {
919 return xdev->get_presence(xdev, presence);
920 } else {
922 }
923}
924
925/*!
926 * Helper function for @ref xrt_device::begin_plane_detection_ext.
927 *
928 * @public @memberof xrt_device
929 */
930XRT_NONNULL_ALL static inline xrt_result_t
932 const struct xrt_plane_detector_begin_info_ext *begin_info,
933 uint64_t plane_detection_id,
934 uint64_t *out_plane_detection_id)
935{
936 return xdev->begin_plane_detection_ext(xdev, begin_info, plane_detection_id, out_plane_detection_id);
937}
938
939/*!
940 * Helper function for @ref xrt_device::destroy_plane_detection_ext.
941 *
942 * @public @memberof xrt_device
943 */
944XRT_NONNULL_ALL static inline xrt_result_t
945xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
946{
947 return xdev->destroy_plane_detection_ext(xdev, plane_detection_id);
948}
949
950/*!
951 * Helper function for @ref xrt_device::get_plane_detections_ext.
952 *
953 * @public @memberof xrt_device
954 */
955XRT_NONNULL_ALL static inline xrt_result_t
957 uint64_t plane_detection_id,
958 enum xrt_plane_detector_state_ext *out_state)
959{
960 return xdev->get_plane_detection_state_ext(xdev, plane_detection_id, out_state);
961}
962
963/*!
964 * Helper function for @ref xrt_device::get_plane_detections_ext.
965 *
966 * @public @memberof xrt_device
967 */
968XRT_NONNULL_ALL static inline xrt_result_t
970 uint64_t plane_detection_id,
971 struct xrt_plane_detections_ext *out_detections)
972{
973 return xdev->get_plane_detections_ext(xdev, plane_detection_id, out_detections);
974}
975
976/*!
977 * Helper function for @ref xrt_device::get_view_poses.
978 *
979 * @copydoc xrt_device::get_view_poses
980 * @public @memberof xrt_device
981 */
982XRT_NONNULL_ALL static inline xrt_result_t
984 const struct xrt_vec3 *default_eye_relation,
985 int64_t at_timestamp_ns,
986 enum xrt_view_type view_type,
987 uint32_t view_count,
988 struct xrt_space_relation *out_head_relation,
989 struct xrt_fov *out_fovs,
990 struct xrt_pose *out_poses)
991{
992 return xdev->get_view_poses( //
993 xdev, //
994 default_eye_relation, //
995 at_timestamp_ns, //
996 view_type, //
997 view_count, //
998 out_head_relation, //
999 out_fovs, //
1000 out_poses); //
1001}
1002
1003/*!
1004 * Helper function for @ref xrt_device::compute_distortion.
1005 *
1006 * @copydoc xrt_device::compute_distortion
1007 *
1008 * @public @memberof xrt_device
1009 */
1010XRT_NONNULL_ALL static inline xrt_result_t
1012 struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
1013{
1014 return xdev->compute_distortion(xdev, view, u, v, out_result);
1015}
1016
1017/*!
1018 * Helper function for @ref xrt_device::get_visibility_mask.
1019 *
1020 * @copydoc xrt_device::get_visibility_mask
1021 *
1022 * @public @memberof xrt_device
1023 */
1024XRT_NONNULL_ALL static inline xrt_result_t
1026 enum xrt_visibility_mask_type type,
1027 uint32_t view_index,
1028 struct xrt_visibility_mask **out_mask)
1029{
1030 return xdev->get_visibility_mask(xdev, type, view_index, out_mask);
1031}
1032
1033/*!
1034 * Helper function for @ref xrt_device::ref_space_usage.
1035 *
1036 * @copydoc xrt_device::ref_space_usage
1037 *
1038 * @public @memberof xrt_device
1039 */
1040XRT_NONNULL_ALL static inline xrt_result_t
1042 enum xrt_reference_space_type type,
1043 enum xrt_input_name name,
1044 bool used)
1045{
1046 return xdev->ref_space_usage(xdev, type, name, used);
1047}
1048
1049/*!
1050 * Helper function for @ref xrt_device::is_form_factor_available.
1051 *
1052 * @copydoc xrt_device::is_form_factor_available
1053 *
1054 * @public @memberof xrt_device
1055 */
1056XRT_NONNULL_ALL static inline xrt_result_t
1057xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor, bool *out_available)
1058{
1059 return xdev->is_form_factor_available(xdev, form_factor, out_available);
1060}
1061
1062/*!
1063 * Helper function for @ref xrt_device::get_battery_status.
1064 *
1065 * @copydoc xrt_device::get_battery_status
1066 *
1067 * @public @memberof xrt_device
1068 */
1069XRT_NONNULL_ALL static inline xrt_result_t
1070xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
1071{
1072 return xdev->get_battery_status(xdev, out_present, out_charging, out_charge);
1073}
1074
1075/*!
1076 * Helper function for @ref xrt_device::get_brightness.
1077 *
1078 * @copydoc xrt_device::get_brightness
1079 * @public @memberof xrt_device
1080 */
1081XRT_NONNULL_ALL static inline xrt_result_t
1082xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
1083{
1084 return xdev->get_brightness(xdev, out_brightness);
1085}
1086
1087/*!
1088 * Helper function for @ref xrt_device::set_brightness.
1089 *
1090 * @copydoc xrt_device::set_brightness
1091 * @public @memberof xrt_device
1092 */
1093XRT_NONNULL_ALL static inline xrt_result_t
1094xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
1095{
1096 return xdev->set_brightness(xdev, brightness, relative);
1097}
1098
1099/*!
1100 * Helper function for @ref xrt_device::get_compositor_info.
1101 *
1102 * @copydoc xrt_device::get_compositor_info
1103 *
1104 * @public @memberof xrt_device
1105 */
1106XRT_NONNULL_ALL static inline xrt_result_t
1108 const struct xrt_device_compositor_mode *mode,
1109 struct xrt_device_compositor_info *out_info)
1110{
1111 return xdev->get_compositor_info(xdev, mode, out_info);
1112}
1113
1114/*!
1115 * Helper function for @ref xrt_device::begin_feature.
1116 *
1117 * @copydoc xrt_device::begin_feature
1118 *
1119 * @public @memberof xrt_device
1120 */
1121XRT_NONNULL_ALL static inline xrt_result_t
1123{
1124 return xdev->begin_feature(xdev, type);
1125}
1126
1127/*!
1128 * Helper function for @ref xrt_device::end_feature.
1129 *
1130 * @copydoc xrt_device::end_feature
1131 *
1132 * @public @memberof xrt_device
1133 */
1134XRT_NONNULL_ALL static inline xrt_result_t
1136{
1137 return xdev->end_feature(xdev, type);
1138}
1139
1140/*!
1141 * Helper function for @ref xrt_device::destroy.
1142 *
1143 * Handles nulls, sets your pointer to null.
1144 *
1145 * @public @memberof xrt_device
1146 */
1147XRT_NONNULL_ALL static inline void
1149{
1150 struct xrt_device *xdev = *xdev_ptr;
1151 if (xdev == NULL) {
1152 return;
1153 }
1154
1155 xdev->destroy(xdev);
1156 *xdev_ptr = NULL;
1157}
1158
1159
1160#ifdef __cplusplus
1161} // extern "C"
1162#endif
xrt_plane_detection_capability_flags_ext
Caps for a plane detector, see xrt_device.
Definition xrt_plane_detector.h:30
xrt_visibility_mask_type
Visibility mask, mirror of XrVisibilityMaskKHR.
Definition xrt_defines.h:2444
xrt_blend_mode
Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
Definition xrt_defines.h:112
xrt_form_factor
What form factor is this device, mostly maps onto OpenXR's XrFormFactor.
Definition xrt_defines.h:2385
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:917
enum xrt_result xrt_result_t
Result type used across Monado.
xrt_reference_space_type
Type of a OpenXR mapped reference space, maps to the semantic spaces on the xrt_space_overseer struct...
Definition xrt_defines.h:612
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1599
xrt_plane_detector_state_ext
State of a plane detector, see xrt_device.
Definition xrt_plane_detector.h:83
xrt_device_type
How an xrt_device can be used.
Definition xrt_defines.h:814
@ XRT_SUCCESS
The operation succeeded.
Definition xrt_results.h:27
@ XRT_ERROR_NOT_IMPLEMENTED
The interface function called is not implemented by its interface.
Definition xrt_results.h:192
A binding pair, going from a binding point to a device input.
Definition xrt_device.h:217
enum xrt_input_name device
To input on the device.
Definition xrt_device.h:219
enum xrt_input_name from
From which name.
Definition xrt_device.h:218
A binding pair, going from a binding point to a device output.
Definition xrt_device.h:228
enum xrt_output_name device
To output on the device.
Definition xrt_device.h:230
enum xrt_output_name from
From which name.
Definition xrt_device.h:229
A binding profile, has lists of binding pairs to goes from device in name to the device it hangs off ...
Definition xrt_device.h:240
enum xrt_device_name name
Device this binding emulates.
Definition xrt_device.h:242
Definition xrt_defines.h:2278
Definition xrt_defines.h:2178
Compositor information for a device.
Definition xrt_device.h:88
XRT_ALIGNAS(8) int64_t scanout_time_ns
The amount of time it takes to scanout the display in nanoseconds, from the start of the scanout,...
enum xrt_scanout_direction scanout_direction
The direction scanout on the display occurs.
Definition xrt_device.h:90
Compositor mode information for a device.
Definition xrt_device.h:104
int64_t frame_interval_ns
The amount of nanoseconds between frames.
Definition xrt_device.h:106
Static data of supported features of the xrt_device this struct sits on.
Definition xrt_device.h:280
A single HMD or input device.
Definition xrt_device.h:310
static XRT_NONNULL_ALL xrt_result_t xrt_device_end_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::end_feature.
Definition xrt_device.h:1135
xrt_result_t(* get_plane_detections_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Get results of a plane detection request.
Definition xrt_device.h:562
xrt_result_t(* get_body_skeleton)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc.
Definition xrt_device.h:454
xrt_result_t(* reset_body_tracking_calibration_meta)(struct xrt_device *xdev)
XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration.
Definition xrt_device.h:480
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_face_calibration_state_android(struct xrt_device *xdev, bool *out_face_is_calibrated)
Helper function for xrt_device::get_face_calibration_state_android.
Definition xrt_device.h:816
xrt_result_t(* get_body_joints)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Get the joint locations for a body tracker.
Definition xrt_device.h:470
xrt_result_t(* begin_plane_detection_ext)(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Begin a plane detection request.
Definition xrt_device.h:528
xrt_result_t(* ref_space_usage)(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Called by the xrt_space_overseer when a reference space that is implemented by this device is first u...
Definition xrt_device.h:657
xrt_result_t(* get_presence)(struct xrt_device *xdev, bool *presence)
Get current presence status of the device.
Definition xrt_device.h:517
xrt_result_t(* set_output)(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Set a output value.
Definition xrt_device.h:499
xrt_result_t(* compute_distortion)(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Compute the distortion at a single point.
Definition xrt_device.h:627
static XRT_NONNULL_ALL xrt_result_t xrt_device_begin_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::begin_feature.
Definition xrt_device.h:1122
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_visibility_mask(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Helper function for xrt_device::get_visibility_mask.
Definition xrt_device.h:1025
xrt_result_t(* set_body_tracking_calibration_override_meta)(struct xrt_device *xdev, float new_body_height)
XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration ov...
Definition xrt_device.h:489
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_plane_detections_ext(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Helper function for xrt_device::get_plane_detections_ext.
Definition xrt_device.h:969
static XRT_NONNULL_ALL xrt_result_t xrt_device_update_inputs(struct xrt_device *xdev)
Helper function for xrt_device::update_inputs.
Definition xrt_device.h:754
xrt_result_t(* get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits)
Gets limits of this devices outputs.
Definition xrt_device.h:509
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_view_poses(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, enum xrt_view_type view_type, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Helper function for xrt_device::get_view_poses.
Definition xrt_device.h:983
static XRT_NONNULL_ALL xrt_result_t xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
Helper function for xrt_device::destroy_plane_detection_ext.
Definition xrt_device.h:945
xrt_result_t(* get_hand_tracking)(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Get relationship of hand joints to the tracking origin space as the base space.
Definition xrt_device.h:411
xrt_result_t(* get_visibility_mask)(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Get the visibility mask for this device.
Definition xrt_device.h:638
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
Helper function for xrt_device::set_brightness.
Definition xrt_device.h:1094
struct xrt_hmd_parts * hmd
Null if this device does not interface with the users head.
Definition xrt_device.h:322
xrt_result_t(* get_face_tracking)(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Get the requested blend shape properties & weights for a face tracker.
Definition xrt_device.h:429
xrt_result_t(* destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id)
Destroy internal resources associated with plane_detector_id.
Definition xrt_device.h:540
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_body_tracking_calibration_override_meta(struct xrt_device *xdev, float new_body_height)
Helper function for xrt_device::set_body_tracking_calibration_override_meta.
Definition xrt_device.h:876
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
Helper function for xrt_device::get_brightness.
Definition xrt_device.h:1082
struct xrt_output * outputs
Array of output structs.
Definition xrt_device.h:340
xrt_result_t(* begin_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Enable the feature for this device.
Definition xrt_device.h:728
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
Helper function for xrt_device::get_presence.
Definition xrt_device.h:916
size_t output_count
Number of outputs.
Definition xrt_device.h:338
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_hand_tracking(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Helper function for xrt_device::get_hand_tracking.
Definition xrt_device.h:783
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_face_tracking(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Helper function for xrt_device::get_face_tracking.
Definition xrt_device.h:800
xrt_result_t(* set_brightness)(struct xrt_device *xdev, float brightness, bool relative)
Set the display brightness.
Definition xrt_device.h:707
struct xrt_input * inputs
Array of input structs.
Definition xrt_device.h:335
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_body_skeleton(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Helper function for xrt_device::get_body_skeleton.
Definition xrt_device.h:829
size_t input_count
Number of inputs.
Definition xrt_device.h:333
xrt_result_t(* get_battery_status)(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Get battery status information.
Definition xrt_device.h:683
static XRT_NONNULL_ALL xrt_result_t xrt_device_reset_body_tracking_calibration_meta(struct xrt_device *xdev)
Helper function for xrt_device::reset_body_tracking_calibration_meta.
Definition xrt_device.h:860
void(* destroy)(struct xrt_device *xdev)
Destroy device.
Definition xrt_device.h:741
xrt_result_t(* get_brightness)(struct xrt_device *xdev, float *out_brightness)
Get the current display brightness.
Definition xrt_device.h:695
xrt_result_t(* get_compositor_info)(struct xrt_device *xdev, const struct xrt_device_compositor_mode *mode, struct xrt_device_compositor_info *out_info)
Gets the compositor info for a device for the given mode.
Definition xrt_device.h:718
static XRT_NONNULL_ALL xrt_result_t xrt_device_ref_space_usage(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Helper function for xrt_device::ref_space_usage.
Definition xrt_device.h:1041
xrt_result_t(* get_plane_detection_state_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Get the state of a plane detection request.
Definition xrt_device.h:550
xrt_result_t(* update_inputs)(struct xrt_device *xdev)
Update any attached inputs.
Definition xrt_device.h:357
xrt_result_t(* get_view_poses)(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, enum xrt_view_type view_type, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Get the per-view pose in relation to the view space.
Definition xrt_device.h:604
static XRT_NONNULL_ALL xrt_result_t xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor, bool *out_available)
Helper function for xrt_device::is_form_factor_available.
Definition xrt_device.h:1057
static XRT_NONNULL_ALL xrt_result_t xrt_device_begin_plane_detection_ext(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Helper function for xrt_device::begin_plane_detection_ext.
Definition xrt_device.h:931
xrt_result_t(* get_face_calibration_state_android)(struct xrt_device *xdev, bool *out_face_is_calibrated)
Gets the face tracking calibration state.
Definition xrt_device.h:442
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_tracked_pose(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Helper function for xrt_device::get_tracked_pose.
Definition xrt_device.h:767
struct xrt_tracking_origin * tracking_origin
Always set, pointing to the tracking system for this device.
Definition xrt_device.h:325
static XRT_NONNULL_ALL xrt_result_t xrt_device_set_output(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Helper function for xrt_device::set_output.
Definition xrt_device.h:892
xrt_result_t(* end_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Disable the feature for this device.
Definition xrt_device.h:736
size_t binding_profile_count
Number of bindings in xrt_device::binding_profiles.
Definition xrt_device.h:328
static XRT_NONNULL_ALL void xrt_device_destroy(struct xrt_device **xdev_ptr)
Helper function for xrt_device::destroy.
Definition xrt_device.h:1148
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_compositor_info(struct xrt_device *xdev, const struct xrt_device_compositor_mode *mode, struct xrt_device_compositor_info *out_info)
Helper function for xrt_device::get_compositor_info.
Definition xrt_device.h:1107
static XRT_NONNULL_ALL xrt_result_t xrt_device_compute_distortion(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Helper function for xrt_device::compute_distortion.
Definition xrt_device.h:1011
enum xrt_device_name name
Enum identifier of the device.
Definition xrt_device.h:312
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Helper function for xrt_device::get_battery_status.
Definition xrt_device.h:1070
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_plane_detection_state_ext(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Helper function for xrt_device::get_plane_detections_ext.
Definition xrt_device.h:956
static XRT_NONNULL_ALL xrt_result_t xrt_device_get_body_joints(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Helper function for xrt_device::get_body_joints.
Definition xrt_device.h:844
xrt_result_t(* get_tracked_pose)(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Get relationship of a tracked device to the tracking origin space as the base space.
Definition xrt_device.h:383
xrt_result_t(* is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor, bool *out_available)
Check if given form factor is available or not.
Definition xrt_device.h:671
Definition xrt_defines.h:1954
Describes a projection matrix fov.
Definition xrt_defines.h:499
Joint set type used for hand tracking.
Definition xrt_defines.h:1508
All of the device components that deals with interfacing to a users head.
Definition xrt_device.h:117
float * vertices
Data.
Definition xrt_device.h:159
uint32_t vertex_count
Number of vertices.
Definition xrt_device.h:161
uint64_t nominal_frame_interval_ns
Nominal frame interval.
Definition xrt_device.h:129
uint32_t stride
Stride of vertices.
Definition xrt_device.h:163
int * indices
Indices, for triangle strip.
Definition xrt_device.h:168
enum xrt_distortion_model models
Supported distortion models, a bitfield.
Definition xrt_device.h:152
uint32_t index_count_total
Total number of elements in mesh::indices array.
Definition xrt_device.h:174
uint32_t uv_channels_count
1 or 3 for (chromatic aberration).
Definition xrt_device.h:165
enum xrt_distortion_model preferred
Preferred disortion model, single value.
Definition xrt_device.h:154
A single named input, that sits on a xrt_device.
Definition xrt_device.h:188
XRT_ALIGNAS(8) int64_t timestamp
alignas for 32 bit client support, see IPC Design and Implementation
bool active
Is this input active.
Definition xrt_device.h:190
A tightly packed 2x2 matrix of floats.
Definition xrt_defines.h:526
Output limits of a particular device.
Definition xrt_device.h:266
float haptic_pcm_sample_rate
The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
Definition xrt_device.h:268
A union of all output types.
Definition xrt_defines.h:2363
A single named output, that sits on a xrt_device.
Definition xrt_device.h:206
Each plane has n polygons; ultimately plane metadata from xrt_plane_detections_ext::locations and xrt...
Definition xrt_plane_detector.h:172
A query for a plane.
Definition xrt_plane_detector.h:97
A pose composed of a position and orientation.
Definition xrt_defines.h:479
A relation with two spaces, includes velocity and acceleration.
Definition xrt_defines.h:670
A tracking system or device origin.
Definition xrt_tracking.h:75
Represents a uv triplet for distortion, basically just three xrt_vec2.
Definition xrt_defines.h:279
A 3 element vector with single floats.
Definition xrt_defines.h:289
A per-lens/display view information.
Definition xrt_device.h:35
struct xrt_matrix_2x2 rot
Rotation 2d matrix used to rotate the position of the output of the distortion shaders onto the scree...
Definition xrt_device.h:81
struct xrt_view::@247 viewport
Viewport position on the screen.
struct xrt_view::@248 display
Physical properties of this display (or the part of a display that covers this view).
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition xrt_visibility_mask.h:26
A union of all input types.
Definition xrt_defines.h:1524
Common defines and enums for XRT.
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value.
Definition xrt_defines.h:167
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition xrt_defines.h:724
xrt_scanout_direction
Screen scanout direction.
Definition xrt_defines.h:179
xrt_view_type
View type to be rendered to by the compositor.
Definition xrt_defines.h:2394
xrt_device_feature_type
Higher level features for devices.
Definition xrt_device.h:254
Header for limits of the XRT interfaces.
Header defining planes detector enum and structs.
Header defining visibility mask helper struct.