The open source OpenXR runtime
0
fork

Configure Feed

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

xrt: Pass down broadcast sink to prober and builder when creating system

+46 -8
+3
src/xrt/auxiliary/util/u_builders.c
··· 186 186 u_builder_roles_helper_open_system(struct xrt_builder *xb, 187 187 cJSON *config, 188 188 struct xrt_prober *xp, 189 + struct xrt_session_event_sink *broadcast, 189 190 struct xrt_system_devices **out_xsysd, 190 191 struct xrt_space_overseer **out_xso, 191 192 u_builder_open_system_fn fn) ··· 246 247 u_builder_open_system_static_roles(struct xrt_builder *xb, 247 248 cJSON *config, 248 249 struct xrt_prober *xp, 250 + struct xrt_session_event_sink *broadcast, 249 251 struct xrt_system_devices **out_xsysd, 250 252 struct xrt_space_overseer **out_xso) 251 253 { ··· 255 257 xb, // 256 258 config, // 257 259 xp, // 260 + broadcast, // 258 261 out_xsysd, // 259 262 out_xso, // 260 263 ub->open_system_static_roles); //
+2
src/xrt/auxiliary/util/u_builders.h
··· 189 189 u_builder_roles_helper_open_system(struct xrt_builder *xb, 190 190 cJSON *config, 191 191 struct xrt_prober *xp, 192 + struct xrt_session_event_sink *broadcast, 192 193 struct xrt_system_devices **out_xsysd, 193 194 struct xrt_space_overseer **out_xso, 194 195 u_builder_open_system_fn fn); ··· 208 209 u_builder_open_system_static_roles(struct xrt_builder *xb, 209 210 cJSON *config, 210 211 struct xrt_prober *xp, 212 + struct xrt_session_event_sink *broadcast, 211 213 struct xrt_system_devices **out_xsysd, 212 214 struct xrt_space_overseer **out_xso); 213 215
+2 -1
src/xrt/auxiliary/util/u_system_helpers.c
··· 151 151 152 152 xrt_result_t 153 153 u_system_devices_create_from_prober(struct xrt_instance *xinst, 154 + struct xrt_session_event_sink *broadcast, 154 155 struct xrt_system_devices **out_xsysd, 155 156 struct xrt_space_overseer **out_xso) 156 157 { ··· 175 176 return xret; 176 177 } 177 178 178 - return xrt_prober_create_system(xp, out_xsysd, out_xso); 179 + return xrt_prober_create_system(xp, broadcast, out_xsysd, out_xso); 179 180 } 180 181 181 182 struct xrt_device *
+3
src/xrt/auxiliary/util/u_system_helpers.h
··· 20 20 extern "C" { 21 21 #endif 22 22 23 + struct xrt_session_event_sink; 24 + 23 25 24 26 /*! 25 27 * Helper struct to manage devices by implementing the @ref xrt_system_devices. ··· 160 162 */ 161 163 xrt_result_t 162 164 u_system_devices_create_from_prober(struct xrt_instance *xinst, 165 + struct xrt_session_event_sink *broadcast, 163 166 struct xrt_system_devices **out_xsysd, 164 167 struct xrt_space_overseer **out_xso); 165 168
+9 -2
src/xrt/include/xrt/xrt_prober.h
··· 36 36 struct xrt_builder; 37 37 struct xrt_system_devices; 38 38 struct xrt_space_overseer; 39 + struct xrt_session_event_sink; 39 40 struct os_hid_device; 40 41 41 42 /*! ··· 181 182 * Create system devices. 182 183 * 183 184 * @param[in] xp Prober self parameter. 185 + * @param[in] broadcast Event sink that broadcasts events to all sessions. 184 186 * @param[out] out_xsysd Return of system devices, the pointed pointer must be NULL. 185 187 * @param[out] out_xso Return of the @ref xrt_space_overseer, the pointed pointer must be NULL. 186 188 * 187 189 * @note Code consuming this interface should use xrt_prober_create_system() 188 190 */ 189 191 xrt_result_t (*create_system)(struct xrt_prober *xp, 192 + struct xrt_session_event_sink *broadcast, 190 193 struct xrt_system_devices **out_xsysd, 191 194 struct xrt_space_overseer **out_xso); 192 195 ··· 369 372 */ 370 373 static inline xrt_result_t 371 374 xrt_prober_create_system(struct xrt_prober *xp, 375 + struct xrt_session_event_sink *broadcast, 372 376 struct xrt_system_devices **out_xsysd, 373 377 struct xrt_space_overseer **out_xso) 374 378 { 375 - return xp->create_system(xp, out_xsysd, out_xso); 379 + return xp->create_system(xp, broadcast, out_xsysd, out_xso); 376 380 } 377 381 378 382 /*! ··· 582 586 * @param[in] xb Builder self parameter. 583 587 * @param[in] xp Prober 584 588 * @param[in] config JSON config object if found for this setter upper. 589 + * @param[in] broadcast Event sink that broadcasts events to all sessions. 585 590 * @param[out] out_xsysd Return of system devices, the pointed pointer must be NULL. 586 591 * @param[out] out_xso Return of the @ref xrt_space_overseer, the pointed pointer must be NULL. 587 592 * ··· 590 595 xrt_result_t (*open_system)(struct xrt_builder *xb, 591 596 cJSON *config, 592 597 struct xrt_prober *xp, 598 + struct xrt_session_event_sink *broadcast, 593 599 struct xrt_system_devices **out_xsysd, 594 600 struct xrt_space_overseer **out_xso); 595 601 ··· 628 634 xrt_builder_open_system(struct xrt_builder *xb, 629 635 cJSON *config, 630 636 struct xrt_prober *xp, 637 + struct xrt_session_event_sink *broadcast, 631 638 struct xrt_system_devices **out_xsysd, 632 639 struct xrt_space_overseer **out_xso) 633 640 { 634 - return xb->open_system(xb, config, xp, out_xsysd, out_xso); 641 + return xb->open_system(xb, config, xp, broadcast, out_xsysd, out_xso); 635 642 } 636 643 637 644 /*!
+15 -3
src/xrt/state_trackers/prober/p_prober.c
··· 89 89 p_dump(struct xrt_prober *xp); 90 90 91 91 static xrt_result_t 92 - p_create_system(struct xrt_prober *xp, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso); 92 + p_create_system(struct xrt_prober *xp, 93 + struct xrt_session_event_sink *broadcast, 94 + struct xrt_system_devices **out_xsysd, 95 + struct xrt_space_overseer **out_xso); 93 96 94 97 static int 95 98 p_select_device(struct xrt_prober *xp, struct xrt_device **xdevs, size_t xdev_count); ··· 972 975 } 973 976 974 977 static xrt_result_t 975 - p_create_system(struct xrt_prober *xp, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso) 978 + p_create_system(struct xrt_prober *xp, 979 + struct xrt_session_event_sink *broadcast, 980 + struct xrt_system_devices **out_xsysd, 981 + struct xrt_space_overseer **out_xso) 976 982 { 977 983 XRT_TRACE_MARKER(); 978 984 ··· 1070 1076 1071 1077 if (select != NULL) { 1072 1078 u_pp(dg, "\n\tUsing builder %s: %s", select->identifier, select->name); 1073 - xret = xrt_builder_open_system(select, p->json.root, xp, out_xsysd, out_xso); 1079 + xret = xrt_builder_open_system( // 1080 + select, // 1081 + p->json.root, // 1082 + xp, // 1083 + broadcast, // 1084 + out_xsysd, // 1085 + out_xso); // 1074 1086 1075 1087 if (xret == XRT_SUCCESS) { 1076 1088 print_system_devices(dg, *out_xsysd);
+1
src/xrt/targets/common/target_builder_remote.c
··· 75 75 remote_open_system(struct xrt_builder *xb, 76 76 cJSON *config, 77 77 struct xrt_prober *xp, 78 + struct xrt_session_event_sink *broadcast, 78 79 struct xrt_system_devices **out_xsysd, 79 80 struct xrt_space_overseer **out_xso) 80 81 {
+1
src/xrt/targets/common/target_builder_steamvr.c
··· 97 97 steamvr_open_system(struct xrt_builder *xb, 98 98 cJSON *config, 99 99 struct xrt_prober *xp, 100 + struct xrt_session_event_sink *broadcast, 100 101 struct xrt_system_devices **out_xsysd, 101 102 struct xrt_space_overseer **out_xso) 102 103 {
+5 -1
src/xrt/targets/common/target_instance.c
··· 71 71 usys = u_system_create(); 72 72 assert(usys != NULL); // Should never fail. 73 73 74 - xret = u_system_devices_create_from_prober(xinst, &xsysd, &xso); 74 + xret = u_system_devices_create_from_prober( // 75 + xinst, // xinst 76 + &usys->broadcast, // broadcast 77 + &xsysd, // out_xsysd 78 + &xso); // out_xso 75 79 if (xret != XRT_SUCCESS) { 76 80 return xret; 77 81 }
+5 -1
src/xrt/targets/common/target_instance_no_comp.c
··· 46 46 usys = u_system_create(); 47 47 assert(usys != NULL); // Should never fail. 48 48 49 - xret = u_system_devices_create_from_prober(xinst, &xsysd, &xso); 49 + xret = u_system_devices_create_from_prober( // 50 + xinst, // 51 + &usys->broadcast, // 52 + &xsysd, // 53 + &xso); // 50 54 if (xret != XRT_SUCCESS) { 51 55 u_system_destroy(&usys); 52 56 return xret;