The open source OpenXR runtime
0
fork

Configure Feed

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

st/p,t/common: Protect tracker-creation calls

authored by

Ryan Pavlik and committed by
Jakob Bornecrantz
ae6b0ad4 cd79bef0

+10 -6
+6 -4
src/xrt/state_trackers/prober/p_tracking.c
··· 170 170 struct xrt_colour_rgb_f32 rgb[2] = {{1.f, 0.f, 0.f}, {1.f, 0.f, 1.f}}; 171 171 172 172 // We create the two psmv trackers up front, but don't start them. 173 - // clang-format off 173 + #if defined(XRT_HAVE_OPENCV) && defined(XRT_BUILD_DRIVER_PSMV) 174 174 t_psmv_create(&fact->xfctx, &rgb[0], fact->data, &fact->xtmv[0], &xsinks[0]); 175 175 t_psmv_create(&fact->xfctx, &rgb[1], fact->data, &fact->xtmv[1], &xsinks[1]); 176 + #endif 177 + #if defined(XRT_HAVE_OPENCV) && defined(XRT_BUILD_DRIVER_PSVR) 176 178 t_psvr_create(&fact->xfctx, fact->data, &fact->xtvr, &xsinks[2]); 177 - // clang-format on 179 + #endif 178 180 179 181 // Setup origin to the common one. 180 182 fact->xtvr->origin = &fact->origin; ··· 318 320 static int 319 321 p_factory_create_tracked_psmv(struct xrt_tracking_factory *xfact, struct xrt_tracked_psmv **out_xtmv) 320 322 { 321 - #ifdef XRT_HAVE_OPENCV 323 + #if defined(XRT_HAVE_OPENCV) && defined(XRT_BUILD_DRIVER_PSMV) 322 324 struct p_factory *fact = p_factory(xfact); 323 325 324 326 struct xrt_tracked_psmv *xtmv = NULL; ··· 347 349 static int 348 350 p_factory_create_tracked_psvr(struct xrt_tracking_factory *xfact, struct xrt_tracked_psvr **out_xtvr) 349 351 { 350 - #ifdef XRT_HAVE_OPENCV 352 + #if defined(XRT_HAVE_OPENCV) && defined(XRT_BUILD_DRIVER_PSVR) 351 353 struct p_factory *fact = p_factory(xfact); 352 354 353 355 struct xrt_tracked_psvr *xtvr = NULL;
+4 -2
src/xrt/targets/common/target_builder_rgb_tracking.c
··· 130 130 struct xrt_colour_rgb_f32 rgb[2] = {{1.f, 0.f, 0.f}, {1.f, 0.f, 1.f}}; 131 131 132 132 // We create the two psmv trackers up front, but don't start them. 133 - // clang-format off 133 + #if defined(XRT_HAVE_OPENCV) && defined(XRT_BUILD_DRIVER_PSMV) 134 134 t_psmv_create(build->xfctx, &rgb[0], data, &build->psmv_red, &xsinks[0]); 135 135 t_psmv_create(build->xfctx, &rgb[1], data, &build->psmv_purple, &xsinks[1]); 136 + #endif 137 + #if defined(XRT_HAVE_OPENCV) && defined(XRT_BUILD_DRIVER_PSVR) 136 138 t_psvr_create(build->xfctx, data, &build->psvr, &xsinks[2]); 137 - // clang-format on 139 + #endif 138 140 139 141 // No longer needed. 140 142 t_stereo_camera_calibration_reference(&data, NULL);