The open source OpenXR runtime
0
fork

Configure Feed

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

xrt: Add serial and manufacturer to xrt_prober video device probing interface

authored by

Jakob Bornecrantz and committed by
Ryan Pavlik
80dd8929 1871653a

+24 -13
+3
doc/changes/xrt/mr.286.md
··· 1 + Expose manufacturer and serial number in the prober interface, right now only 2 + for the video device probing. But this is the only thing that really requires 3 + this in order to tell different cameras apart.
+3 -1
src/xrt/include/xrt/xrt_prober.h
··· 139 139 */ 140 140 typedef void (*xrt_prober_list_video_cb)(struct xrt_prober *xp, 141 141 struct xrt_prober_device *pdev, 142 - const char *name, 142 + const char *product, 143 + const char *manufacturer, 144 + const char *serial, 143 145 void *ptr); 144 146 145 147 /*!
+7 -5
src/xrt/state_trackers/gui/gui_scene_video.c
··· 43 43 static void 44 44 on_video_device(struct xrt_prober *xp, 45 45 struct xrt_prober_device *pdev, 46 - const char *name, 46 + const char *product, 47 + const char *manufacturer, 48 + const char *serial, 47 49 void *ptr) 48 50 { 49 51 struct video_select *vs = (struct video_select *)ptr; 50 52 51 - if (name == NULL) { 53 + if (product == NULL) { 52 54 return; 53 55 } 54 56 55 57 char buf[256] = {0}; 56 - snprintf(buf, sizeof(buf), "%04x:%04x '%s'\n", pdev->vendor_id, 57 - pdev->product_id, name); 58 + snprintf(buf, sizeof(buf), "%04x:%04x '%s' '%s'\n", pdev->vendor_id, 59 + pdev->product_id, product, serial); 58 60 if (!igButton(buf, button_dims)) { 59 61 return; 60 62 } 61 63 62 64 snprintf(vs->settings->camera_name, sizeof(vs->settings->camera_name), 63 - "%s", name); 65 + "%s", product); 64 66 65 67 vs->xfctx = U_TYPED_CALLOC(struct xrt_frame_context); 66 68 xrt_prober_open_video_device(xp, pdev, vs->xfctx, &vs->xfs);
+1 -1
src/xrt/state_trackers/prober/p_prober.c
··· 726 726 fill_out_product(p, pdev); 727 727 } 728 728 729 - cb(xp, &pdev->base, pdev->usb.product, ptr); 729 + cb(xp, &pdev->base, pdev->usb.product, NULL, NULL, ptr); 730 730 } 731 731 732 732 return 0;
+5 -3
src/xrt/state_trackers/prober/p_tracking.c
··· 90 90 static void 91 91 on_video_device(struct xrt_prober *xp, 92 92 struct xrt_prober_device *pdev, 93 - const char *name, 93 + const char *product, 94 + const char *manufacturer, 95 + const char *serial, 94 96 void *ptr) 95 97 { 96 98 struct p_factory *fact = (struct p_factory *)ptr; 97 99 98 - if (fact->xfs != NULL || name == NULL) { 100 + if (fact->xfs != NULL || product == NULL) { 99 101 return; 100 102 } 101 103 102 - if (strcmp(name, fact->settings.camera_name) != 0) { 104 + if (strcmp(product, fact->settings.camera_name) != 0) { 103 105 return; 104 106 } 105 107
+5 -3
src/xrt/targets/cli/cli_cmd_calibrate.c
··· 48 48 static void 49 49 list_cb(struct xrt_prober *xp, 50 50 struct xrt_prober_device *pdev, 51 - const char *name, 51 + const char *product, 52 + const char *manufacturer, 53 + const char *serial, 52 54 void *ptr) 53 55 { 54 56 struct program *p = (struct program *)ptr; 55 57 if (p->selected <= 0) { 56 - printf(" %i) %s\n", ++p->index, name); 58 + printf(" %i) %s\n", ++p->index, product); 57 59 } else if (p->selected == ++p->index) { 58 60 // Do stuff 59 61 printf(" :: Doing calibrartion\n"); 60 - printf(" Pretending to calibrarating camera '%s'\n", name); 62 + printf(" Pretending to calibrarating camera '%s'\n", product); 61 63 } 62 64 } 63 65