|
Monado OpenXR Runtime
|
Interface to Oculus Rift driver code. More...
#include "xrt/xrt_device.h"#include "xrt/xrt_defines.h"#include "xrt/xrt_prober.h"#include "xrt/xrt_frame.h"#include "tracking/t_time_sync.h"#include "util/u_time.h"#include "constellation/t_constellation_tracker.h"
Go to the source code of this file.
Enumerations | |
| enum | rift_variant { RIFT_VARIANT_DK1 , RIFT_VARIANT_DK2 , RIFT_VARIANT_CV1 } |
Functions | |
| bool | rift_is_oculus (struct xrt_prober *xp, struct xrt_prober_device *dev) |
| Checks whether the given device is an Oculus device, by checking the manufacturer string. | |
| int | rift_found (struct xrt_prober *xp, struct xrt_prober_device **devices, size_t device_count, size_t index, cJSON *attached_data, struct xrt_device **out_xdev) |
| Probing function for Oculus Rift devices. | |
| int | rift_devices_create (struct os_hid_device *hmd_dev, struct os_hid_device *radio_dev, enum rift_variant variant, const char *serial_number, struct xrt_frame_context *xfctx, struct rift_hmd **out_hmd, struct xrt_device **out_xdevs) |
| Creates Rift HMD and related devices. | |
| bool | rift_get_radio_id (struct rift_hmd *hmd, uint8_t out_radio_id[5]) |
| bool | rift_hmd_frame_timestamp_callback (void *user_data, timepoint_ns *timestamp, uint32_t pts) |
| int | rift_add_to_constellation_tracker (struct rift_hmd *hmd, struct t_constellation_tracker *tracker) |
| struct t_timing_event_source * | rift_hmd_get_timing_event_source (struct rift_hmd *hmd) |
| Gets the HMD's timing event source. | |
Interface to Oculus Rift driver code.
| int rift_devices_create | ( | struct os_hid_device * | hmd_dev, |
| struct os_hid_device * | radio_dev, | ||
| enum rift_variant | variant, | ||
| const char * | serial_number, | ||
| struct xrt_frame_context * | xfctx, | ||
| struct rift_hmd ** | out_hmd, | ||
| struct xrt_device ** | out_xdevs | ||
| ) |
Creates Rift HMD and related devices.
| hmd_dev | The HID device for the HMD. |
| radio_dev | The HID device for the radio, if present (CV1 only). |
| variant | The Rift variant (DK2 or CV1). |
| serial_number | The serial number of the device. |
| xfctx | The frame context to use for the timing source functions. This is optional if you do not plan to use the Rift as a timing source. |
| out_hmd | Output pointer for the created rift_hmd struct. |
| out_xdevs | Output array for the created xrt_device pointers. The array must have space for at least 4 devices (HMD, left touch, right touch, remote). |
References xrt_hmd_parts::blend_modes, xrt_device::compute_distortion, xrt_device::destroy, rift_hmd::device_mutex, xrt_view::display, xrt_hmd_parts::distortion, xrt_hmd_parts::fov, xrt_device::get_presence, xrt_device::get_tracked_pose, xrt_device::get_view_poses, xrt_device::get_visibility_mask, xrt_device::hmd, xrt_device::inputs, rift_hmd::last_remote_exposure_time_ns, m_clock_windowed_skew_tracker_alloc(), m_ff_f64_alloc(), m_ff_vec3_f32_alloc(), xrt_hmd_parts::models, xrt_device::name, xrt_hmd_parts::nominal_frame_interval_ns, os_nanosleep(), xrt_hmd_parts::preferred, t_constellation_tracker_device::push_constellation_tracker_sample, rift_hmd::radio_state, xrt_view::rot, xrt_hmd_parts::screens, xrt_device::serial, xrt_device::str, xrt_device::supported, time_s_to_ns(), u_device_noop_update_inputs(), u_distortion_mesh_fill_in_compute(), u_truncate_snprintf(), u_var_add_root(), xrt_device::update_inputs, xrt_view::viewport, xrt_hmd_parts::views, and XRT_INPUT_GENERIC_HEAD_POSE.
Referenced by rift_found().
| int rift_found | ( | struct xrt_prober * | xp, |
| struct xrt_prober_device ** | devices, | ||
| size_t | device_count, | ||
| size_t | index, | ||
| cJSON * | attached_data, | ||
| struct xrt_device ** | out_xdev | ||
| ) |
Probing function for Oculus Rift devices.
References xrt_device::hmd, xrt_prober_device::product_id, rift_devices_create(), rift_is_oculus(), and U_LOG_I.
| struct t_timing_event_source * rift_hmd_get_timing_event_source | ( | struct rift_hmd * | hmd | ) |
Gets the HMD's timing event source.
| hmd | The rift_hmd to get the timing event source from. |
| bool rift_is_oculus | ( | struct xrt_prober * | xp, |
| struct xrt_prober_device * | dev | ||
| ) |
Checks whether the given device is an Oculus device, by checking the manufacturer string.
| xp | The prober to use for getting string descriptors. |
| dev | The device to check. |
Referenced by rift_found().