st/oxr: Enable eye tracking feature when any eye gaze space is created
Co-authored-by: Korcan Hussein <korcan.hussein@collabora.com> Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2649>
178 unmodified linesExpand all179180181182183184185186187188146 unmodified linesExpand all178 unmodified linesExpand all xret = set_hand_tracking_enabled(xsysd, XRT_HAND_LEFT, false); } else if (type == XRT_DEVICE_FEATURE_HAND_TRACKING_RIGHT) { xret = set_hand_tracking_enabled(xsysd, XRT_HAND_RIGHT, false); } else if (type == XRT_DEVICE_FEATURE_EYE_TRACKING) { // @todo When eyes are moved from the static roles, we need to end features on the old device when // swapping which device is in the eyes role xret = xrt_device_end_feature(xsysd->static_roles.eyes, type); } else { xret = XRT_ERROR_FEATURE_NOT_SUPPORTED; }146 unmodified linesExpand all2454 unmodified linesExpand all2455245624572458245924602461246224632464700 unmodified linesExpand all2454 unmodified linesExpand all { struct xrt_space *xs; struct xrt_device *xdev; enum xrt_input_name name;
bool feature_eye_tracking; } action;
struct {700 unmodified linesExpand all61 unmodified lines6263646566676869707172737475762 unmodified lines79808182767783848586878889909155 unmodified lines147148149150143151152153154155485 unmodified linesExpand all61 unmodified lines assert(xdev != NULL); assert(name != 0);
if (xdev != spc->action.xdev || name != spc->action.name) { struct xrt_system_devices *xsysd = spc->sess->sys->xsysd;
if (spc->action.feature_eye_tracking) { xrt_system_devices_feature_dec(xsysd, XRT_DEVICE_FEATURE_EYE_TRACKING); spc->action.feature_eye_tracking = false; }
xrt_space_reference(&spc->action.xs, NULL);
xrt_result_t xret = xrt_space_overseer_create_pose_space( // spc->sess->sys->xso, //2 unmodified lines &spc->action.xs); // if (xret != XRT_SUCCESS) { oxr_warn(log, "Failed to create pose space"); } else { struct xrt_system_devices *xsysd = spc->sess->sys->xsysd; if (xdev == xsysd->static_roles.eyes) { if (name == XRT_INPUT_GENERIC_EYE_GAZE_POSE) { // eye tracking is being used xrt_system_devices_feature_inc(xsysd, XRT_DEVICE_FEATURE_EYE_TRACKING);
spc->action.feature_eye_tracking = true; }
spc->action.xdev = xdev; spc->action.name = name;55 unmodified lines xrt_space_overseer_ref_space_dec(spc->sess->sys->xso, xtype); }
struct xrt_system_devices *xsysd = spc->sess->sys->xsysd; if (spc->action.xdev && spc->action.xdev == xsysd->static_roles.eyes) { if (spc->action.feature_eye_tracking) { // eye tracking isn't being used anymore xrt_system_devices_feature_dec(xsysd, XRT_DEVICE_FEATURE_EYE_TRACKING); }
485 unmodified linesExpand all