mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
t/cli: Use new prober function helpers
This commit is contained in:
parent
b7defdb0ae
commit
e336590153
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue