mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-14 02:45:24 +00:00
xrt: use int64_t for timestamp in get_hand_tracking
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2298>
This commit is contained in:
parent
d5ba6eec5b
commit
e298244516
|
@ -148,9 +148,9 @@ userConfigSetDefaults(struct ht_device *htd)
|
|||
static void
|
||||
ht_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t at_timestamp_ns,
|
||||
int64_t at_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
struct ht_device *htd = ht_device(xdev);
|
||||
|
||||
|
|
|
@ -134,9 +134,9 @@ cemu_device_destroy(struct xrt_device *xdev)
|
|||
static void
|
||||
cemu_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t requested_timestamp_ns,
|
||||
int64_t requested_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
// Shadows normal hand tracking - does nothing differently
|
||||
|
||||
|
@ -231,8 +231,8 @@ get_other_two(struct cemu_device *dev,
|
|||
} else {
|
||||
other = 0;
|
||||
}
|
||||
uint64_t noop;
|
||||
|
||||
int64_t noop;
|
||||
xrt_device_get_hand_tracking(dev->sys->in_hand, dev->sys->out_hand[other]->ht_input_name, hand_timestamp_ns,
|
||||
out_secondary, &noop);
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ cemu_device_get_tracked_pose(struct xrt_device *xdev,
|
|||
CEMU_ERROR(dev, "unknown input name %d for controller pose", name);
|
||||
return;
|
||||
}
|
||||
static uint64_t hand_timestamp_ns;
|
||||
static int64_t hand_timestamp_ns;
|
||||
|
||||
struct xrt_hand_joint_set joint_set;
|
||||
sys->in_hand->get_hand_tracking(sys->in_hand, dev->ht_input_name, at_timestamp_ns, &joint_set,
|
||||
|
@ -384,7 +384,7 @@ cemu_device_update_inputs(struct xrt_device *xdev)
|
|||
struct cemu_device *dev = cemu_device(xdev);
|
||||
|
||||
struct xrt_hand_joint_set joint_set;
|
||||
uint64_t noop;
|
||||
int64_t noop;
|
||||
|
||||
xrt_device_get_hand_tracking(dev->sys->in_hand, dev->ht_input_name, os_monotonic_get_ns(), &joint_set, &noop);
|
||||
|
||||
|
|
|
@ -134,9 +134,9 @@ destroy(struct xrt_device *xdev)
|
|||
static void
|
||||
get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t at_timestamp_ns,
|
||||
int64_t at_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
struct multi_device *d = (struct multi_device *)xdev;
|
||||
struct xrt_device *target = d->tracking_override.target;
|
||||
|
|
|
@ -89,9 +89,9 @@ opengloves_device(struct xrt_device *xdev)
|
|||
static void
|
||||
opengloves_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t requested_timestamp_ns,
|
||||
int64_t requested_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_joint_set,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
struct opengloves_device *od = opengloves_device(xdev);
|
||||
|
||||
|
|
|
@ -135,9 +135,9 @@ r_device_get_tracked_pose(struct xrt_device *xdev,
|
|||
static void
|
||||
r_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t requested_timestamp_ns,
|
||||
int64_t requested_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
struct r_device *rd = r_device(xdev);
|
||||
struct r_hub *r = rd->r;
|
||||
|
|
|
@ -73,9 +73,9 @@ r_hmd_get_tracked_pose(struct xrt_device *xdev,
|
|||
static void
|
||||
r_hmd_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t at_timestamp_ns,
|
||||
int64_t at_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
struct r_hmd *rh = r_hmd(xdev);
|
||||
(void)rh;
|
||||
|
|
|
@ -162,9 +162,9 @@ simulated_device_get_tracked_pose(struct xrt_device *xdev,
|
|||
static void
|
||||
simulated_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t requested_timestamp_ns,
|
||||
int64_t requested_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
|
|
@ -399,9 +399,9 @@ ControllerDevice::get_finger_from_name(const std::string_view name)
|
|||
|
||||
void
|
||||
ControllerDevice::get_hand_tracking(enum xrt_input_name name,
|
||||
uint64_t desired_timestamp_ns,
|
||||
int64_t desired_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
if (!has_index_hand_tracking)
|
||||
return;
|
||||
|
|
|
@ -176,9 +176,9 @@ public:
|
|||
|
||||
void
|
||||
get_hand_tracking(enum xrt_input_name name,
|
||||
uint64_t desired_timestamp_ns,
|
||||
int64_t desired_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns);
|
||||
int64_t *out_timestamp_ns);
|
||||
|
||||
xrt_hand
|
||||
get_xrt_hand();
|
||||
|
|
|
@ -458,9 +458,9 @@ struct Button buttons[255] = {
|
|||
static void
|
||||
survive_controller_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t at_timestamp_ns,
|
||||
int64_t at_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
struct survive_device *survive = (struct survive_device *)xdev;
|
||||
|
||||
|
|
|
@ -363,9 +363,9 @@ vive_controller_device_index_update_inputs(struct xrt_device *xdev)
|
|||
static void
|
||||
vive_controller_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t requested_timestamp_ns,
|
||||
int64_t requested_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
XRT_TRACE_MARKER();
|
||||
|
||||
|
|
|
@ -338,9 +338,9 @@ struct xrt_device
|
|||
*/
|
||||
void (*get_hand_tracking)(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t desired_timestamp_ns,
|
||||
int64_t desired_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns);
|
||||
int64_t *out_timestamp_ns);
|
||||
|
||||
/*!
|
||||
* @brief Get the requested blend shape properties & weights for a face tracker
|
||||
|
@ -563,9 +563,9 @@ xrt_device_get_tracked_pose(struct xrt_device *xdev,
|
|||
static inline void
|
||||
xrt_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t desired_timestamp_ns,
|
||||
int64_t desired_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
xdev->get_hand_tracking(xdev, name, desired_timestamp_ns, out_value, out_timestamp_ns);
|
||||
}
|
||||
|
|
|
@ -102,9 +102,9 @@ ipc_client_device_get_tracked_pose(struct xrt_device *xdev,
|
|||
static void
|
||||
ipc_client_device_get_hand_tracking(struct xrt_device *xdev,
|
||||
enum xrt_input_name name,
|
||||
uint64_t at_timestamp_ns,
|
||||
int64_t at_timestamp_ns,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp_ns)
|
||||
int64_t *out_timestamp_ns)
|
||||
{
|
||||
ipc_client_device_t *icd = ipc_client_device(xdev);
|
||||
|
||||
|
|
|
@ -1892,9 +1892,9 @@ xrt_result_t
|
|||
ipc_handle_device_get_hand_tracking(volatile struct ipc_client_state *ics,
|
||||
uint32_t id,
|
||||
enum xrt_input_name name,
|
||||
uint64_t at_timestamp,
|
||||
int64_t at_timestamp,
|
||||
struct xrt_hand_joint_set *out_value,
|
||||
uint64_t *out_timestamp)
|
||||
int64_t *out_timestamp)
|
||||
{
|
||||
|
||||
// To make the code a bit more readable.
|
||||
|
|
|
@ -406,11 +406,11 @@
|
|||
"in": [
|
||||
{"name": "id", "type": "uint32_t"},
|
||||
{"name": "name", "type": "enum xrt_input_name"},
|
||||
{"name": "at_timestamp", "type": "uint64_t"}
|
||||
{"name": "at_timestamp", "type": "int64_t"}
|
||||
],
|
||||
"out": [
|
||||
{"name": "value", "type": "struct xrt_hand_joint_set"},
|
||||
{"name": "timestamp", "type": "uint64_t"}
|
||||
{"name": "timestamp", "type": "int64_t"}
|
||||
]
|
||||
},
|
||||
|
||||
|
|
|
@ -122,11 +122,11 @@ oxr_xdev_get_hand_tracking_at(struct oxr_logger *log,
|
|||
struct xrt_hand_joint_set *out_value)
|
||||
{
|
||||
//! Convert at_time to monotonic and give to device.
|
||||
uint64_t at_timestamp_ns = time_state_ts_to_monotonic_ns(inst->timekeeping, at_time);
|
||||
int64_t at_timestamp_ns = time_state_ts_to_monotonic_ns(inst->timekeeping, at_time);
|
||||
|
||||
struct xrt_hand_joint_set value;
|
||||
|
||||
uint64_t ignored;
|
||||
int64_t ignored;
|
||||
|
||||
xrt_device_get_hand_tracking(xdev, name, at_timestamp_ns, &value, &ignored);
|
||||
|
||||
|
|
|
@ -970,7 +970,7 @@ public:
|
|||
|
||||
timepoint_ns now_ns = os_monotonic_get_ns();
|
||||
struct xrt_hand_joint_set out_joint_set_value;
|
||||
uint64_t out_timestamp_ns;
|
||||
int64_t out_timestamp_ns;
|
||||
|
||||
m_xdev->get_hand_tracking(m_xdev,
|
||||
m_hand == XRT_HAND_LEFT ? XRT_INPUT_GENERIC_HAND_TRACKING_LEFT
|
||||
|
|
Loading…
Reference in a new issue