diff --git a/src/xrt/targets/common/CMakeLists.txt b/src/xrt/targets/common/CMakeLists.txt index 61cb422bf..2b521c227 100644 --- a/src/xrt/targets/common/CMakeLists.txt +++ b/src/xrt/targets/common/CMakeLists.txt @@ -5,7 +5,14 @@ # Lists # -add_library(target_lists STATIC target_lists.c) +add_library(target_lists STATIC + target_builder_interface.h + target_builder_legacy.c + target_builder_remote.c + target_builder_rgb_tracking.c + target_lists.c + target_lists.h + ) target_link_libraries( target_lists PRIVATE diff --git a/src/xrt/targets/common/target_builder_interface.h b/src/xrt/targets/common/target_builder_interface.h new file mode 100644 index 000000000..9749ed10d --- /dev/null +++ b/src/xrt/targets/common/target_builder_interface.h @@ -0,0 +1,59 @@ +// Copyright 2022, Collabora, Ltd. +// SPDX-License-Identifier: BSL-1.0 +/*! + * @file + * @brief List of all @ref xrt_builder creation functions. + * @author Jakob Bornecrantz + */ + +#include "xrt/xrt_config_build.h" +#include "xrt/xrt_config_drivers.h" + + +/* + * + * Config checking. + * + */ + +#if defined(XRT_BUILD_DRIVER_PSMV) || defined(XRT_BUILD_DRIVER_PSVR) || defined(XRT_DOXYGEN) +#define T_BUILDER_RGB_TRACKING +#endif + +#if defined(XRT_BUILD_DRIVER_REMOTE) || defined(XRT_DOXYGEN) +#define T_BUILDER_REMOTE +#endif + +// Always enabled. +#define T_BUILDER_LEGACY + + +/* + * + * Setter upper creation functions. + * + */ + +#ifdef T_BUILDER_RGB_TRACKING +/*! + * RGB tracking based drivers, like @ref drv_psmv and @ref drv_psvr. + */ +struct xrt_builder * +t_builder_rgb_tracking_create(void); +#endif + +#ifdef T_BUILDER_REMOTE +/*! + * The remote driver builder. + */ +struct xrt_builder * +t_builder_remote_create(void); +#endif + +#ifdef T_BUILDER_LEGACY +/*! + * Builder used as a fallback for drivers not converted to builders yet. + */ +struct xrt_builder * +t_builder_legacy_create(void); +#endif diff --git a/src/xrt/targets/common/target_builder_legacy.c b/src/xrt/targets/common/target_builder_legacy.c new file mode 100644 index 000000000..fc8aae1e9 --- /dev/null +++ b/src/xrt/targets/common/target_builder_legacy.c @@ -0,0 +1,231 @@ +// Copyright 2022, Collabora, Ltd. +// SPDX-License-Identifier: BSL-1.0 +/*! + * @file + * @brief Fallback builder the old method of probing devices. + * @author Jakob Bornecrantz + * @ingroup xrt_iface + */ + +#include "xrt/xrt_config_drivers.h" +#include "xrt/xrt_prober.h" + +#include "util/u_misc.h" +#include "util/u_device.h" +#include "util/u_system_helpers.h" + +#include "target_builder_interface.h" + +#include + + +/* + * + * Helper functions. + * + */ + +static struct xrt_device * +get_ht_device(struct u_system_devices *usysd, enum xrt_input_name name) +{ + for (uint32_t i = 0; i < usysd->base.xdev_count; i++) { + struct xrt_device *xdev = usysd->base.xdevs[i]; + + if (xdev == NULL || !xdev->hand_tracking_supported) { + continue; + } + + for (uint32_t j = 0; j < xdev->input_count; j++) { + struct xrt_input *input = &xdev->inputs[j]; + + if (input->name == name) { + return xdev; + } + } + } + + return NULL; +} + +static const char *driver_list[] = { +#ifdef XRT_BUILD_DRIVER_HYDRA + "hydra", +#endif + +#ifdef XRT_BUILD_DRIVER_HDK + "hdk", +#endif + +#ifdef XRT_BUILD_DRIVER_VIVE + "vive", +#endif + +#ifdef XRT_BUILD_DRIVER_ULV2 + "ulv2", +#endif + +#ifdef XRT_BUILD_DRIVER_DEPTHAI + "depthai", +#endif + +#ifdef XRT_BUILD_DRIVER_WMR + "wmr", +#endif + +#ifdef XRT_BUILD_DRIVER_ARDUINO + "arduino", +#endif + +#ifdef XRT_BUILD_DRIVER_DAYDREAM + "daydream", +#endif + +#ifdef XRT_BUILD_DRIVER_SURVIVE + "survive", +#endif + +#ifdef XRT_BUILD_DRIVER_OHMD + "oh", +#endif + +#ifdef XRT_BUILD_DRIVER_NS + "ns", +#endif + +#ifdef XRT_BUILD_DRIVER_ANDROID + "android", +#endif + +#ifdef XRT_BUILD_DRIVER_ILLIXR + "illixr", +#endif + +#ifdef XRT_BUILD_DRIVER_REALSENSE + "rs", +#endif + +#ifdef XRT_BUILD_DRIVER_EUROC + "euroc", +#endif + +#ifdef XRT_BUILD_DRIVER_QWERTY + "qwerty", +#endif + +#if defined(XRT_BUILD_DRIVER_HANDTRACKING) && defined(XRT_BUILD_DRIVER_DEPTHAI) + "ht", +#endif +}; + +/* + * + * Member functions. + * + */ + +static xrt_result_t +legacy_estimate_system(struct xrt_builder *xb, + cJSON *config, + struct xrt_prober *xp, + struct xrt_builder_estimate *estimate) +{ + estimate->maybe.head = true; + estimate->maybe.left = true; + estimate->maybe.right = true; + estimate->priority = -20; + + return XRT_SUCCESS; +} + +static xrt_result_t +legacy_open_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_system_devices **out_xsysd) +{ + struct u_system_devices *usysd = u_system_devices_allocate(); + int ret = 0; + + assert(out_xsysd != NULL); + assert(*out_xsysd == NULL); + + + /* + * Create the devices. + */ + + ret = xrt_prober_probe(xp); + if (ret < 0) { + return XRT_ERROR_ALLOCATION; + } + + ret = xrt_prober_select(xp, usysd->base.xdevs, ARRAY_SIZE(usysd->base.xdevs)); + if (ret < 0) { + u_system_devices_destroy(&usysd); + } + + // Count the xdevs. + for (uint32_t i = 0; i < ARRAY_SIZE(usysd->base.xdevs); i++) { + if (usysd->base.xdevs[i] == NULL) { + break; + } + + usysd->base.xdev_count++; + } + + + /* + * Setup the roles. + */ + + int head, left, right; + u_device_assign_xdev_roles(usysd->base.xdevs, usysd->base.xdev_count, &head, &left, &right); + + if (head >= 0) { + usysd->base.roles.head = usysd->base.xdevs[head]; + } + if (left >= 0) { + usysd->base.roles.left = usysd->base.xdevs[left]; + } + if (right >= 0) { + usysd->base.roles.right = usysd->base.xdevs[right]; + } + + // Find hand tracking devices. + usysd->base.roles.hand_tracking.left = get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_LEFT); + usysd->base.roles.hand_tracking.right = get_ht_device(usysd, XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT); + + + /* + * Done. + */ + + *out_xsysd = &usysd->base; + + return XRT_SUCCESS; +} + +static void +legacy_destroy(struct xrt_builder *xb) +{ + free(xb); +} + + +/* + * + * 'Exported' functions. + * + */ + +struct xrt_builder * +t_builder_legacy_create(void) +{ + struct xrt_builder *xb = U_TYPED_CALLOC(struct xrt_builder); + xb->estimate_system = legacy_estimate_system; + xb->open_system = legacy_open_system; + xb->destroy = legacy_destroy; + xb->identifier = "legacy"; + xb->name = "Legacy probing system"; + xb->driver_identifiers = driver_list; + xb->driver_identifier_count = ARRAY_SIZE(driver_list); + + return xb; +} diff --git a/src/xrt/targets/common/target_builder_remote.c b/src/xrt/targets/common/target_builder_remote.c new file mode 100644 index 000000000..c2d3d042d --- /dev/null +++ b/src/xrt/targets/common/target_builder_remote.c @@ -0,0 +1,140 @@ +// Copyright 2022, Collabora, Ltd. +// SPDX-License-Identifier: BSL-1.0 +/*! + * @file + * @brief Remote driver builder. + * @author Jakob Bornecrantz + * @ingroup xrt_iface + */ + +#include "xrt/xrt_config_drivers.h" +#include "xrt/xrt_prober.h" + +#include "util/u_builders.h" +#include "util/u_config_json.h" +#include "util/u_system_helpers.h" + +#include "target_builder_interface.h" + +#ifdef XRT_BUILD_DRIVER_REMOTE +#include "remote/r_interface.h" +#endif + +#include + + +/* + * + * Helper functions. + * + */ + +static bool +get_settings(cJSON *json, int *port) +{ + struct u_config_json config_json = {0}; + u_config_json_open_or_create_main_file(&config_json); + + bool bret = u_config_json_get_remote_port(&config_json, port); + + u_config_json_close(&config_json); + + return bret; +} + +static const char *driver_list[] = { + "remote", +}; + + +/* + * + * Member functions. + * + */ + +static xrt_result_t +remote_estimate_system(struct xrt_builder *xb, + cJSON *config, + struct xrt_prober *xp, + struct xrt_builder_estimate *estimate) +{ + estimate->certain.head = true; + estimate->certain.left = true; + estimate->certain.right = true; + estimate->priority = -50; + + return XRT_SUCCESS; +} + +static xrt_result_t +remote_open_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_system_devices **out_xsysd) +{ + struct u_system_devices *usysd = u_system_devices_allocate(); + + assert(out_xsysd != NULL); + assert(*out_xsysd == NULL); + + + int port = 4242; + if (!get_settings(config, &port)) { + port = 4242; + } + + struct xrt_device *head = NULL, *left = NULL, *right = NULL; + r_create_devices(port, &head, &left, &right); + + if (head == NULL) { + u_system_devices_destroy(&usysd); + xrt_device_destroy(&left); + xrt_device_destroy(&right); + return XRT_ERROR_ALLOCATION; + } + + usysd->base.xdevs[usysd->base.xdev_count++] = head; + if (left != NULL) { + usysd->base.xdevs[usysd->base.xdev_count++] = left; + } + if (right != NULL) { + usysd->base.xdevs[usysd->base.xdev_count++] = right; + } + + usysd->base.roles.head = head; + usysd->base.roles.left = left; + usysd->base.roles.right = right; + usysd->base.roles.hand_tracking.left = left; + usysd->base.roles.hand_tracking.right = right; + + *out_xsysd = &usysd->base; + + return XRT_SUCCESS; +} + +static void +remote_destroy(struct xrt_builder *xb) +{ + free(xb); +} + + +/* + * + * 'Exported' functions. + * + */ + +struct xrt_builder * +t_builder_remote_create(void) +{ + struct xrt_builder *xb = U_TYPED_CALLOC(struct xrt_builder); + xb->estimate_system = remote_estimate_system; + xb->open_system = remote_open_system; + xb->destroy = remote_destroy; + xb->identifier = "remote"; + xb->name = "Remote simulation devices builder"; + xb->driver_identifiers = driver_list; + xb->driver_identifier_count = ARRAY_SIZE(driver_list); + xb->exclude_from_automatic_discovery = true; + + return xb; +} diff --git a/src/xrt/targets/common/target_builder_rgb_tracking.c b/src/xrt/targets/common/target_builder_rgb_tracking.c new file mode 100644 index 000000000..c915923d4 --- /dev/null +++ b/src/xrt/targets/common/target_builder_rgb_tracking.c @@ -0,0 +1,423 @@ +// Copyright 2022, Collabora, Ltd. +// SPDX-License-Identifier: BSL-1.0 +/*! + * @file + * @brief Builder to setup rgb tracking devices into a system. + * @author Jakob Bornecrantz + * @ingroup xrt_iface + */ + +#include "xrt/xrt_config_have.h" +#include "xrt/xrt_config_drivers.h" + +#include "xrt/xrt_prober.h" +#include "xrt/xrt_settings.h" +#include "xrt/xrt_frameserver.h" + +#include "util/u_sink.h" +#include "util/u_misc.h" +#include "util/u_device.h" +#include "util/u_logging.h" +#include "util/u_builders.h" +#include "util/u_config_json.h" +#include "util/u_system_helpers.h" + +#include "target_builder_interface.h" + +#include "dummy/dummy_interface.h" + +#ifdef XRT_HAVE_OPENCV +#include "tracking/t_tracking.h" +#endif + +#ifdef XRT_BUILD_DRIVER_PSVR +#include "psvr/psvr_interface.h" +#endif + +#ifdef XRT_BUILD_DRIVER_PSMV +#include "psmv/psmv_interface.h" +#endif + +#include + + +/* + * + * Helper functions. + * + */ + +static const char *driver_list[] = { +#ifdef XRT_BUILD_DRIVER_PSVR + "psvr", +#endif + +#ifdef XRT_BUILD_DRIVER_PSMV + "psmv", +#endif +}; + +static bool +get_settings(cJSON *json, struct xrt_settings_tracking *settings) +{ + struct u_config_json config_json = {0}; + u_config_json_open_or_create_main_file(&config_json); + + bool bret = u_config_json_get_tracking_settings(&config_json, settings); + + u_config_json_close(&config_json); + + return bret; +} + +struct build_state +{ + struct xrt_settings_tracking settings; + + struct xrt_frame_context *xfctx; + struct xrt_tracking_origin *origin; + struct xrt_fs *xfs; + struct xrt_tracked_psvr *psvr; + struct xrt_tracked_psmv *psmv_red; + struct xrt_tracked_psmv *psmv_purple; +}; + +#ifdef XRT_HAVE_OPENCV +static void +on_video_device(struct xrt_prober *xp, + struct xrt_prober_device *pdev, + const char *product, + const char *manufacturer, + const char *serial, + void *ptr) +{ + struct build_state *build = (struct build_state *)ptr; + + if (build->xfs != NULL || product == NULL) { + return; + } + + if (strcmp(product, build->settings.camera_name) != 0) { + return; + } + + xrt_prober_open_video_device(xp, pdev, build->xfctx, &build->xfs); +} + +static void +setup_pipeline(struct xrt_prober *xp, struct build_state *build) +{ + struct t_stereo_camera_calibration *data = NULL; + + xrt_prober_list_video_devices(xp, on_video_device, build); + + if (build->xfs == NULL) { + return; + } + + // Parse the calibration data from the file. + if (!t_stereo_camera_calibration_load(build->settings.calibration_path, &data)) { + return; + } + + struct xrt_frame_sink *xsink = NULL; + struct xrt_frame_sink *xsinks[4] = {0}; + struct xrt_colour_rgb_f32 rgb[2] = {{1.f, 0.f, 0.f}, {1.f, 0.f, 1.f}}; + + // We create the two psmv trackers up front, but don't start them. + // clang-format off + t_psmv_create(build->xfctx, &rgb[0], data, &build->psmv_red, &xsinks[0]); + t_psmv_create(build->xfctx, &rgb[1], data, &build->psmv_purple, &xsinks[1]); + t_psvr_create(build->xfctx, data, &build->psvr, &xsinks[2]); + // clang-format on + + // Setup origin to the common one. + build->psvr->origin = build->origin; + build->psmv_red->origin = build->origin; + build->psmv_purple->origin = build->origin; + + // We create the default multi-channel hsv filter. + struct t_hsv_filter_params params = T_HSV_DEFAULT_PARAMS(); + t_hsv_filter_create(build->xfctx, ¶ms, xsinks, &xsink); + + // The filter only supports yuv or yuyv formats. + u_sink_create_to_yuv_or_yuyv(build->xfctx, xsink, &xsink); + + // Put a queue before it to multi-thread the filter. + u_sink_simple_queue_create(build->xfctx, xsink, &xsink); + + // Hardcoded quirk sink. + struct u_sink_quirk_params qp; + U_ZERO(&qp); + + switch (build->settings.camera_type) { + case XRT_SETTINGS_CAMERA_TYPE_REGULAR_MONO: + qp.stereo_sbs = false; + qp.ps4_cam = false; + qp.leap_motion = false; + break; + case XRT_SETTINGS_CAMERA_TYPE_REGULAR_SBS: + qp.stereo_sbs = true; + qp.ps4_cam = false; + qp.leap_motion = false; + break; + case XRT_SETTINGS_CAMERA_TYPE_SLAM: + qp.stereo_sbs = true; + qp.ps4_cam = false; + qp.leap_motion = false; + break; + case XRT_SETTINGS_CAMERA_TYPE_PS4: + qp.stereo_sbs = true; + qp.ps4_cam = true; + qp.leap_motion = false; + break; + case XRT_SETTINGS_CAMERA_TYPE_LEAP_MOTION: + qp.stereo_sbs = true; + qp.ps4_cam = false; + qp.leap_motion = true; + break; + } + + u_sink_quirk_create(build->xfctx, xsink, &qp, &xsink); + + // Start the stream now. + xrt_fs_stream_start(build->xfs, xsink, XRT_FS_CAPTURE_TYPE_TRACKING, build->settings.camera_mode); +} +#endif + + +/* + * + * Member functions. + * + */ + +static xrt_result_t +rgb_estimate_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_builder_estimate *estimate) +{ + U_ZERO(estimate); + + struct u_builder_search_results results = {0}; + struct xrt_prober_device **xpdevs = NULL; + size_t xpdev_count = 0; + xrt_result_t xret = XRT_SUCCESS; + struct xrt_settings_tracking settings = {0}; + + + /* + * Pre device looking stuff. + */ + + // Lock the device list + xret = xrt_prober_lock_list(xp, &xpdevs, &xpdev_count); + if (xret != XRT_SUCCESS) { + return xret; + } + + // Is tracking setup? + if (get_settings(config, &settings)) { + estimate->certain.dof6 = true; + } + + + /* + * Can we find PSVR HND? + */ + +#ifdef XRT_BUILD_DRIVER_PSVR + struct xrt_prober_device *psvr = u_builder_find_prober_device(xpdevs, xpdev_count, PSVR_VID, PSVR_PID); + if (psvr != NULL) { + estimate->certain.head = true; + } +#endif + + + /* + * Can we find any PSMV controllers? + */ + +#ifdef XRT_BUILD_DRIVER_PSMV + static struct u_builder_search_filter move_filters[2] = { + {PSMV_VID, PSMV_PID_ZCM1, XRT_BUS_TYPE_BLUETOOTH}, + {PSMV_VID, PSMV_PID_ZCM2, XRT_BUS_TYPE_BLUETOOTH}, + }; + + u_builder_search(xp, xpdevs, xpdev_count, move_filters, ARRAY_SIZE(move_filters), &results); + + if (results.xpdev_count >= 1) { + estimate->certain.right = true; + } + + if (results.xpdev_count >= 2) { + estimate->certain.left = true; + } +#endif + + + /* + * Tidy. + */ + + xret = xrt_prober_unlock_list(xp, &xpdevs); + assert(xret == XRT_SUCCESS); + + return XRT_SUCCESS; +} + +static xrt_result_t +rgb_open_system(struct xrt_builder *xb, cJSON *config, struct xrt_prober *xp, struct xrt_system_devices **out_xsysd) +{ + struct u_builder_search_results results = {0}; + struct xrt_prober_device **xpdevs = NULL; + size_t xpdev_count = 0; + xrt_result_t xret = XRT_SUCCESS; + + assert(out_xsysd != NULL); + assert(*out_xsysd == NULL); + + struct u_system_devices *usysd = u_system_devices_allocate(); + + + /* + * Tracking. + */ + + struct build_state build = {0}; + if (get_settings(config, &build.settings)) { +#ifdef XRT_HAVE_OPENCV + build.xfctx = &usysd->xfctx; + build.origin = &usysd->origin; + build.origin->type = XRT_TRACKING_TYPE_RGB; + build.origin->offset.orientation.y = 1.0f; + build.origin->offset.position.z = -2.0f; + build.origin->offset.position.y = 1.0f; + + setup_pipeline(xp, &build); +#else + U_LOG_W("Tracking setup but not built with OpenCV/Tracking!"); +#endif + } else { + U_LOG_I("Not tracking setup in config file, only in 3dof mode available"); + } + + + /* + * Devices. + */ + + // Lock the device list + xret = xrt_prober_lock_list(xp, &xpdevs, &xpdev_count); + if (xret != XRT_SUCCESS) { + u_system_devices_destroy(&usysd); + return xret; + } + + struct xrt_device *head = NULL; + struct xrt_device *psmv_red = NULL; + struct xrt_device *psmv_purple = NULL; + +#ifdef XRT_BUILD_DRIVER_PSVR + struct xrt_prober_device *psvr = u_builder_find_prober_device(xpdevs, xpdev_count, PSVR_VID, PSVR_PID); + if (psvr != NULL) { + head = psvr_device_create(build.psvr); + } +#endif + + if (head != NULL) { +#ifdef XRT_HAVE_OPENCV + if (build.psvr != NULL) { + t_psvr_start(build.psvr); + } +#endif + } else { + head = dummy_hmd_create(); + } + + +#ifdef XRT_BUILD_DRIVER_PSMV + static struct u_builder_search_filter move_filters[2] = { + {PSMV_VID, PSMV_PID_ZCM1, XRT_BUS_TYPE_BLUETOOTH}, + {PSMV_VID, PSMV_PID_ZCM2, XRT_BUS_TYPE_BLUETOOTH}, + }; + + u_builder_search(xp, xpdevs, xpdev_count, move_filters, ARRAY_SIZE(move_filters), &results); + + if (results.xpdev_count >= 1) { + psmv_red = psmv_device_create(xp, results.xpdevs[0], build.psmv_red); + +#ifdef XRT_HAVE_OPENCV + if (psmv_red != NULL && build.psmv_red != NULL) { + t_psmv_start(build.psmv_red); + } +#endif + } + + if (results.xpdev_count >= 2) { + psmv_purple = psmv_device_create(xp, results.xpdevs[1], build.psmv_purple); + +#ifdef XRT_HAVE_OPENCV + if (psmv_purple != NULL && build.psmv_purple != NULL) { + t_psmv_start(build.psmv_purple); + } +#endif + } +#endif + + // Unlock the device list + xret = xrt_prober_unlock_list(xp, &xpdevs); + if (xret != XRT_SUCCESS) { + u_system_devices_destroy(&usysd); + return xret; + } + + + usysd->base.xdevs[usysd->base.xdev_count++] = head; + usysd->base.roles.head = head; + + if (psmv_red != NULL) { + usysd->base.xdevs[usysd->base.xdev_count++] = psmv_red; + usysd->base.roles.right = psmv_red; + } + + if (psmv_purple != NULL) { + usysd->base.xdevs[usysd->base.xdev_count++] = psmv_purple; + usysd->base.roles.left = psmv_purple; + } + + + /* + * Done. + */ + + *out_xsysd = &usysd->base; + + return XRT_SUCCESS; +} + +static void +rgb_destroy(struct xrt_builder *xb) +{ + free(xb); +} + + +/* + * + * 'Exported' functions. + * + */ + +struct xrt_builder * +t_builder_rgb_tracking_create(void) +{ + struct xrt_builder *xb = U_TYPED_CALLOC(struct xrt_builder); + xb->estimate_system = rgb_estimate_system; + xb->open_system = rgb_open_system; + xb->destroy = rgb_destroy; + xb->identifier = "rgb_tracking"; + xb->name = "RGB tracking based devices (PSVR, PSMV, ...)"; + xb->driver_identifiers = driver_list; + xb->driver_identifier_count = ARRAY_SIZE(driver_list); + + return xb; +} diff --git a/src/xrt/targets/common/target_lists.c b/src/xrt/targets/common/target_lists.c index 19e247972..6c1488327 100644 --- a/src/xrt/targets/common/target_lists.c +++ b/src/xrt/targets/common/target_lists.c @@ -9,6 +9,8 @@ #include "xrt/xrt_config_drivers.h" #include "target_lists.h" +#include "target_builder_interface.h" + #ifdef XRT_BUILD_DRIVER_ARDUINO #include "arduino/arduino_interface.h" @@ -94,6 +96,26 @@ #endif +/*! + * Builders + */ +xrt_builder_create_func_t target_builder_list[] = { +#ifdef T_BUILDER_RGB_TRACKING + t_builder_rgb_tracking_create, +#endif // T_BUILDER_RGB_TRACKING + +#ifdef T_BUILDER_REMOTE + t_builder_remote_create, +#endif // T_BUILDER_REMOTE + +#ifdef T_BUILDER_LEGACY + t_builder_legacy_create, +#endif // T_BUILDER_LEGACY + + NULL, +}; + + /*! * Each entry should be a vendor ID (VID), product ID (PID), a "found" function, * and a string literal name. @@ -220,7 +242,7 @@ xrt_auto_prober_create_func_t target_auto_list[] = { }; struct xrt_prober_entry_lists target_lists = { - NULL, + target_builder_list, target_entry_lists, target_auto_list, NULL, diff --git a/src/xrt/targets/common/target_lists.h b/src/xrt/targets/common/target_lists.h index 02c80cf4c..25aa4aa6a 100644 --- a/src/xrt/targets/common/target_lists.h +++ b/src/xrt/targets/common/target_lists.h @@ -13,4 +13,5 @@ extern struct xrt_prober_entry target_entry_list[]; extern struct xrt_prober_entry *target_entry_lists[]; extern xrt_auto_prober_create_func_t target_auto_list[]; +extern xrt_builder_create_func_t target_builder_list[]; extern struct xrt_prober_entry_lists target_lists;