From e336590153564a884f3d51c585226ba332a42bce Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 30 Jun 2019 14:30:10 +0100 Subject: [PATCH] t/cli: Use new prober function helpers --- src/xrt/targets/cli/cli_cmd_calibrate.c | 8 ++++---- src/xrt/targets/cli/cli_cmd_test.c | 11 ++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/xrt/targets/cli/cli_cmd_calibrate.c b/src/xrt/targets/cli/cli_cmd_calibrate.c index 6d95197e3..9e59c5807 100644 --- a/src/xrt/targets/cli/cli_cmd_calibrate.c +++ b/src/xrt/targets/cli/cli_cmd_calibrate.c @@ -36,7 +36,7 @@ init(struct program *p) } // Need to prime the prober before listing devices. - ret = p->xp->probe(p->xp); + ret = xrt_prober_probe(p->xp); if (ret != 0) { fprintf(stderr, "Failed to probe for devices.\n"); return ret; @@ -71,7 +71,7 @@ print_cameras(struct program *p) int ret; p->index = 0; - ret = p->xp->list_video_devices(p->xp, list_cb, p); + ret = xrt_prober_list_video_devices(p->xp, list_cb, p); if (ret != 0) { return ret; } @@ -99,7 +99,7 @@ print_cameras(struct program *p) p->index = 0; p->selected = selected; - ret = p->xp->list_video_devices(p->xp, list_cb, p); + ret = xrt_prober_list_video_devices(p->xp, list_cb, p); if (ret != 0) { return ret; } @@ -112,7 +112,7 @@ static int do_exit(struct program *p, int ret) { if (p->xp != NULL) { - p->xp->destroy(&p->xp); + xrt_prober_destroy(&p->xp); } printf(" :: Exiting '%i'\n", ret); diff --git a/src/xrt/targets/cli/cli_cmd_test.c b/src/xrt/targets/cli/cli_cmd_test.c index 7db532edc..6269647f8 100644 --- a/src/xrt/targets/cli/cli_cmd_test.c +++ b/src/xrt/targets/cli/cli_cmd_test.c @@ -16,10 +16,7 @@ static int do_exit(struct xrt_prober **xp_ptr, int ret) { - if (*xp_ptr != NULL) { - (*xp_ptr)->destroy(xp_ptr); - *xp_ptr = NULL; - } + xrt_prober_destroy(xp_ptr); printf(" :: Exiting '%i'\n", ret); @@ -46,7 +43,7 @@ cli_cmd_test(int argc, const char **argv) // Need to prime the prober with devices before dumping and listing. printf(" :: Probing!\n"); - ret = xp->probe(xp); + ret = xrt_prober_probe(xp); if (ret != 0) { return do_exit(&xp, ret); } @@ -54,7 +51,7 @@ cli_cmd_test(int argc, const char **argv) // So the user can see what we found. printf(" :: Dumping!\n"); - ret = xp->dump(xp); + ret = xrt_prober_dump(xp); if (ret != 0) { do_exit(&xp, ret); } @@ -62,7 +59,7 @@ cli_cmd_test(int argc, const char **argv) // Multiple devices can be found. printf(" :: Selecting devices!\n"); - ret = xp->select(xp, xdevs, NUM_XDEVS); + ret = xrt_prober_select(xp, xdevs, NUM_XDEVS); if (ret != 0) { do_exit(&xp, ret); }