The open source OpenXR runtime

xrt: Make it possible to get builders from prober

+40 -23
+18 -12
src/xrt/include/xrt/xrt_prober.h
··· 258 258 int (*list_video_devices)(struct xrt_prober *xp, xrt_prober_list_video_func_t cb, void *ptr); 259 259 260 260 /*! 261 - * Retrieve the raw @ref xrt_prober_entry and @ref xrt_auto_prober arrays. 261 + * Retrieve the raw @ref xrt_builder, @ref xrt_prober_entry and @ref xrt_auto_prober arrays. 262 262 * 263 263 * @param xp Pointer to self 264 + * @param[out] out_builder_count The size of @p out_builders 265 + * @param[out] out_builders An array of builders. 264 266 * @param[out] out_entry_count The size of @p out_entries 265 267 * @param[out] out_entries An array of prober entries 266 268 * @param[out] out_auto_probers An array of up to @ref XRT_MAX_AUTO_PROBERS auto-probers 267 269 * 268 270 * @return 0 on success, <0 on error. 269 271 */ 270 - int (*get_entries)(struct xrt_prober *xp, 271 - size_t *out_entry_count, 272 - struct xrt_prober_entry ***out_entries, 273 - struct xrt_auto_prober ***out_auto_probers); 272 + int (*get_builders)(struct xrt_prober *xp, 273 + size_t *out_builder_count, 274 + struct xrt_builder ***out_builders, 275 + size_t *out_entry_count, 276 + struct xrt_prober_entry ***out_entries, 277 + struct xrt_auto_prober ***out_auto_probers); 274 278 275 279 /*! 276 280 * Returns a string property on the device of the given type ··· 469 473 } 470 474 471 475 /*! 472 - * @copydoc xrt_prober::get_entries 476 + * @copydoc xrt_prober::get_builders 473 477 * 474 - * Helper function for @ref xrt_prober::get_entries. 478 + * Helper function for @ref xrt_prober::get_builders. 475 479 * 476 480 * @public @memberof xrt_prober 477 481 */ 478 482 static inline int 479 - xrt_prober_get_entries(struct xrt_prober *xp, 480 - size_t *out_entry_count, 481 - struct xrt_prober_entry ***out_entries, 482 - struct xrt_auto_prober ***out_auto_probers) 483 + xrt_prober_get_builders(struct xrt_prober *xp, 484 + size_t *out_builder_count, 485 + struct xrt_builder ***out_builders, 486 + size_t *out_entry_count, 487 + struct xrt_prober_entry ***out_entries, 488 + struct xrt_auto_prober ***out_auto_probers) 483 489 { 484 - return xp->get_entries(xp, out_entry_count, out_entries, out_auto_probers); 490 + return xp->get_builders(xp, out_builder_count, out_builders, out_entry_count, out_entries, out_auto_probers); 485 491 } 486 492 487 493 /*!
+19 -10
src/xrt/state_trackers/prober/p_prober.c
··· 113 113 p_list_video_devices(struct xrt_prober *xp, xrt_prober_list_video_func_t cb, void *ptr); 114 114 115 115 static int 116 - p_get_entries(struct xrt_prober *xp, 117 - size_t *out_num_entries, 118 - struct xrt_prober_entry ***out_entries, 119 - struct xrt_auto_prober ***out_auto_probers); 116 + p_get_builders(struct xrt_prober *xp, 117 + size_t *out_builder_count, 118 + struct xrt_builder ***out_builders, 119 + size_t *out_num_entries, 120 + struct xrt_prober_entry ***out_entries, 121 + struct xrt_auto_prober ***out_auto_probers); 120 122 121 123 static int 122 124 p_get_string_descriptor(struct xrt_prober *xp, ··· 442 444 p->base.open_hid_interface = p_open_hid_interface; 443 445 p->base.open_video_device = p_open_video_device; 444 446 p->base.list_video_devices = p_list_video_devices; 445 - p->base.get_entries = p_get_entries; 447 + p->base.get_builders = p_get_builders; 446 448 p->base.get_string_descriptor = p_get_string_descriptor; 447 449 p->base.can_open = p_can_open; 448 450 p->base.destroy = p_destroy; ··· 1310 1312 } 1311 1313 1312 1314 static int 1313 - p_get_entries(struct xrt_prober *xp, 1314 - size_t *out_num_entries, 1315 - struct xrt_prober_entry ***out_entries, 1316 - struct xrt_auto_prober ***out_auto_probers) 1315 + p_get_builders(struct xrt_prober *xp, 1316 + size_t *out_builder_count, 1317 + struct xrt_builder ***out_builders, 1318 + size_t *out_entry_count, 1319 + struct xrt_prober_entry ***out_entries, 1320 + struct xrt_auto_prober ***out_auto_probers) 1317 1321 { 1318 1322 XRT_TRACE_MARKER(); 1319 1323 1320 1324 struct prober *p = (struct prober *)xp; 1321 - *out_num_entries = p->num_entries; 1325 + 1326 + *out_builder_count = p->builder_count; 1327 + *out_builders = p->builders; 1328 + 1329 + *out_entry_count = p->num_entries; 1322 1330 *out_entries = p->entries; 1331 + 1323 1332 *out_auto_probers = p->auto_probers; 1324 1333 1325 1334 return 0;
+3 -1
src/xrt/targets/cli/cli_cmd_probe.c
··· 73 73 return do_exit(&xi, -1); 74 74 } 75 75 76 + size_t builder_count; 77 + struct xrt_builder **builders; 76 78 size_t num_entries; 77 79 struct xrt_prober_entry **entries; 78 80 struct xrt_auto_prober **auto_probers; 79 - ret = xrt_prober_get_entries(xp, &num_entries, &entries, &auto_probers); 81 + ret = xrt_prober_get_builders(xp, &builder_count, &builders, &num_entries, &entries, &auto_probers); 80 82 if (ret != 0) { 81 83 do_exit(&xi, ret); 82 84 }