From fca0513b4e8b1920022e1450825e4920cd1a9a17 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 17 Jan 2020 22:05:51 +0000 Subject: [PATCH] d/v4l2: Print out the card name during debugging --- src/xrt/drivers/v4l2/v4l2_driver.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xrt/drivers/v4l2/v4l2_driver.c b/src/xrt/drivers/v4l2/v4l2_driver.c index fbd2682f2..5b4733219 100644 --- a/src/xrt/drivers/v4l2/v4l2_driver.c +++ b/src/xrt/drivers/v4l2/v4l2_driver.c @@ -272,6 +272,11 @@ v4l2_query_cap_and_validate(struct v4l2_fs *vid) return ret; } + char *card = (char *)cap.card; + snprintf(vid->base.name, sizeof(vid->base.name), "%s", card); + + V_DEBUG(vid, "V4L2 device: '%s'", vid->base.name); + if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { // not a video device V_ERROR(vid, "error: Is not a capture device."); @@ -314,9 +319,6 @@ v4l2_query_cap_and_validate(struct v4l2_fs *vid) /* * Find quirks */ - char *card = (char *)cap.card; - snprintf(vid->base.name, sizeof(vid->base.name), "%s", card); - vid->quirks.ps4_cam = strcmp(card, "USB Camera-OV580: USB Camera-OV") == 0;