From 1f781690a7d24551c18a6696f8c6a141cc3565c0 Mon Sep 17 00:00:00 2001 From: galister <3123227-galister@users.noreply.gitlab.com> Date: Mon, 19 Aug 2024 18:51:45 +0900 Subject: [PATCH] st/oxr: pass requested time for FB_face_tracking2 --- src/xrt/include/xrt/xrt_defines.h | 4 ++++ src/xrt/state_trackers/oxr/oxr_face_tracking2_fb.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xrt/include/xrt/xrt_defines.h b/src/xrt/include/xrt/xrt_defines.h index 14f9004ad8..5e0ee4aa4d 100644 --- a/src/xrt/include/xrt/xrt_defines.h +++ b/src/xrt/include/xrt/xrt_defines.h @@ -1638,6 +1638,10 @@ struct xrt_facial_expression_set2_fb float confidences[XRT_FACE_CONFIDENCE2_COUNT_FB]; enum xrt_face_tracking_data_source2_fb data_source; + + // initially set to the value requested via OXR. + // the implementer shall ensure that the data is valid for the time provided, + // either by extrapolation or by overriding the time value. uint64_t sample_time_ns; bool is_valid; diff --git a/src/xrt/state_trackers/oxr/oxr_face_tracking2_fb.c b/src/xrt/state_trackers/oxr/oxr_face_tracking2_fb.c index 9e7077106e..62c4ca2394 100644 --- a/src/xrt/state_trackers/oxr/oxr_face_tracking2_fb.c +++ b/src/xrt/state_trackers/oxr/oxr_face_tracking2_fb.c @@ -115,6 +115,10 @@ oxr_get_face_expression_weights2_fb(struct oxr_logger *log, } struct xrt_facial_expression_set result = {0}; + const struct oxr_instance *inst = face_tracker2_fb->sess->sys->inst; + result.face_expression_set2_fb.sample_time_ns = + time_state_ts_to_monotonic_ns(inst->timekeeping, expression_info->time); + // spec: visual is allowed to use both camera and audio enum xrt_input_name ft_input_name = face_tracker2_fb->visual_enabled ? XRT_INPUT_FB_FACE_TRACKING2_VISUAL : XRT_INPUT_FB_FACE_TRACKING2_AUDIO; @@ -132,7 +136,6 @@ oxr_get_face_expression_weights2_fb(struct oxr_logger *log, expression_weights->isEyeFollowingBlendshapesValid = result.face_expression_set2_fb.is_eye_following_blendshapes_valid; - const struct oxr_instance *inst = face_tracker2_fb->sess->sys->inst; expression_weights->time = time_state_monotonic_to_ts_ns(inst->timekeeping, result.face_expression_set2_fb.sample_time_ns); -- GitLab