diff options
author | 2019-08-07 11:14:16 +0000 | |
---|---|---|
committer | 2019-08-07 11:14:16 +0000 | |
commit | 7431723dfed6f636f37a38fcb9464d710881136c (patch) | |
tree | 309745fa316df7684fa4768a30ca36d235afd442 | |
parent | Improve RIB reload behaviour. Especially when the rtable changes or the (diff) | |
download | wireguard-openbsd-7431723dfed6f636f37a38fcb9464d710881136c.tar.xz wireguard-openbsd-7431723dfed6f636f37a38fcb9464d710881136c.zip |
Add support for the KSMedia 8-bit IR format, a greyscale format,
as seen on the IR camera of my Lenovo X395.
ok jan@
-rw-r--r-- | sys/dev/usb/uvideo.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/uvideo.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index c9b47aa986d..c90c563d569 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.201 2019/07/10 08:21:43 patrick Exp $ */ +/* $OpenBSD: uvideo.c,v 1.202 2019/08/07 11:14:16 patrick Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -998,6 +998,7 @@ uvideo_vs_parse_desc_format_uncompressed(struct uvideo_softc *sc, const usb_descriptor_t *desc) { struct usb_video_format_uncompressed_desc *d; + uint8_t guid_8bit_ir[16] = UVIDEO_FORMAT_GUID_KSMEDIA_L8_IR; int i; d = (struct usb_video_format_uncompressed_desc *)(uint8_t *)desc; @@ -1030,6 +1031,9 @@ uvideo_vs_parse_desc_format_uncompressed(struct uvideo_softc *sc, sc->sc_fmtgrp[i].pixelformat = V4L2_PIX_FMT_NV12; } else if (!strcmp(sc->sc_fmtgrp[i].format->u.uc.guidFormat, "UYVY")) { sc->sc_fmtgrp[i].pixelformat = V4L2_PIX_FMT_UYVY; + } else if (!memcmp(sc->sc_fmtgrp[i].format->u.uc.guidFormat, + guid_8bit_ir, 16)) { + sc->sc_fmtgrp[i].pixelformat = V4L2_PIX_FMT_GREY; } else { sc->sc_fmtgrp[i].pixelformat = 0; } diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h index fa4074015f2..25f0880a9bc 100644 --- a/sys/dev/usb/uvideo.h +++ b/sys/dev/usb/uvideo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.h,v 1.58 2019/07/09 09:33:55 patrick Exp $ */ +/* $OpenBSD: uvideo.h,v 1.59 2019/08/07 11:14:16 patrick Exp $ */ /* * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -308,6 +308,10 @@ struct usb_video_probe_commit { 0x55, 0x59, 0x56, 0x59, 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +#define UVIDEO_FORMAT_GUID_KSMEDIA_L8_IR { \ + 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + /* * USB Video Payload MJPEG */ |