The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/all: Use u_device_noop_update_inputs helper

+31 -139
+2 -8
src/xrt/drivers/android/android_sensors.c
··· 1 1 // Copyright 2013, Fredrik Hultin. 2 2 // Copyright 2013, Jakob Bornecrantz. 3 3 // Copyright 2015, Joey Ferwerda. 4 - // Copyright 2020, Collabora, Ltd. 4 + // Copyright 2020-2023, Collabora, Ltd. 5 5 // SPDX-License-Identifier: BSL-1.0 6 6 /*! 7 7 * @file ··· 170 170 } 171 171 172 172 static void 173 - android_device_update_inputs(struct xrt_device *xdev) 174 - { 175 - // Empty 176 - } 177 - 178 - static void 179 173 android_device_get_tracked_pose(struct xrt_device *xdev, 180 174 enum xrt_input_name name, 181 175 uint64_t at_timestamp_ns, ··· 229 223 230 224 d->base.name = XRT_DEVICE_GENERIC_HMD; 231 225 d->base.destroy = android_device_destroy; 232 - d->base.update_inputs = android_device_update_inputs; 226 + d->base.update_inputs = u_device_noop_update_inputs; 233 227 d->base.get_tracked_pose = android_device_get_tracked_pose; 234 228 d->base.get_view_poses = android_device_get_view_poses; 235 229 d->base.compute_distortion = android_device_compute_distortion;
+1 -5
src/xrt/drivers/euroc/euroc_device.c
··· 101 101 return (struct euroc_device *)xdev; 102 102 } 103 103 104 - static void 105 - euroc_device_update_inputs(struct xrt_device *xdev) 106 - {} 107 - 108 104 //! Corrections specific for original euroc datasets and Kimera. 109 105 //! If your datasets comes from a different camera you should probably 110 106 //! use a different pose correction function. ··· 247 243 xd->inputs[0].name = XRT_INPUT_SIMPLE_GRIP_POSE; 248 244 } 249 245 250 - xd->update_inputs = euroc_device_update_inputs; 246 + xd->update_inputs = u_device_noop_update_inputs; 251 247 xd->get_tracked_pose = euroc_device_get_tracked_pose; 252 248 xd->destroy = euroc_device_destroy; 253 249 if (is_hmd) {
+2 -8
src/xrt/drivers/hdk/hdk_device.cpp
··· 1 - // Copyright 2019, Collabora, Ltd. 1 + // Copyright 2019-2023, Collabora, Ltd. 2 2 // Copyright 2014, Kevin M. Godby 3 3 // Copyright 2014-2018, Sensics, Inc. 4 4 // SPDX-License-Identifier: BSL-1.0 ··· 108 108 } 109 109 110 110 free(hd); 111 - } 112 - 113 - static void 114 - hdk_device_update_inputs(struct xrt_device *xdev) 115 - { 116 - // Empty 117 111 } 118 112 119 113 static constexpr uint8_t MSG_LEN_LARGE = 32; ··· 309 303 hd->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 310 304 hd->base.hmd->blend_mode_count = idx; 311 305 312 - hd->base.update_inputs = hdk_device_update_inputs; 306 + hd->base.update_inputs = u_device_noop_update_inputs; 313 307 hd->base.get_tracked_pose = hdk_device_get_tracked_pose; 314 308 hd->base.get_view_poses = hdk_device_get_view_poses; 315 309 hd->base.destroy = hdk_device_destroy;
+2 -8
src/xrt/drivers/ht/ht_driver.c
··· 1 - // Copyright 2021, Collabora, Ltd. 1 + // Copyright 2021-2023, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 146 146 */ 147 147 148 148 static void 149 - ht_device_update_inputs(struct xrt_device *xdev) 150 - { 151 - // Empty 152 - } 153 - 154 - static void 155 149 ht_device_get_hand_tracking(struct xrt_device *xdev, 156 150 enum xrt_input_name name, 157 151 uint64_t at_timestamp_ns, ··· 214 208 htd->base.tracking_origin->offset.position.z = 0.0f; 215 209 htd->base.tracking_origin->offset.orientation.w = 1.0f; 216 210 217 - htd->base.update_inputs = ht_device_update_inputs; 211 + htd->base.update_inputs = u_device_noop_update_inputs; 218 212 htd->base.get_hand_tracking = ht_device_get_hand_tracking; 219 213 htd->base.destroy = ht_device_destroy; 220 214
+1 -7
src/xrt/drivers/illixr/illixr_device.cpp
··· 108 108 } 109 109 110 110 static void 111 - illixr_hmd_update_inputs(struct xrt_device *xdev) 112 - { 113 - // Empty 114 - } 115 - 116 - static void 117 111 illixr_hmd_get_tracked_pose(struct xrt_device *xdev, 118 112 enum xrt_input_name name, 119 113 uint64_t at_timestamp_ns, ··· 173 167 enum u_device_alloc_flags flags = 174 168 (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); 175 169 dh = U_DEVICE_ALLOCATE(struct illixr_hmd, flags, 1, 0); 176 - dh->base.update_inputs = illixr_hmd_update_inputs; 170 + dh->base.update_inputs = u_device_noop_update_inputs; 177 171 dh->base.get_tracked_pose = illixr_hmd_get_tracked_pose; 178 172 dh->base.get_view_poses = illixr_hmd_get_view_poses; 179 173 dh->base.destroy = illixr_hmd_destroy;
+2 -9
src/xrt/drivers/north_star/ns_hmd.c
··· 1 - // Copyright 2020, Collabora, Ltd. 1 + // Copyright 2020-2023, Collabora, Ltd. 2 2 // Copyright 2020, Nova King. 3 3 // Copyright 2020, Moses Turner. 4 4 // SPDX-License-Identifier: BSL-1.0 ··· 368 368 } 369 369 370 370 static void 371 - ns_hmd_update_inputs(struct xrt_device *xdev) 372 - { 373 - struct ns_hmd *ns = ns_hmd(xdev); 374 - NS_DEBUG(ns, "Called!"); 375 - } 376 - 377 - static void 378 371 ns_hmd_get_tracked_pose(struct xrt_device *xdev, 379 372 enum xrt_input_name name, 380 373 uint64_t at_timestamp_ns, ··· 471 464 472 465 473 466 ns->base.compute_distortion = ns_mesh_calc; 474 - ns->base.update_inputs = ns_hmd_update_inputs; 467 + ns->base.update_inputs = u_device_noop_update_inputs; 475 468 ns->base.get_tracked_pose = ns_hmd_get_tracked_pose; 476 469 ns->base.get_view_poses = ns_hmd_get_view_poses; 477 470 ns->base.destroy = ns_hmd_destroy;
+2 -8
src/xrt/drivers/realsense/rs_ddev.c
··· 1 - // Copyright 2020, Collabora, Ltd. 1 + // Copyright 2020-2023, Collabora, Ltd. 2 2 // Copyright 2020, Nova King. 3 3 // SPDX-License-Identifier: BSL-1.0 4 4 /*! ··· 390 390 */ 391 391 392 392 static void 393 - rs_ddev_update_inputs(struct xrt_device *xdev) 394 - { 395 - // Empty 396 - } 397 - 398 - static void 399 393 rs_ddev_get_tracked_pose(struct xrt_device *xdev, 400 394 enum xrt_input_name name, 401 395 uint64_t at_timestamp_ns, ··· 466 460 467 461 U_LOG_D("Realsense opts are %i %i %i %i %i\n", rs->enable_mapping, rs->enable_pose_jumping, 468 462 rs->enable_relocalization, rs->enable_pose_prediction, rs->enable_pose_filtering); 469 - rs->base.update_inputs = rs_ddev_update_inputs; 463 + rs->base.update_inputs = u_device_noop_update_inputs; 470 464 rs->base.get_tracked_pose = rs_ddev_get_tracked_pose; 471 465 rs->base.get_view_poses = rs_ddev_get_view_poses; 472 466 rs->base.destroy = rs_ddev_destroy;
+1 -7
src/xrt/drivers/realsense/rs_hdev.c
··· 217 217 return rh; 218 218 } 219 219 220 - static void 221 - rs_hdev_update_inputs(struct xrt_device *xdev) 222 - { 223 - return; 224 - } 225 - 226 220 //! Specific pose corrections for Kimera and the D455 camera 227 221 XRT_MAYBE_UNUSED static inline struct xrt_pose 228 222 rs_hdev_correct_pose_from_kimera(struct xrt_pose pose) ··· 1013 1007 xd->orientation_tracking_supported = true; 1014 1008 xd->position_tracking_supported = true; 1015 1009 1016 - xd->update_inputs = rs_hdev_update_inputs; 1010 + xd->update_inputs = u_device_noop_update_inputs; 1017 1011 xd->get_tracked_pose = rs_hdev_get_tracked_pose; 1018 1012 xd->destroy = rs_hdev_destroy; 1019 1013
+2 -9
src/xrt/drivers/remote/r_hmd.c
··· 1 - // Copyright 2020-2022, Collabora, Ltd. 1 + // Copyright 2020-2023, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 54 54 55 55 // Free this device with the helper. 56 56 u_device_free(&rh->base); 57 - } 58 - 59 - static void 60 - r_hmd_update_inputs(struct xrt_device *xdev) 61 - { 62 - struct r_hmd *rh = r_hmd(xdev); 63 - (void)rh; 64 57 } 65 58 66 59 static void ··· 148 141 struct r_hmd, flags, input_count, output_count); 149 142 150 143 // Setup the basics. 151 - rh->base.update_inputs = r_hmd_update_inputs; 144 + rh->base.update_inputs = u_device_noop_update_inputs; 152 145 rh->base.get_tracked_pose = r_hmd_get_tracked_pose; 153 146 rh->base.get_hand_tracking = r_hmd_get_hand_tracking; 154 147 rh->base.get_view_poses = r_hmd_get_view_poses;
+1 -4
src/xrt/drivers/rift_s/rift_s_hmd.c
··· 43 43 44 44 #define DEG_TO_RAD(D) ((D)*M_PI / 180.) 45 45 46 - static void 47 - rift_s_update_inputs(struct xrt_device *xdev) 48 - {} 49 46 50 47 static void 51 48 rift_s_get_tracked_pose(struct xrt_device *xdev, ··· 228 225 229 226 hmd->base.tracking_origin = &sys->base; 230 227 231 - hmd->base.update_inputs = rift_s_update_inputs; 228 + hmd->base.update_inputs = u_device_noop_update_inputs; 232 229 hmd->base.get_tracked_pose = rift_s_get_tracked_pose; 233 230 hmd->base.get_view_poses = rift_s_get_view_poses; 234 231 hmd->base.destroy = rift_s_hmd_destroy;
+1 -7
src/xrt/drivers/rokid/rokid_hmd.c
··· 431 431 } 432 432 433 433 static void 434 - rokid_hmd_update_inputs(struct xrt_device *xdev) 435 - { 436 - // Empty, everything is done in the USB thread 437 - } 438 - 439 - static void 440 434 rokid_hmd_get_tracked_pose(struct xrt_device *xdev, 441 435 enum xrt_input_name name, 442 436 uint64_t at_timestamp_ns, ··· 498 492 rokid->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 499 493 rokid->base.hmd->blend_mode_count = idx; 500 494 501 - rokid->base.update_inputs = rokid_hmd_update_inputs; 495 + rokid->base.update_inputs = u_device_noop_update_inputs; 502 496 rokid->base.get_tracked_pose = rokid_hmd_get_tracked_pose; 503 497 rokid->base.get_view_poses = rokid_hmd_get_view_poses; 504 498 rokid->base.destroy = rokid_hmd_destroy;
+2 -6
src/xrt/drivers/simula/svr_hmd.c
··· 1 - // Copyright 2020, Collabora, Ltd. 1 + // Copyright 2020-2023, Collabora, Ltd. 2 2 // Copyright 2020, Moses Turner. 3 3 // SPDX-License-Identifier: BSL-1.0 4 4 /*! ··· 71 71 72 72 u_device_free(&ns->base); 73 73 } 74 - // 75 - static void 76 - svr_hmd_update_inputs(struct xrt_device *xdev) 77 - {} 78 74 79 75 static void 80 76 svr_hmd_get_tracked_pose(struct xrt_device *xdev, ··· 224 220 225 221 226 222 227 - svr->base.update_inputs = svr_hmd_update_inputs; 223 + svr->base.update_inputs = u_device_noop_update_inputs; 228 224 svr->base.get_tracked_pose = svr_hmd_get_tracked_pose; 229 225 svr->base.get_view_poses = svr_hmd_get_view_poses; 230 226 svr->base.destroy = svr_hmd_destroy;
+1 -7
src/xrt/drivers/simulated/simulated_hmd.c
··· 85 85 } 86 86 87 87 static void 88 - simulated_hmd_update_inputs(struct xrt_device *xdev) 89 - { 90 - // Empty, you should put code to update the attached inputs fields. 91 - } 92 - 93 - static void 94 88 simulated_hmd_get_tracked_pose(struct xrt_device *xdev, 95 89 enum xrt_input_name name, 96 90 uint64_t at_timestamp_ns, ··· 209 203 enum u_device_alloc_flags flags = 210 204 (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); 211 205 struct simulated_hmd *dh = U_DEVICE_ALLOCATE(struct simulated_hmd, flags, 1, 0); 212 - dh->base.update_inputs = simulated_hmd_update_inputs; 206 + dh->base.update_inputs = u_device_noop_update_inputs; 213 207 dh->base.get_tracked_pose = simulated_hmd_get_tracked_pose; 214 208 dh->base.get_view_poses = simulated_hmd_get_view_poses; 215 209 dh->base.ref_space_usage = simulated_ref_space_usage;
+1 -7
src/xrt/drivers/twrap/twrap_slam.c
··· 71 71 } 72 72 73 73 static void 74 - twrap_slam_update_inputs(struct xrt_device *xdev) 75 - { 76 - // Empty 77 - } 78 - 79 - static void 80 74 twrap_slam_get_tracked_pose(struct xrt_device *xdev, 81 75 enum xrt_input_name name, 82 76 uint64_t at_timestamp_ns, ··· 158 152 159 153 160 154 161 - dx->base.update_inputs = twrap_slam_update_inputs; 155 + dx->base.update_inputs = u_device_noop_update_inputs; 162 156 dx->base.get_tracked_pose = twrap_slam_get_tracked_pose; 163 157 dx->base.get_view_poses = twrap_slam_get_view_poses; 164 158 dx->base.destroy = twrap_slam_destroy;
+2 -9
src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp
··· 1 - // Copyright 2020-2021, Collabora, Ltd. 1 + // Copyright 2020-2023, Collabora, Ltd. 2 2 // Copyright 2020-2021, Moses Turner 3 3 // SPDX-License-Identifier: BSL-1.0 4 4 /*! ··· 323 323 } 324 324 325 325 static void 326 - ulv2_device_update_inputs(struct xrt_device *xdev) 327 - { 328 - // Empty 329 - } 330 - 331 - 332 - static void 333 326 ulv2_device_get_hand_tracking(struct xrt_device *xdev, 334 327 enum xrt_input_name name, 335 328 uint64_t at_timestamp_ns, ··· 398 391 399 392 ulv2d->log_level = debug_get_log_option_ulv2_log(); 400 393 401 - ulv2d->base.update_inputs = ulv2_device_update_inputs; 394 + ulv2d->base.update_inputs = u_device_noop_update_inputs; 402 395 ulv2d->base.get_hand_tracking = ulv2_device_get_hand_tracking; 403 396 ulv2d->base.destroy = ulv2_device_destroy; 404 397
+5 -12
src/xrt/drivers/vive/vive_controller.c
··· 1 1 // Copyright 2016 Philipp Zabel 2 - // Copyright 2020-2021, Collabora, Ltd. 2 + // Copyright 2020-2023, Collabora, Ltd. 3 3 // SPDX-License-Identifier: BSL-1.0 4 4 /*! 5 5 * @file ··· 358 358 } 359 359 360 360 os_mutex_unlock(&d->lock); 361 - } 362 - 363 - 364 - static void 365 - _update_tracker_inputs(struct xrt_device *xdev) 366 - { 367 - // Nothing to do here as the device does not send button reports. 368 361 } 369 362 370 363 static void ··· 1190 1183 } 1191 1184 } else if (d->config.variant == CONTROLLER_TRACKER_GEN1) { 1192 1185 d->base.name = XRT_DEVICE_VIVE_TRACKER_GEN1; 1193 - d->base.update_inputs = _update_tracker_inputs; 1186 + d->base.update_inputs = u_device_noop_update_inputs; 1194 1187 d->base.device_type = XRT_DEVICE_TYPE_GENERIC_TRACKER; 1195 1188 snprintf(d->base.str, XRT_DEVICE_NAME_LEN, "Vive Tracker Gen1 (vive)"); 1196 1189 } else if (d->config.variant == CONTROLLER_TRACKER_GEN2) { 1197 1190 d->base.name = XRT_DEVICE_VIVE_TRACKER_GEN2; 1198 - d->base.update_inputs = _update_tracker_inputs; 1191 + d->base.update_inputs = u_device_noop_update_inputs; 1199 1192 d->base.device_type = XRT_DEVICE_TYPE_GENERIC_TRACKER; 1200 1193 snprintf(d->base.str, XRT_DEVICE_NAME_LEN, "Vive Tracker Gen2 (vive)"); 1201 1194 } else if (d->config.variant == CONTROLLER_TRACKER_GEN3) { 1202 1195 d->base.name = XRT_DEVICE_VIVE_TRACKER_GEN3; 1203 - d->base.update_inputs = _update_tracker_inputs; 1196 + d->base.update_inputs = u_device_noop_update_inputs; 1204 1197 d->base.device_type = XRT_DEVICE_TYPE_GENERIC_TRACKER; 1205 1198 snprintf(d->base.str, XRT_DEVICE_NAME_LEN, "Vive Tracker Gen3 (vive)"); 1206 1199 } else if (d->config.variant == CONTROLLER_TRACKER_TUNDRA) { 1207 1200 d->base.name = XRT_DEVICE_VIVE_TRACKER_TUNDRA; 1208 - d->base.update_inputs = _update_tracker_inputs; 1201 + d->base.update_inputs = u_device_noop_update_inputs; 1209 1202 d->base.device_type = XRT_DEVICE_TYPE_GENERIC_TRACKER; 1210 1203 snprintf(d->base.str, XRT_DEVICE_NAME_LEN, "Tundra Tracker Gen3 (vive)"); 1211 1204 } else {
+1 -10
src/xrt/drivers/wmr/wmr_hmd.c
··· 1068 1068 */ 1069 1069 1070 1070 static void 1071 - wmr_hmd_update_inputs(struct xrt_device *xdev) 1072 - { 1073 - DRV_TRACE_MARKER(); 1074 - 1075 - struct wmr_hmd *wh = wmr_hmd(xdev); 1076 - (void)wh; 1077 - } 1078 - 1079 - static void 1080 1071 wmr_hmd_get_3dof_tracked_pose(struct xrt_device *xdev, 1081 1072 enum xrt_input_name name, 1082 1073 uint64_t at_timestamp_ns, ··· 1896 1887 } 1897 1888 1898 1889 // Populate the base members. 1899 - wh->base.update_inputs = wmr_hmd_update_inputs; 1890 + wh->base.update_inputs = u_device_noop_update_inputs; 1900 1891 wh->base.get_tracked_pose = wmr_hmd_get_tracked_pose; 1901 1892 wh->base.get_view_poses = wmr_hmd_get_view_poses; 1902 1893 wh->base.destroy = wmr_hmd_destroy;
+2 -8
src/xrt/targets/sdl_test/sdl_device.c
··· 1 - // Copyright 2020-2022, Collabora, Ltd. 1 + // Copyright 2020-2023, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 13 13 #include "util/u_device.h" 14 14 #include "util/u_distortion_mesh.h" 15 15 16 - 17 - static void 18 - sdl_hmd_update_inputs(struct xrt_device *xdev) 19 - { 20 - // Empty, you should put code to update the attached inputs fields. 21 - } 22 16 23 17 static void 24 18 sdl_hmd_get_tracked_pose(struct xrt_device *xdev, ··· 113 107 xdev->inputs[0].active = true; 114 108 115 109 // Function pointers. 116 - xdev->update_inputs = sdl_hmd_update_inputs; 110 + xdev->update_inputs = u_device_noop_update_inputs; 117 111 xdev->get_tracked_pose = sdl_hmd_get_tracked_pose; 118 112 xdev->get_view_poses = sdl_hmd_get_view_poses; 119 113 xdev->destroy = sdl_hmd_destroy;