summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorlandry <landry@openbsd.org>2020-07-05 11:47:50 +0000
committerlandry <landry@openbsd.org>2020-07-05 11:47:50 +0000
commit6c07c68ec7a72548650660e3830cd60fd8756c9c (patch)
tree6a52aa2ebfb9c75f52528a66ce172225cf51608e /sys
parentSave FPU state to PCB before running a signal handler. This doesn't (diff)
downloadwireguard-openbsd-6c07c68ec7a72548650660e3830cd60fd8756c9c.tar.xz
wireguard-openbsd-6c07c68ec7a72548650660e3830cd60fd8756c9c.zip
uvideo_querycap(): Set the 'device_caps' field of struct v4l2_capability like done in utvfu(4)
Fixes webcam detection in firefox 78, where code was added to check for V4L2_CAP_VIDEO_CAPTURE capability on 'device_caps', whereas we only set it in the 'capabilities' field. According to https://www.kernel.org/doc/html/v4.14/media/uapi/v4l/vidioc-querycap.html#description those distinct fields are here for drivers that provide several devices, but firefox decided to check for 'device_caps' field instead of 'capability' (cf https://hg.mozilla.org/integration/autoland/rev/33facf191f23) - so fill the field for compatibility reasons, while https://bugzilla.mozilla.org/show_bug.cgi?id=1650572 discusses with upstream what's the right way. ok mglocker@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uvideo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index e5900a6e437..1c809012ec1 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.207 2020/05/30 09:01:04 feinerer Exp $ */
+/* $OpenBSD: uvideo.c,v 1.208 2020/07/05 11:47:50 landry Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -2942,9 +2942,10 @@ uvideo_querycap(void *v, struct v4l2_capability *caps)
strlcpy(caps->bus_info, "usb", sizeof(caps->bus_info));
caps->version = 1;
- caps->capabilities = V4L2_CAP_VIDEO_CAPTURE
+ caps->device_caps = V4L2_CAP_VIDEO_CAPTURE
| V4L2_CAP_STREAMING
| V4L2_CAP_READWRITE;
+ caps->capabilities = caps->device_caps | V4L2_CAP_DEVICE_CAPS;
return (0);
}